Class GradleProject

java.lang.Object
org.openrewrite.gradle.marker.GradleProject
All Implemented Interfaces:
Serializable, org.openrewrite.marker.Marker

public class GradleProject extends Object implements org.openrewrite.marker.Marker, Serializable
Contains metadata about a Gradle Project. Queried from Gradle itself when the OpenRewrite build plugin runs. Not automatically available on LSTs that aren't parsed through a Gradle plugin, so tests won't automatically have access to this metadata.
See Also:
  • Constructor Details

    • GradleProject

      public GradleProject()
  • Method Details

    • getMavenPluginRepositories

      public List<org.openrewrite.maven.tree.MavenRepository> getMavenPluginRepositories()
    • getConfiguration

      @Nullable public @Nullable GradleDependencyConfiguration getConfiguration(String name)
    • getConfigurations

      public List<GradleDependencyConfiguration> getConfigurations()
    • configurationsExtendingFrom

      public List<GradleDependencyConfiguration> configurationsExtendingFrom(GradleDependencyConfiguration parentConfiguration, boolean transitive)
      List the configurations which extend from the given configuration. Assuming a hierarchy like:
           implementation
           |> compileClasspath
           |> runtimeClasspath
           |> testImplementation
              |> testCompileClasspath
              |> testRuntimeClasspath
       
      When querying "implementation" with transitive is false this function will return [compileClasspath, runtimeClasspath, testImplementation]. When transitive is true this function will also return [testCompileClasspath, testRuntimeClasspath].
    • withNameToConfiguration

      public GradleProject withNameToConfiguration(Map<String,GradleDependencyConfiguration> nameToConfiguration)
    • fromToolingModel

      public static GradleProject fromToolingModel(GradleProject project)