diff --git a/rewrite-gradle/build.gradle.kts b/rewrite-gradle/build.gradle.kts index bd3076b1add..109bf35375c 100644 --- a/rewrite-gradle/build.gradle.kts +++ b/rewrite-gradle/build.gradle.kts @@ -85,3 +85,10 @@ tasks.named("processResources") { into("META-INF/rewrite/classpath") } } + +//Javadoc compiler will complain about the use of the internal types. +tasks.withType { + exclude( + "**/GradleProject**" + ) +} diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/marker/GradleProject.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/marker/GradleProject.java index a5d02e1d57e..a98f5a35ce8 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/marker/GradleProject.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/marker/GradleProject.java @@ -15,6 +15,8 @@ */ package org.openrewrite.gradle.marker; +import com.fasterxml.jackson.annotation.JsonCreator; +import lombok.AllArgsConstructor; import lombok.Value; import lombok.With; import org.openrewrite.internal.lang.Nullable; @@ -32,13 +34,22 @@ */ @SuppressWarnings("unused") @Value +@AllArgsConstructor(onConstructor_ = { @JsonCreator }) public class GradleProject implements Marker, Serializable { @With UUID id; + @With + @Nullable + String group; + @With String name; + @With + @Nullable + String version; + @With String path; @@ -53,6 +64,19 @@ public class GradleProject implements Marker, Serializable { Map nameToConfiguration; + // Backwards compatibility to ease convoluted release process with rewrite-gradle-tooling-model + public GradleProject( + UUID id, + String name, + String path, + List plugins, + List mavenRepositories, + List mavenPluginRepositories, + Map nameToConfiguration + ) { + this(id, "", name, "", path, plugins, mavenRepositories, mavenPluginRepositories, nameToConfiguration); + } + public List getMavenPluginRepositories() { return mavenPluginRepositories == null ? Collections.emptyList() : mavenPluginRepositories; } @@ -120,7 +144,9 @@ public GradleProject withNameToConfiguration(Map