Skip to content

feat: migrate supporting features - #31

Merged
shossain786 merged 4 commits into
seleniumboot:mainfrom
PUSHPAK-JAISWAL:feat/migrate2
Oct 3, 2026
Merged

shossain786 merged 4 commits into
seleniumboot:mainfrom
PUSHPAK-JAISWAL:feat/migrate2

Conversation

@PUSHPAK-JAISWAL

Copy link
Copy Markdown
Contributor

What & why

Detection for Gradle projects (Groovy and Kotlin DSL) was previously added in #12. This PR implements the remaining piece of #8: swapping the org.seleniumhq.selenium:selenium-java dependency block in build.gradle and build.gradle.kts files to io.github.seleniumboot:selenium-boot:3.5.0 during migrate.

Key changes:

  • In Migrator.java, use BuildFileAnalyzer.findBuildFiles to discover all build descriptors (pom.xml, build.gradle, build.gradle.kts) in the destination directory.
  • Implemented migrateGradle using text-level regex transformations (no Gradle runtime required), supporting:
    • String notation in Groovy and Kotlin DSL (single quotes, double quotes, triple quotes, with or without version/parentheses)
    • Map notation (group: ..., name: ...) and multi-arg notation
    • Trailing configuration blocks (e.g., exclude closures) and inline comments
    • Preserving commented-out dependencies without modifying them
  • Excluded .gradle and build directories during project copying so Gradle cache and build outputs are not duplicated in the migrated project.
  • Preserved post-migration technology detections, recognized technologies, and locator counts in the returned Result.remaining() report.
  • Updated README.md to note that migrate rewrites both Maven and Gradle build descriptors.

Closes #8

Type of change

  • New rule (MIG-xxx)
  • Bug fix
  • Documentation
  • Internal refactor / test coverage
  • New feature (Gradle migration support)

Checklist

  • mvn test passes
  • New behaviour is covered by a test
  • Nothing here modifies the user's original project (read-only by default)
  • Rules are AST-based and deterministic, not AI-generated transformations
  • Any new mapping was checked against the Selenium Boot docs first
  • If a new rule was added, the table in README.md was updated (N/A)

Notes for reviewers

  • migrateGradle(Path buildFile) operates purely on text via regex replacement, matching the approach specified in Gradle project support #8.
  • Added 5 new unit tests in MigratorTest covering Groovy DSL, Kotlin DSL, syntax variations, comments preservation, directory exclusion, and the existing fixtures in src/test/resources/gradle-groovy and src/test/resources/gradle-kotlin.
  • Added a CLI test in CliTest to verify end-to-end migrate output on Gradle projects.

@PUSHPAK-JAISWAL

Copy link
Copy Markdown
Contributor Author

@shossain786 i have updated and resolved the merge conflict and the failing test issues please review and suggest changes if any.

@shossain786

Copy link
Copy Markdown
Contributor

Thanks @PUSHPAK-JAISWAL — #32 (migration report) just merged and now conflicts with this branch in Migrator.java. Could you rebase onto main? One decision when resolving: includeSourceManualFindings now passes source.detectedTechnologies()/recognizedTechnologies()/locatorCounts() (from #32) while this PR passes output.*. The report should describe what was found in the original project, so please keep source.*. Then I'll finish the review.

@PUSHPAK-JAISWAL

Copy link
Copy Markdown
Contributor Author

@shossain786 i think the conflicts are automatically resolved but i will work on the changes asked right now

@PUSHPAK-JAISWAL

Copy link
Copy Markdown
Contributor Author

@shossain786 updated includeSourceManualFindings to use the original analysis for detected technologies, recognized technologies, and locator counts. Updated the Gradle migration tests to confirm the report keeps the original Selenium dependency rather than the migrated one.

@shossain786
shossain786 merged commit 542be17 into seleniumboot:main Oct 3, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Gradle project support

2 participants