You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Migrate 'main' property in MigrateToGradle9 (#7504)
* Migrate 'main' property in MigrateToGradle9
* UseMainClassProperty: support Kotlin DSL and tighten hot path
Detect `tasks.register<JavaExec>("name")` via `getTypeParameters()` so the
recipe also rewrites `main` to `mainClass` in `.gradle.kts` files. Reorder
the `visitAssignment` checks so the cheap `instanceof` and simple-name
checks run before the cursor-message lookup.
* UseMainClassProperty: use Lombok @value fields for displayName and description
Matches the pattern used in JacocoReportDeprecations.
---------
Co-authored-by: Tim te Beek <tim@moderne.io>
maven,org.openrewrite:rewrite-gradle,org.openrewrite.gradle.EnableGradleBuildCache,Enable Gradle build cache,"Enable the Gradle build cache. By enabling build cache the build outputs are stored externally and fetched from the cache when it is determined that those inputs have no changed, avoiding the expensive work of regenerating them. See the [Gradle Build Cache](https://docs.gradle.org/current/userguide/build_cache.html) for more information.",2,,Gradle,,
56
56
maven,org.openrewrite:rewrite-gradle,org.openrewrite.gradle.EnableGradleParallelExecution,Enable Gradle parallel execution,"Most builds consist of more than one project and some of those projects are usually independent of one another. Yet Gradle will only run one task at a time by default, regardless of the project structure. By using the `--parallel` switch, you can force Gradle to execute tasks in parallel as long as those tasks are in different projects. See the [Gradle performance documentation](https://docs.gradle.org/current/userguide/performance.html#parallel_execution) for more information.",2,,Gradle,,
57
57
maven,org.openrewrite:rewrite-gradle,org.openrewrite.gradle.gradle8.JacocoReportDeprecations,Replace Gradle 8 introduced deprecations in JaCoCo report task,Set the `enabled` to `required` and the `destination` to `outputLocation` for Reports deprecations that were removed in gradle 8. See [the gradle docs on this topic](https://docs.gradle.org/current/userguide/upgrading_version_7.html#report_and_testreport_api_cleanup).,1,Gradle8,Gradle,,
58
+
maven,org.openrewrite:rewrite-gradle,org.openrewrite.gradle.gradle9.UseMainClassProperty,Use `mainClass` instead of `main` for `JavaExec` tasks,The `main` property on `JavaExec` tasks was deprecated in Gradle 7.1 and removed in Gradle 9.0. Use the `mainClass` property instead.,1,Gradle9,Gradle,,
58
59
maven,org.openrewrite:rewrite-gradle,org.openrewrite.gradle.plugins.AddBuildPlugin,Add Gradle plugin,Add a build plugin to a Gradle build file's `plugins` block.,1,Plugins,Gradle,"[{""name"":""pluginId"",""type"":""String"",""displayName"":""Plugin id"",""description"":""The plugin id to apply."",""example"":""com.jfrog.bintray"",""required"":true},{""name"":""version"",""type"":""String"",""displayName"":""Plugin version"",""description"":""An exact version number or node-style semver selector used to select the version number. You can also use `latest.release` for the latest available version and `latest.patch` if the current version is a valid semantic version. For more details, you can look at the documentation page of [version selectors](https://docs.openrewrite.org/reference/dependency-version-selectors)."",""example"":""3.x""},{""name"":""versionPattern"",""type"":""String"",""displayName"":""Version pattern"",""description"":""Allows version selection to be extended beyond the original Node Semver semantics. So for example,Setting 'version' to \""25-29\"" can be paired with a metadata pattern of \""-jre\"" to select Guava 29.0-jre"",""example"":""-jre""},{""name"":""apply"",""type"":""Boolean"",""displayName"":""Apply plugin"",""description"":""Immediate apply the plugin. Defaults to `true`."",""valid"":[""true"",""false""]},{""name"":""acceptTransitive"",""type"":""Boolean"",""displayName"":""Accept transitive"",""description"":""Some plugins apply other plugins. When this is set to true no plugin declaration will be added if the plugin is already applied transitively. When this is set to false the plugin will be added explicitly even if it is already applied transitively. Defaults to `true`."",""valid"":[""true"",""false""]}]",
59
60
maven,org.openrewrite:rewrite-gradle,org.openrewrite.gradle.plugins.AddDevelocityGradlePlugin,Add the Develocity Gradle plugin,Add the Develocity Gradle plugin to settings.gradle files.,1,Plugins,Gradle,"[{""name"":""version"",""type"":""String"",""displayName"":""Plugin version"",""description"":""An exact version number or node-style semver selector used to select the version number. You can also use `latest.release` for the latest available version and `latest.patch` if the current version is a valid semantic version. For more details, you can look at the documentation page of [version selectors](https://docs.openrewrite.org/reference/dependency-version-selectors). Defaults to `latest.release`."",""example"":""3.x""},{""name"":""server"",""type"":""String"",""displayName"":""Server URL"",""description"":""The URL of the Develocity server. If omitted the recipe will set no URL and Gradle will direct scans to https://scans.gradle.com/"",""example"":""https://scans.gradle.com/""},{""name"":""allowUntrustedServer"",""type"":""Boolean"",""displayName"":""Allow untrusted server"",""description"":""When set to `true` the plugin will be configured to allow unencrypted http connections with the server. If set to `false` or omitted, the plugin will refuse to communicate without transport layer security enabled."",""example"":""true""},{""name"":""captureTaskInputFiles"",""type"":""Boolean"",""displayName"":""Capture task input files"",""description"":""When set to `true` the plugin will capture additional information about the inputs to Gradle tasks. This increases the size of build scans, but is useful for diagnosing issues with task caching. "",""example"":""true""},{""name"":""uploadInBackground"",""type"":""Boolean"",""displayName"":""Upload in background"",""description"":""When set to `true` the plugin will capture additional information about the outputs of Gradle tasks. This increases the size of build scans, but is useful for diagnosing issues with task caching. "",""example"":""true""},{""name"":""publishCriteria"",""type"":""PublishCriteria"",""displayName"":""Publish criteria"",""description"":""When set to `Always` the plugin will publish build scans of every single build. When set to `Failure` the plugin will only publish build scans when the build fails. When omitted scans will be published only when the `--scan` option is passed to the build."",""example"":""Always"",""valid"":[""Always"",""Failure""]}]","[{""name"":""org.openrewrite.maven.table.MavenMetadataFailures"",""displayName"":""Maven metadata failures"",""instanceName"":""Maven metadata failures"",""description"":""Attempts to resolve maven metadata that failed."",""columns"":[{""name"":""group"",""type"":""String"",""displayName"":""Group id"",""description"":""The groupId of the artifact for which the metadata download failed.""},{""name"":""artifactId"",""type"":""String"",""displayName"":""Artifact id"",""description"":""The artifactId of the artifact for which the metadata download failed.""},{""name"":""version"",""type"":""String"",""displayName"":""Version"",""description"":""The version of the artifact for which the metadata download failed.""},{""name"":""mavenRepositoryUri"",""type"":""String"",""displayName"":""Maven repository"",""description"":""The URL of the Maven repository that the metadata download failed on.""},{""name"":""snapshots"",""type"":""String"",""displayName"":""Snapshots"",""description"":""Does the repository support snapshots.""},{""name"":""releases"",""type"":""String"",""displayName"":""Releases"",""description"":""Does the repository support releases.""},{""name"":""failure"",""type"":""String"",""displayName"":""Failure"",""description"":""The reason the metadata download failed.""}]}]"
60
61
maven,org.openrewrite:rewrite-gradle,org.openrewrite.gradle.plugins.AddSettingsPlugin,Add Gradle settings plugin,Add plugin to Gradle settings file `plugins` block by id.,1,Plugins,Gradle,"[{""name"":""pluginId"",""type"":""String"",""displayName"":""Plugin id"",""description"":""The plugin id to apply."",""example"":""com.jfrog.bintray"",""required"":true},{""name"":""version"",""type"":""String"",""displayName"":""Plugin version"",""description"":""An exact version number or node-style semver selector used to select the version number. You can also use `latest.release` for the latest available version and `latest.patch` if the current version is a valid semantic version. For more details, you can look at the documentation page of [version selectors](https://docs.openrewrite.org/reference/dependency-version-selectors). Defaults to `latest.release`."",""example"":""3.x""},{""name"":""versionPattern"",""type"":""String"",""displayName"":""Version pattern"",""description"":""Allows version selection to be extended beyond the original Node Semver semantics. So for example,Setting 'version' to \""25-29\"" can be paired with a metadata pattern of \""-jre\"" to select Guava 29.0-jre"",""example"":""-jre""},{""name"":""apply"",""type"":""Boolean"",""displayName"":""Apply plugin"",""description"":""Immediate apply the plugin. Defaults to `true`."",""valid"":[""true"",""false""]},{""name"":""acceptTransitive"",""type"":""Boolean"",""displayName"":""Accept transitive"",""description"":""Some plugins apply other plugins. When this is set to true no plugin declaration will be added if the plugin is already applied transitively. When this is set to false the plugin will be added explicitly even if it is already applied transitively. Defaults to `true`."",""valid"":[""true"",""false""]}]",
0 commit comments