### Install Plugin via Settings Script Source: https://context7.com/autonomousapps/dependency-analysis-gradle-plugin/llms.txt Use the settings plugin for automatic analysis across all subprojects. Ensure Kotlin and Android plugins are in the same classloader if used. ```kotlin plugins { id("com.autonomousapps.build-health") version "3.9.0" // Required if using Kotlin - must be in same classloader id("org.jetbrains.kotlin.jvm") version "2.0.0" apply false // Required if using Android - must be in same classloader id("com.android.application") version "8.5.0" apply false id("org.jetbrains.kotlin.android") version "2.0.0" apply false } pluginManagement { repositories { mavenCentral() maven(url = "https://central.sonatype.com/repository/maven-snapshots/") gradlePluginPortal() } } ``` -------------------------------- ### Get Dependency Advice Reason Source: https://context7.com/autonomousapps/dependency-analysis-gradle-plugin/llms.txt Use the `reason` task to get detailed explanations for the plugin's advice on specific dependencies, including external and project dependencies, and capabilities like test-fixtures. ```bash # Query reason for advice on external dependency ./gradlew :lib:reason --id com.squareup.okio:okio # Query reason for project dependency ./gradlew :app:reason --id :db # Query with capability (e.g., test-fixtures) ./gradlew :app:reason --id :lib --capability test-fixtures # Example output: # > Task :lib:reason # You asked about the dependency 'com.squareup.okio:okio:2.2.2'. # There is no advice regarding this dependency. # # Shortest path from :lib to com.squareup.okio:okio:2.2.2: # :lib # \--- com.squareup.okio:okio:2.2.2 # # Source: main # ------------ # * Exposes class okio.BufferedSource (implies api). ``` -------------------------------- ### Install Plugin via Root Build Script Source: https://context7.com/autonomousapps/dependency-analysis-gradle-plugin/llms.txt Apply the plugin to the root project and specific subprojects for granular control over analysis. Kotlin and Android plugins must be in the same classloader. ```kotlin plugins { id("com.autonomousapps.dependency-analysis") version "3.9.0" // Kotlin and Android plugins must be in same classloader id("org.jetbrains.kotlin.jvm") version "2.0.0" apply false id("com.android.library") version "8.5.0" apply false } // sub/project/build.gradle.kts plugins { id("com.autonomousapps.dependency-analysis") id("org.jetbrains.kotlin.jvm") } ``` -------------------------------- ### Register Custom Post-Processing Task Source: https://context7.com/autonomousapps/dependency-analysis-gradle-plugin/llms.txt Register custom tasks to consume and process the generated advice for advanced automation. The example shows how to iterate through dependency and plugin advice. ```kotlin // lib/build.gradle.kts import com.autonomousapps.AbstractPostProcessingTask // Create custom post-processing task val customAdviceProcessor by tasks.registering(AbstractPostProcessingTask::class) { doLast { val advice = projectAdvice() // Process dependency advice advice.dependencyAdvice.forEach { dep -> println("Dependency: ${dep.dependency.identifier}") println(" From: ${dep.fromConfiguration}") println(" To: ${dep.toConfiguration}") } // Process plugin advice advice.pluginAdvice.forEach { plugin -> println("Redundant plugin: ${plugin.redundantPlugin}") println(" Reason: ${plugin.reason}") } } } // Register with the plugin val dependencyAnalysis = extensions.getByType( com.autonomousapps.DependencyAnalysisSubExtension::class.java ) dependencyAnalysis.registerPostProcessingTask(customAdviceProcessor) ``` -------------------------------- ### Verify Shadow Jar Source: https://github.com/autonomousapps/dependency-analysis-gradle-plugin/blob/main/shadowed/kotlin-editor-relocated/RELEASING.md Run this command to build the shadow jar and manually inspect its contents to ensure correctness. ```bash ./gradlew :kotlin-editor-relocated:shadowJar ``` -------------------------------- ### Build Shadow Jar for asm-relocated Source: https://github.com/autonomousapps/dependency-analysis-gradle-plugin/blob/main/shadowed/asm-relocated/RELEASING.md Run this command to build the shadow JAR for the asm-relocated module. Manually inspect the contents of the generated JAR to ensure correctness. ```bash ./gradlew :asm-relocated:shadowJar ``` -------------------------------- ### Create Git Tag Source: https://github.com/autonomousapps/dependency-analysis-gradle-plugin/blob/main/shadowed/kotlin-editor-relocated/RELEASING.md Create an annotated Git tag for the release version. ```bash git tag -a kotlin-editor-relocated-x -m "kotlin-editor-relocated version x." ``` -------------------------------- ### Enable Typesafe Project Accessors Source: https://context7.com/autonomousapps/dependency-analysis-gradle-plugin/llms.txt Enable typesafe project accessors for cleaner advice output. This requires enabling the feature preview in `settings.gradle.kts`. ```kotlin // build.gradle.kts (root project) dependencyAnalysis { // When enabled, advice will use projects.lib instead of project(":lib") useTypesafeProjectAccessors(true) } // settings.gradle.kts enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") ``` -------------------------------- ### Publish to Maven Central Source: https://github.com/autonomousapps/dependency-analysis-gradle-plugin/blob/main/shadowed/kotlin-editor-relocated/RELEASING.md Execute this Gradle task to publish the artifact to Maven Central. ```bash ./gradlew :kotlin-editor-relocated:publishToMavenCentral ``` -------------------------------- ### Create Git Tag for Release Source: https://github.com/autonomousapps/dependency-analysis-gradle-plugin/blob/main/RELEASING.md Create an annotated Git tag for the released version. Replace 'x.y.z' with the actual version number. ```bash git tag -a vx.y.z -m "Version x.y.z." ``` -------------------------------- ### Publish Gradle TestKit Support Source: https://github.com/autonomousapps/dependency-analysis-gradle-plugin/blob/main/testkit/gradle-testkit-support/RELEASING.md Use this command to publish the gradle-testkit-support library to Maven Central. It automatically runs tests and prevents publishing if any fail. ```bash ./gradlew -p testkit :gradle-testkit-support:publishToMavenCentral ``` -------------------------------- ### Configure Plugin Reporting Source: https://context7.com/autonomousapps/dependency-analysis-gradle-plugin/llms.txt Customize console output and add custom postscripts for team guidance. Use `printBuildHealth(true)` to show the buildHealth report and `onlyOnFailure(true)` to display the postscript only when there are failure-level issues. ```kotlin // build.gradle.kts (root project) dependencyAnalysis { reporting { // Print the full buildHealth report to console printBuildHealth(true) // Add a custom message to help developers understand next steps postscript(""" | |For help resolving these issues, see: https://wiki.company.com/gradle-dependencies |Run './gradlew :module:fixDependencies' to auto-fix most issues. |Contact #build-support on Slack for assistance. """.trimMargin()) // Only show postscript when there are failure-level issues onlyOnFailure(true) } } ``` -------------------------------- ### Tag TestKit Support Release Source: https://github.com/autonomousapps/dependency-analysis-gradle-plugin/blob/main/testkit/gradle-testkit-support/RELEASING.md Create an annotated Git tag for the release. Replace 'x.y' with the actual version number. ```bash git tag -a testkit-support-x.y -m "TestKit Support version x.y." ``` -------------------------------- ### Commit Next Development Version Preparation Source: https://github.com/autonomousapps/dependency-analysis-gradle-plugin/blob/main/RELEASING.md After releasing, update the version number in `gradle.properties` to the next snapshot version to prepare for further development. Commit these changes. ```bash git commit -am "chore: prepare next development version." ``` -------------------------------- ### Publish Snapshot to Maven Central Source: https://github.com/autonomousapps/dependency-analysis-gradle-plugin/blob/main/RELEASING.md Execute the Gradle task to publish the snapshot version of the plugin to Maven Central for smoke testing. Ensure the version number in `gradle.properties` has the `-SNAPSHOT` suffix before running. ```bash ./gradlew :publishEverywhere ``` -------------------------------- ### Configuration Handlers Source: https://github.com/autonomousapps/dependency-analysis-gradle-plugin/blob/main/api/api.txt Configuration options for the dependency analysis plugin, including how to manage source sets, analyze usage, and define exclusions. ```APIDOC ## SourceSetsHandler ### Description Handles named source sets within the project. ### Method N/A (Class definition) ### Endpoint N/A ### Parameters N/A ### Request Example N/A ### Response N/A ## UsageAnalysisHandler ### Description Provides methods to configure usage analysis behavior. ### Method N/A (Class definition) ### Endpoint N/A ### Parameters N/A ### Request Example N/A ### Response N/A ## UsageExclusionsHandler ### Description Provides methods to define class exclusions for usage analysis. ### Method N/A (Class definition) ### Endpoint N/A ### Parameters #### Method: excludeClasses - **classRegexes** (String...) - Required - Regular expressions for class names to exclude. ### Request Example N/A ### Response N/A ## UsageHandler ### Description Main handler for configuring dependency usage analysis and exclusions. ### Method N/A (Class definition) ### Endpoint N/A ### Parameters #### Method: analysis - **action** (Action) - Required - An action to configure usage analysis. #### Method: exclusions - **action** (Action) - Required - An action to configure usage exclusions. ### Request Example N/A ### Response N/A ``` -------------------------------- ### Promote Release from Staging Repository Source: https://github.com/autonomousapps/dependency-analysis-gradle-plugin/blob/main/RELEASING.md Automated task to promote the release from Maven Central's staging repository. This is typically the final step in the release process. ```bash ./gradlew :promote ``` -------------------------------- ### Publish asm-relocated to Maven Central Source: https://github.com/autonomousapps/dependency-analysis-gradle-plugin/blob/main/shadowed/asm-relocated/RELEASING.md Execute this Gradle task to publish the asm-relocated module to Maven Central. Ensure all prerequisites for publishing are met. ```bash ./gradlew :asm-relocated:publishToMavenCentral ``` -------------------------------- ### Build Services Source: https://github.com/autonomousapps/dependency-analysis-gradle-plugin/blob/main/api/api.txt Details the build services provided by the plugin, including GlobalDslService for global configurations and InMemoryCache for caching build artifacts. ```APIDOC ## GlobalDslService ### Description A build service that manages global DSL configurations across the project. ### Class Definition ```java public abstract class GlobalDslService implements org.gradle.api.services.BuildService ``` ### Constructor - `GlobalDslService(@javax.inject.Inject org.gradle.api.model.ObjectFactory objects)`: Injected constructor for the service. --- ## InMemoryCache ### Description A build service that provides an in-memory cache for build artifacts. ### Class Definition ```java public abstract class InMemoryCache implements org.gradle.api.services.BuildService ``` ### Constructor - `InMemoryCache()`: Default constructor. ### Inner Interface: Params #### Description Parameters for the InMemoryCache service. #### Interface Definition ```java public static interface Params extends org.gradle.api.services.BuildServiceParameters ``` #### Methods - `getCacheSize()`: Returns a property for the cache size. #### Properties - `cacheSize` (org.gradle.api.provider.Property): The size of the cache. ``` -------------------------------- ### Publish TestKit Plugin Source: https://github.com/autonomousapps/dependency-analysis-gradle-plugin/blob/main/testkit/gradle-testkit-plugin/RELEASING.md Publish the gradle-testkit-plugin to all repositories. This command automatically runs tests and will not publish if any tests fail. ```bash 1. Publish: `./gradlew -p testkit :gradle-testkit-plugin:publishEverywhere` ``` -------------------------------- ### Run Full Build Health Analysis Source: https://context7.com/autonomousapps/dependency-analysis-gradle-plugin/llms.txt Execute the `buildHealth` task to analyze the entire project for dependency and plugin issues. Reports are generated in `build/reports/dependency-analysis/`. ```bash # Run full build health analysis ./gradlew buildHealth # Example output when issues are found: # > Task :buildHealth FAILED # FAILURE: Build failed with an exception. # * What went wrong: # Execution failed for task ':buildHealth'. # > There were dependency violations. See report at file:///path/to/project/build/reports/dependency-analysis/build-health-report.txt # View generated reports cat build/reports/dependency-analysis/build-health-report.txt cat build/reports/dependency-analysis/advice.json ``` -------------------------------- ### Verify ANTLR Shadow Jar Source: https://github.com/autonomousapps/dependency-analysis-gradle-plugin/blob/main/shadowed/antlr/RELEASING.md Build the shadow jar for the ANTLR module and manually inspect its contents to ensure correctness. ```bash ./gradlew :antlr:shadowJar ``` -------------------------------- ### Publish to Maven Central Source: https://github.com/autonomousapps/dependency-analysis-gradle-plugin/blob/main/variant-artifacts/RELEASING.md Execute the Gradle publish task to publish the variant-artifacts to Maven Central. This command also runs tests and will halt if any tests fail. ```bash 1. Publish: `./gradlew :variant-artifacts:publishToMavenCentral` (this will automatically run the tests, and won't publish if any fail) ``` -------------------------------- ### Per-Project Issue Configuration Source: https://context7.com/autonomousapps/dependency-analysis-gradle-plugin/llms.txt Define issue handling rules directly within a subproject's build script for project-specific configurations. This allows for tailored settings per project, including source set specific rules. ```kotlin dependencyAnalysis { issues { onAny { severity("warn") exclude("androidx.annotation:annotation") } onUnusedDependencies { severity("fail") } // Ignore analysis for specific source sets in this project ignoreSourceSet("testFixtures") // Configure per source set sourceSet("test") { onUnusedDependencies { severity("ignore") } } onDuplicateClassWarnings { severity("warn") exclude("org/jetbrains/annotations/NotNull", "org.jetbrains.annotations.Nullable") } onModuleStructure { severity("warn") exclude("android") } } } ``` -------------------------------- ### Tag Release Version Source: https://github.com/autonomousapps/dependency-analysis-gradle-plugin/blob/main/variant-artifacts/RELEASING.md Create an annotated Git tag for the specific release version. ```git 1. `git tag -a variant-artifacts-x.y -m "Variant-Artifacts version x.y."` ``` -------------------------------- ### Publish to Maven Central Source: https://github.com/autonomousapps/dependency-analysis-gradle-plugin/blob/main/graph-support/RELEASING.md Execute the Gradle task to publish the graph-support module to Maven Central. This command automatically runs tests and will halt publishing if any tests fail. ```bash ./gradlew :graph-support:publishToMavenCentral ``` -------------------------------- ### Publish to Maven Central Source: https://github.com/autonomousapps/dependency-analysis-gradle-plugin/blob/main/testkit/gradle-testkit-truth/RELEASING.md Use this command to publish the gradle-testkit-truth project to Maven Central. This command also automatically runs tests and will not publish if any tests fail. ```bash ./gradlew -p testkit :gradle-testkit-truth:publishToMavenCentral ``` -------------------------------- ### Tag Release Source: https://github.com/autonomousapps/dependency-analysis-gradle-plugin/blob/main/testkit/gradle-testkit-truth/RELEASING.md Tag the release with a specific version number. ```bash git tag -a testkit-truth-x.y -m "TestKit Truth version x.y." ``` -------------------------------- ### AbstractExtension Source: https://github.com/autonomousapps/dependency-analysis-gradle-plugin/blob/main/api/api.txt Abstract base class for Gradle plugin extensions. ```APIDOC ## AbstractExtension ### Description Abstract base class for Gradle plugin extensions, providing common functionality. ### Fields - `NAME` (String): The name of the extension, `"dependencyAnalysis"`. ``` -------------------------------- ### ProjectAdvice Data Model Source: https://github.com/autonomousapps/dependency-analysis-gradle-plugin/blob/main/api/api.txt Represents the overall advice for a project, including dependency, plugin, and module advice. ```APIDOC ## ProjectAdvice ### Description Aggregates various types of advice for a given project. ### Properties - **projectPath** (String) - The path of the project. - **dependencyAdvice** (Set) - A set of advice related to project dependencies. - **pluginAdvice** (Set) - A set of advice related to project plugins. - **moduleAdvice** (Set) - A set of advice related to project modules. - **warning** (Warning) - Any associated warning for the project. - **shouldFail** (boolean) - Flag indicating if the build should fail based on the advice. ``` -------------------------------- ### ReportingHandler Configuration Source: https://github.com/autonomousapps/dependency-analysis-gradle-plugin/blob/main/api/api.txt Configure the reporting behavior of the dependency analysis plugin. ```APIDOC ## ReportingHandler API ### Description Configures the reporting options for the dependency analysis plugin. ### Methods - `onlyOnFailure(boolean onlyOnFailure)`: Sets whether reports should only be generated on build failure. - `postscript(String postscript)`: Adds a custom postscript message to the report. - `printBuildHealth(boolean printBuildHealth)`: Determines whether to print build health information in the report. ``` -------------------------------- ### Issue Handling Source: https://github.com/autonomousapps/dependency-analysis-gradle-plugin/blob/main/api/api.txt Configure issue handling for the entire project or specific projects. ```APIDOC ## IssueHandler API ### Description Handles the configuration of issues across different projects. ### Methods - `all(Action action)`: Applies the given action to configure issues for all projects. - `project(String projectPath, Action action)`: Applies the given action to configure issues for a specific project identified by its path. - `project(ProjectDependency project, Action action)`: Applies the given action to configure issues for a specific project dependency. ``` -------------------------------- ### Generate Project Graph Task Source: https://context7.com/autonomousapps/dependency-analysis-gradle-plugin/llms.txt Generate project dependency graphs in graphviz format for visualization. The output file `project-graph.gv` can be converted to SVG using the `dot` command. ```bash # Generate project graph ./gradlew :app:projectGraphMain ``` ```bash # For Android variant ./gradlew :app:projectGraphDebug ``` ```bash # Convert to SVG (requires graphviz) dot -Tsvg build/reports/dependency-analysis/project-graph.gv -o project-graph.svg ``` -------------------------------- ### Publish ANTLR to Maven Central Source: https://github.com/autonomousapps/dependency-analysis-gradle-plugin/blob/main/shadowed/antlr/RELEASING.md Publish the ANTLR module to Maven Central using the Gradle publish task. ```bash ./gradlew :antlr:publishToMavenCentral ``` -------------------------------- ### Configure ABI Exclusions Source: https://context7.com/autonomousapps/dependency-analysis-gradle-plugin/llms.txt Specify which classes, packages, and annotations should be excluded from ABI (Application Binary Interface) analysis. This includes options for ignoring internal packages, generated code, and using whitelist/blacklist approaches for classes and annotations. ```kotlin dependencyAnalysis { abi { exclusions { // Exclude internal packages from ABI analysis ignoreInternalPackages() // Exclude specific sub-package ignoreSubPackage("internal") ignoreSubPackage("impl") // Ignore generated code (classes with @Generated annotation) ignoreGeneratedCode() // Exclude specific source sets from ABI analysis excludeSourceSets("testFixtures") // Exclude classes matching regex patterns excludeClasses(".*\\.internal\\..*") excludeClasses("com\\.example\\.generated\\..*") // Exclude classes annotated with specific annotations excludeAnnotations(".*\\.Generated") excludeAnnotations(".*\\.Internal") excludeAnnotations("dagger\\.internal\\..*") // Include only classes matching patterns (whitelist approach) includeClasses(".*\\.api\\..*") includeAnnotations(".*\\.PublicApi") } } } ``` -------------------------------- ### Commit Changes for Release Source: https://github.com/autonomousapps/dependency-analysis-gradle-plugin/blob/main/graph-support/RELEASING.md Stage and commit all changes, including version updates, with a descriptive message indicating the preparation for a release. ```bash git commit -am "chore(graph-support): prepare for graph-support release x.y." ``` -------------------------------- ### Advice Model Source: https://github.com/autonomousapps/dependency-analysis-gradle-plugin/blob/main/api/api.txt Represents a dependency recommendation, including coordinates and the type of advice (add, change, remove). ```APIDOC ## Advice ### Description Represents a dependency recommendation, such as adding, changing, or removing a dependency. ### Method N/A (Class definition) ### Endpoint N/A ### Parameters - **coordinates** (Coordinates) - Required - The coordinates of the dependency. - **fromConfiguration** (String?) - Optional - The original configuration of the dependency (for changes). - **toConfiguration** (String?) - Optional - The target configuration of the dependency (for changes or additions). ### Request Example N/A ### Response #### Success Response (200) N/A (This is a model class, not an endpoint) #### Response Example N/A ### Static Factory Methods - **ofAdd(coordinates: Coordinates, toConfiguration: String): Advice** - Creates an Advice object for adding a dependency. - **ofChange(coordinates: Coordinates, fromConfiguration: String, toConfiguration: String): Advice** - Creates an Advice object for changing a dependency. - **ofRemove(coordinates: Coordinates, fromConfiguration: String): Advice** - Creates an Advice object for removing a dependency. ``` -------------------------------- ### Print Dominator Tree Task Source: https://context7.com/autonomousapps/dependency-analysis-gradle-plugin/llms.txt Generate a dominator tree to identify dependencies that contribute most to binary size. Specify the classpath type (e.g., `Compile`, `Runtime`) and source set (e.g., `Main`, `Debug`). ```bash # Print dominator tree for compile classpath ./gradlew :app:printDominatorTreeCompileMain ``` ```bash # Print for runtime classpath ./gradlew :app:printDominatorTreeRuntimeMain ``` ```bash # For Android variant ./gradlew :app:printDominatorTreeCompileDebug ``` -------------------------------- ### GunzipTaskOutput.Companion Object Source: https://github.com/autonomousapps/dependency-analysis-gradle-plugin/blob/main/api/api.txt Details of the companion object for GunzipTaskOutput. ```APIDOC ## Class GunzipTaskOutput.Companion ### Description Companion object for GunzipTaskOutput. ### Methods - **main**(java.lang.String... args): A main method within the companion object. ``` -------------------------------- ### BundleHandler API Source: https://github.com/autonomousapps/dependency-analysis-gradle-plugin/blob/main/api/api.txt Configuration for defining and managing dependency bundles. ```APIDOC ## BundleHandler ### Description Manages the configuration of a specific dependency bundle, including include rules and primary dependencies. ### Methods - **include(String regex)**: Adds a regular expression to the include list for the bundle. - **include(Regex regex)**: Adds a Kotlin Regex object to the include list. - **includeDependency(String identifier)**: Includes a dependency by its identifier. - **includeDependency(Provider module)**: Includes a dependency using a provider. - **includeDependency(ProviderConvertible module)**: Includes a dependency using a provider convertible. - **includeGroup(String group)**: Includes all dependencies belonging to a specific group. - **includeGroup(Provider module)**: Includes dependencies from a group using a provider. - **includeGroup(ProviderConvertible module)**: Includes dependencies from a group using a provider convertible. - **primary(String identifier)**: Sets a dependency as primary by its identifier. - **primary(Provider module)**: Sets a dependency as primary using a provider. - **primary(ProviderConvertible module)**: Sets a dependency as primary using a provider convertible. ### Properties - **includes (SetProperty)**: A set property containing regular expressions for including dependencies. - **primary (Property)**: A property for the primary dependency identifier. ``` -------------------------------- ### Dependency Analysis Extension Source: https://github.com/autonomousapps/dependency-analysis-gradle-plugin/blob/main/api/api.txt Configuration extension for the dependency analysis plugin. ```APIDOC ## DependencyAnalysisExtension ### Description Provides configuration options for the dependency analysis plugin. ### Methods - `abi(Action action)`: Configures ABI analysis. - `issues(Action action)`: Configures issue reporting. - `reporting(Action action)`: Configures reporting options. - `structure(Action action)`: Configures dependency structure analysis. - `usage(Action action)`: Configures dependency usage analysis. - `usages(Action action)`: Deprecated method for configuring dependency usage analysis. - `useTypesafeProjectAccessors(boolean enable)`: Enables or disables typesafe project accessors. ``` -------------------------------- ### Advice Data Models Source: https://github.com/autonomousapps/dependency-analysis-gradle-plugin/blob/main/api/api.txt Structures for representing advice related to modules and plugins. ```APIDOC ## ModuleAdvice ### Description Abstract class representing advice for a module. Concrete implementations define specific advice types. ### Properties - **name** (String) - The name of the module. ## PluginAdvice ### Description Represents advice related to a specific Gradle plugin. ### Properties - **redundantPlugin** (String) - The name of the redundant plugin. - **reason** (String) - The reason why the plugin is considered redundant. ### Static Methods - **redundantJavaLibrary()**: Creates a PluginAdvice for redundant Java library plugin. - **redundantKapt()**: Creates a PluginAdvice for redundant Kapt plugin. - **redundantKotlinJvm()**: Creates a PluginAdvice for redundant Kotlin JVM plugin. - **redundantLegacyKapt()**: Creates a PluginAdvice for redundant legacy Kapt plugin. ``` -------------------------------- ### Commit Changes for Release Source: https://github.com/autonomousapps/dependency-analysis-gradle-plugin/blob/main/shadowed/kotlin-editor-relocated/RELEASING.md Commit the changes made to the build script in preparation for the release. ```bash git commit -am "chore(kotlin-editor): prepare for kotlin-editor-relocated release x." ``` -------------------------------- ### Build Health Plugin Source: https://github.com/autonomousapps/dependency-analysis-gradle-plugin/blob/main/api/api.txt A plugin to report on build health metrics. ```APIDOC ## BuildHealthPlugin ### Description Applies the build health plugin to the settings of a Gradle build. ### ID `com.autonomousapps.build-health` ``` -------------------------------- ### ProjectIssueHandler Configuration Source: https://github.com/autonomousapps/dependency-analysis-gradle-plugin/blob/main/api/api.txt Configure issue handling rules for a specific project, including source set specific rules. ```APIDOC ## ProjectIssueHandler API ### Description Manages issue configurations for a specific project, allowing fine-grained control over different issue types and source sets. ### Methods - `getName()`: Returns the name of the project. - `ignoreSourceSet(String... ignore)`: Specifies source sets to ignore for issue reporting within this project. - `onAny(Action action)`: Applies the given action to configure handling for any issue type. - `onCompileOnly(Action action)`: Applies the given action to configure handling for issues related to compile-only dependencies. - `onDuplicateClassWarnings(Action action)`: Applies the given action to configure handling for duplicate class warnings. - `onIncorrectConfiguration(Action action)`: Applies the given action to configure handling for incorrect dependency configurations. - `onModuleStructure(Action action)`: Applies the given action to configure handling for issues related to module structure. - `onRedundantPlugins(Action action)`: Applies the given action to configure handling for redundant plugins. - `onRuntimeOnly(Action action)`: Applies the given action to configure handling for issues related to runtime-only dependencies. - `onUnusedAnnotationProcessors(Action action)`: Applies the given action to configure handling for unused annotation processors. - `onUnusedDependencies(Action action)`: Applies the given action to configure handling for unused dependencies. - `onUsedTransitiveDependencies(Action action)`: Applies the given action to configure handling for used transitive dependencies. - `sourceSet(String sourceSetName, Action action)`: Applies the given action to configure issues specifically for a named source set within this project. ``` -------------------------------- ### Resolve External Dependencies Task Source: https://context7.com/autonomousapps/dependency-analysis-gradle-plugin/llms.txt Trigger downloading of all external dependencies for a source set. Useful for pre-populating caches in containerized builds. Specify the source set (e.g., `Main`, `Test`, or a build variant like `Debug`) as an argument. ```bash # Resolve dependencies for main source set ./gradlew :app:resolveExternalDependenciesMain ``` ```bash # Resolve dependencies for test source set ./gradlew :app:resolveExternalDependenciesTest ``` ```bash # Resolve for Android debug variant ./gradlew :app:resolveExternalDependenciesDebug ``` -------------------------------- ### Update build.gradle.kts for Release Source: https://github.com/autonomousapps/dependency-analysis-gradle-plugin/blob/main/testkit/gradle-testkit-plugin/RELEASING.md Remove the -SNAPSHOT suffix from the version name in the build.gradle.kts file before preparing for release. ```gradle 1. Remove the `-SNAPSHOT` suffix from the version name in `gradle-testkit-plugin/build.gradle.kts`. ``` -------------------------------- ### Configure Usage Analysis Source: https://context7.com/autonomousapps/dependency-analysis-gradle-plugin/llms.txt Configure class usage analysis, including enabling superclass analysis and specifying class exclusions. Use `checkSuperClasses(true)` to enable superclass analysis and `excludeClasses()` to prevent specific classes from being analyzed. ```kotlin // build.gradle.kts (root project) dependencyAnalysis { usage { analysis { // Enable superclass analysis (opt-in, false by default) checkSuperClasses(true) } exclusions { // Exclude specific classes from usage analysis excludeClasses("com\\.example\\.legacy\\..*") } } } ``` -------------------------------- ### Gradle Properties Configuration Source: https://context7.com/autonomousapps/dependency-analysis-gradle-plugin/llms.txt Control plugin behavior via gradle.properties for CI/CD and team-wide configuration. Properties like `autoapply`, `silent`, `print.build.health`, `scans.publish`, and `project.includes` can be set. ```properties # gradle.properties # Disable auto-apply to all subprojects (must manually apply to each) dependency.analysis.autoapply=false # Suppress most console output dependency.analysis.silent=true # Print buildHealth report to console dependency.analysis.print.build.health=true # Publish build scans dependency.analysis.scans.publish=true # Filter projects by regex pattern # Only analyze projects matching pattern dependency.analysis.project.includes=^:app.*$ ``` -------------------------------- ### Update build.gradle.kts for Next Development Version Source: https://github.com/autonomousapps/dependency-analysis-gradle-plugin/blob/main/testkit/gradle-testkit-plugin/RELEASING.md Update the version number in the build.gradle.kts file to the next snapshot version to prepare for further development. ```gradle 1. Update version number in `testkit/gradle-testkit-plugin/build.gradle.kts` to next snapshot version (x.y-SNAPSHOT) ``` -------------------------------- ### SourceKind Abstract Class and Implementations Source: https://github.com/autonomousapps/dependency-analysis-gradle-plugin/blob/main/api/api.txt Defines the abstract SourceKind class and its concrete implementations for JVM and KMP projects, including properties for classpath names, kind, and name. ```APIDOC ## SourceKind Abstract Class ### Description Represents a general source kind in a project, providing abstract methods and properties for accessing classpath information and kind identifiers. ### Class Definition ```java abstract sealed exhaustive class SourceKind implements java.lang.Comparable java.io.Serializable ``` ### Abstract Methods - `getCompileClasspathName()`: Returns the name of the compile classpath. - `getKind()`: Returns the kind identifier of the source set. - `getName()`: Returns the name of the source set. - `getRuntimeClasspathName()`: Returns the name of the runtime classpath. ### Abstract Properties - `compileClasspathName` (String): The name of the compile classpath. - `kind` (String): The kind identifier of the source set. - `name` (String): The name of the source set. - `runtimeClasspathName` (String): The name of the runtime classpath. ### Constants - `ANDROID_TEST_FIXTURES_KIND` (String): Constant for Android test fixtures kind. - `ANDROID_TEST_KIND` (String): Constant for Android test kind. - `ANDROID_TEST_NAME` (String): Constant for Android test name. - `CUSTOM_JVM_KIND` (String): Constant for custom JVM kind. - `MAIN_KIND` (String): Constant for main kind. - `MAIN_NAME` (String): Constant for main name. - `TEST_FIXTURES_NAME` (String): Constant for test fixtures name. - `TEST_KIND` (String): Constant for test kind. - `TEST_NAME` (String): Constant for test name. --- ## JvmSourceKind Class ### Description Represents a source kind specifically for JVM projects. ### Class Definition ```java public final class JvmSourceKind extends com.autonomousapps.model.source.SourceKind implements java.io.Serializable ``` ### Constructor - `JvmSourceKind(String name, String kind, String compileClasspathName, String runtimeClasspathName)`: Constructs a new JvmSourceKind. ### Methods - `compareTo(com.autonomousapps.model.source.SourceKind other)`: Compares this SourceKind with another. - `component1()`: Returns the name. - `component2()`: Returns the kind. - `component3()`: Returns the compile classpath name. - `component4()`: Returns the runtime classpath name. - `copy(optional String name, optional String kind, optional String compileClasspathName, optional String runtimeClasspathName)`: Creates a copy of the JvmSourceKind with optional updated fields. - `getCompileClasspathName()`: Returns the compile classpath name. - `getKind()`: Returns the kind. - `getName()`: Returns the name. - `getRuntimeClasspathName()`: Returns the runtime classpath name. ### Properties - `compileClasspathName` (String): The name of the compile classpath. - `kind` (String): The kind identifier. - `name` (String): The name of the source kind. - `runtimeClasspathName` (String): The name of the runtime classpath. --- ## KmpSourceKind Class ### Description Represents a source kind for Kotlin Multiplatform (KMP) projects. ### Class Definition ```java public final class KmpSourceKind extends com.autonomousapps.model.source.SourceKind implements java.io.Serializable ``` ### Constructor - `KmpSourceKind(String name, String kind, String compileClasspathName, String runtimeClasspathName)`: Constructs a new KmpSourceKind. ### Methods - `compareTo(com.autonomousapps.model.source.SourceKind other)`: Compares this SourceKind with another. - `component1()`: Returns the name. - `component2()`: Returns the kind. - `component3()`: Returns the compile classpath name. - `component4()`: Returns the runtime classpath name. - `copy(optional String name, optional String kind, optional String compileClasspathName, optional String runtimeClasspathName)`: Creates a copy of the KmpSourceKind with optional updated fields. - `getCompileClasspathName()`: Returns the compile classpath name. - `getKind()`: Returns the kind. - `getName()`: Returns the name. - `getRuntimeClasspathName()`: Returns the runtime classpath name. ### Properties - `compileClasspathName` (String): The name of the compile classpath. - `kind` (String): The kind identifier. - `name` (String): The name of the source kind. - `runtimeClasspathName` (String): The name of the runtime classpath. ### Constants - `ANDROID_MAIN_NAME` (String): Constant for the Android main source set name. - `COMMON_MAIN_NAME` (String): Constant for the common main source set name. - `COMMON_TEST_NAME` (String): Constant for the common test source set name. - `JVM_MAIN_NAME` (String): Constant for the JVM main source set name. - `JVM_TEST_NAME` (String): Constant for the JVM test source set name. ``` -------------------------------- ### ListSourceFilesTask Source: https://github.com/autonomousapps/dependency-analysis-gradle-plugin/blob/main/api/api.txt Task to list source files within a project. ```APIDOC ## ListSourceFilesTask ### Description A task that lists source files within a project. ### Properties - `files` (ListProperty): A list of file collections to process. ``` -------------------------------- ### Commit Changes for Next Development Version Source: https://github.com/autonomousapps/dependency-analysis-gradle-plugin/blob/main/testkit/gradle-testkit-support/RELEASING.md Update the version number in the build script to the next snapshot version to prepare for future development. Replace 'x.y' with the actual version numbers. ```bash git commit -am "chore(testkit-support): prepare next development version of testkit-support." ``` -------------------------------- ### AbiHandler Source: https://github.com/autonomousapps/dependency-analysis-gradle-plugin/blob/main/api/api.txt Handler for configuring ABI analysis. ```APIDOC ## AbiHandler ### Description Handles configuration for ABI analysis. ### Methods - `exclusions(Action action)`: Configures exclusions for ABI analysis. ``` -------------------------------- ### Commit Release Preparation for asm-relocated Source: https://github.com/autonomousapps/dependency-analysis-gradle-plugin/blob/main/shadowed/asm-relocated/RELEASING.md Commit the changes made in preparation for a new release. Replace 'x' with the actual release version number. ```bash git commit -am "chore(asm-relocated): prepare for asm-relocated release x." ``` -------------------------------- ### Commit Changes for Release Source: https://github.com/autonomousapps/dependency-analysis-gradle-plugin/blob/main/variant-artifacts/RELEASING.md Create a Git commit with the message indicating the preparation for a new release. ```git 1. `git commit -am "chore(variant-artifacts): prepare for variant-artifacts release x.y."` ``` -------------------------------- ### Dependency Analysis Plugin Source: https://github.com/autonomousapps/dependency-analysis-gradle-plugin/blob/main/api/api.txt The main plugin for applying dependency analysis to a project. ```APIDOC ## DependencyAnalysisPlugin ### Description Applies the dependency analysis plugin to a Gradle project. ### ID `com.autonomousapps.dependency-analysis` ``` -------------------------------- ### GradleVariantIdentification Data Model Source: https://github.com/autonomousapps/dependency-analysis-gradle-plugin/blob/main/api/api.txt Identifies a specific Gradle variant, including its capabilities and attributes. ```APIDOC ## GradleVariantIdentification ### Description Identifies a specific Gradle variant, including its capabilities and attributes. ### Constructor - `GradleVariantIdentification(Set capabilities, Map attributes)`: Constructs a new GradleVariantIdentification. ### Methods - `compareTo(GradleVariantIdentification other)`: Compares this GradleVariantIdentification object with another. - `component1()`: Returns the `capabilities`. - `component2()`: Returns the `attributes`. - `copy(Set capabilities, Map attributes)`: Creates a copy of the GradleVariantIdentification with optional updated fields. - `getAttributes()`: Returns the map of attributes. - `getCapabilities()`: Returns the set of capabilities. - `ofCapabilities(String... capabilities)`: Static method to create an instance with specified capabilities. ### Properties - `capabilities` (Set): A set of strings representing the capabilities of the Gradle variant. - `attributes` (Map): A map of strings representing the attributes of the Gradle variant. ### Companion Object #### GradleVariantIdentification.Companion - `EMPTY` (GradleVariantIdentification): A predefined empty GradleVariantIdentification instance. - `ofCapabilities(String... capabilities)`: Static method to create an instance with specified capabilities. ``` -------------------------------- ### Commit Changes for TestKit Support Release Source: https://github.com/autonomousapps/dependency-analysis-gradle-plugin/blob/main/testkit/gradle-testkit-support/RELEASING.md Commit changes to the build script to prepare for a release. Replace 'x.y' with the actual version number. ```bash git commit -am "chore(testkit-support): prepare for testkit-support release x.y." ``` -------------------------------- ### Behavior Source: https://github.com/autonomousapps/dependency-analysis-gradle-plugin/blob/main/api/api.txt Represents different behaviors or states within the plugin. ```APIDOC ## Behavior ### Description Represents different behaviors or states, implementing Comparable and Serializable. ``` -------------------------------- ### Commit Release Preparation Source: https://github.com/autonomousapps/dependency-analysis-gradle-plugin/blob/main/RELEASING.md Commit the changes after updating the version number and preparing for the release. This step is part of the version bumping process. ```bash git commit -am "chore: prepare for release x.y.z." ``` -------------------------------- ### DependenciesHandler API Source: https://github.com/autonomousapps/dependency-analysis-gradle-plugin/blob/main/api/api.txt Configuration options for managing dependencies within the plugin. ```APIDOC ## DependenciesHandler ### Description Handles the configuration of dependencies, including explicit source sets, ignoring Kotlin extensions, and using parentheses for Groovy. ### Methods - **bundle(String name, Action action)**: Creates or configures a dependency bundle. - **explicitSourceSets(String... sourceSets)**: Specifies explicit source sets to include in the analysis. - **ignoreKtx(boolean ignore)**: Determines whether to ignore Kotlin extension files. - **useParenthesesForGroovy(boolean use)**: Configures the use of parentheses for Groovy syntax. ### Properties - **map (MapProperty)**: A map property for custom dependency mappings. ### Constants - **EXPLICIT_SOURCE_SETS_ALL (String)**: A constant representing all explicit source sets. ``` -------------------------------- ### Print Duplicate Dependencies Task Source: https://context7.com/autonomousapps/dependency-analysis-gradle-plugin/llms.txt Identify external dependencies with version conflicts across subprojects. The output lists conflicting dependencies and their versions in different modules. ```bash # Print all duplicate dependencies across the build ./gradlew printDuplicateDependencies ``` ```text # Example output shows dependencies with different versions in different modules # org.slf4j:slf4j-api # :app -> 1.7.36 # :lib -> 1.7.32 # :core -> 2.0.0 ``` -------------------------------- ### Tag ANTLR Release Version Source: https://github.com/autonomousapps/dependency-analysis-gradle-plugin/blob/main/shadowed/antlr/RELEASING.md Create an annotated Git tag for the ANTLR release, specifying the version number. ```bash git tag -a antlr-x -m "antlr version x." ``` -------------------------------- ### GunzipTaskOutput Class Source: https://github.com/autonomousapps/dependency-analysis-gradle-plugin/blob/main/api/api.txt Details of the GunzipTaskOutput class, including its constructor and main method. ```APIDOC ## Class GunzipTaskOutput ### Description Represents the output of a gunzip task, holding file system information and input/output paths. ### Constructor - **fs** (java.nio.file.FileSystem) - The file system to use. - **input** (String) - The path to the input compressed file. - **output** (String) - The path for the decompressed output file. ### Methods - **main**(java.lang.String... args): A static main method for executing the gunzip task. ### Fields - **Companion** (com.autonomousapps.tools.gzip.GunzipTaskOutput.Companion) - The companion object for GunzipTaskOutput. ``` -------------------------------- ### BuildScriptParseException Source: https://github.com/autonomousapps/dependency-analysis-gradle-plugin/blob/main/api/api.txt Exception for errors during build script parsing. ```APIDOC ## BuildScriptParseException ### Description Exception thrown when a build script cannot be parsed. ``` -------------------------------- ### ProjectAdvice Data Model Source: https://github.com/autonomousapps/dependency-analysis-gradle-plugin/blob/main/api/api.txt Represents advice and analysis results for a specific project. ```APIDOC ## ProjectAdvice Data Model ### Description Represents advice and analysis results for a specific project, including dependency advice, plugin advice, module advice, warnings, and build failure status. ### Properties - **projectPath** (String) - The path of the project. - **dependencyAdvice** (Set) - A set of advice related to project dependencies. - **pluginAdvice** (Set) - A set of advice related to project plugins. - **moduleAdvice** (Set) - A set of advice related to project modules. - **warning** (Warning) - Any warnings generated during analysis. - **shouldFail** (boolean) - Indicates if the build should fail based on analysis results. ### Methods - **component3()**: Returns the set of PluginAdvice. - **component4()**: Returns the set of ModuleAdvice. - **component5()**: Returns the Warning object. - **component6()**: Returns the shouldFail boolean. - **copy(...)**: Creates a copy of the ProjectAdvice object with optional updated fields. - **getDependencyAdvice()**: Returns the set of Advice for dependencies. - **getModuleAdvice()**: Returns the set of ModuleAdvice. - **getPluginAdvice()**: Returns the set of PluginAdvice. - **getProjectPath()**: Returns the project path. - **getShouldFail()**: Returns the shouldFail boolean. - **getWarning()**: Returns the Warning object. - **isEmpty()**: Checks if the ProjectAdvice is empty. - **isEmptyOrWarningOnly()**: Checks if the ProjectAdvice is empty or contains only warnings. - **isNotEmpty()**: Checks if the ProjectAdvice is not empty. ``` -------------------------------- ### Fail Behavior Source: https://github.com/autonomousapps/dependency-analysis-gradle-plugin/blob/main/api/api.txt Configure the plugin to fail the build based on specific criteria. ```APIDOC ## Fail Behavior ### Description Configures the plugin to fail the build if certain conditions are met. Can optionally specify exclusions and the source set to apply this behavior to. ### Constructors - `Fail()`: Default constructor. - `Fail(Set filter, String sourceSetName)`: Constructor with exclusion filter and source set name. ``` -------------------------------- ### Tag asm-relocated Release in Git Source: https://github.com/autonomousapps/dependency-analysis-gradle-plugin/blob/main/shadowed/asm-relocated/RELEASING.md Create an annotated Git tag for the new release. Replace 'x' with the actual release version number. ```bash git tag -a asm-relocated-x -m "asm-relocated version x." ``` -------------------------------- ### Push Git Changes and Tags Source: https://github.com/autonomousapps/dependency-analysis-gradle-plugin/blob/main/shadowed/asm-relocated/RELEASING.md Push all local commits and tags to the remote repository. ```bash git push && git push --tags ``` -------------------------------- ### Dependency Analysis Sub-Extension Source: https://github.com/autonomousapps/dependency-analysis-gradle-plugin/blob/main/api/api.txt Configuration extension for sub-projects within the dependency analysis plugin. ```APIDOC ## DependencyAnalysisSubExtension ### Description Provides configuration options for sub-projects within the dependency analysis plugin. ### Methods - `abi(Action action)`: Configures ABI analysis for the sub-project. - `issues(Action action)`: Configures issue reporting for the sub-project. - `structure(Action action)`: Configures dependency structure analysis for the sub-project. ``` -------------------------------- ### Tag Release in Git Source: https://github.com/autonomousapps/dependency-analysis-gradle-plugin/blob/main/graph-support/RELEASING.md Create an annotated Git tag for the specific release version to mark the release point in the project's history. ```bash git tag -a graph-support-x.y -m "Graph Support version x.y." ``` -------------------------------- ### Ignore Behavior Source: https://github.com/autonomousapps/dependency-analysis-gradle-plugin/blob/main/api/api.txt Configure the plugin to ignore certain issues or configurations. ```APIDOC ## Ignore Behavior ### Description Configures the plugin to ignore certain issues or configurations. Can optionally specify the source set to apply this behavior to. ### Constructors - `Ignore()`: Default constructor. - `Ignore(String sourceSetName)`: Constructor with a source set name. ``` -------------------------------- ### Issue Configuration Source: https://github.com/autonomousapps/dependency-analysis-gradle-plugin/blob/main/api/api.txt Define how specific issues are handled, including severity and exclusions. ```APIDOC ## Issue API ### Description Represents an issue detected by the dependency analysis plugin and allows configuration of its handling. ### Methods - `exclude(String... ignore)`: Excludes specific items (e.g., dependency coordinates) from this issue. - `exclude(ProjectDependency... ignore)`: Excludes specific project dependencies from this issue. - `exclude(Provider... ignore)`: Excludes specific external module dependencies (provided) from this issue. - `exclude(ProviderConvertible... ignore)`: Excludes specific external module dependencies (provider convertible) from this issue. - `excludeRegex(String... patterns)`: Excludes items matching the given regular expression patterns. - `severity(String value)`: Sets the severity level for this issue (e.g., 'error', 'warning'). ### Constants - `ALL_SOURCE_SETS` (String): A constant representing all source sets. ``` -------------------------------- ### Commit Changes for Release Source: https://github.com/autonomousapps/dependency-analysis-gradle-plugin/blob/main/testkit/gradle-testkit-truth/RELEASING.md Commit changes to prepare for the release, including updating the version number. ```bash git commit -am "chore(testkit-truth): Prepare for testkit-truth release x.y." ``` -------------------------------- ### Coordinates Data Models Source: https://github.com/autonomousapps/dependency-analysis-gradle-plugin/blob/main/api/api.txt Defines the structures for representing build and module coordinates. ```APIDOC ## IncludedBuildCoordinates ### Description Represents the coordinates of an included build. ### Properties - **identifier** (String) - The unique identifier for the included build. - **resolvedProject** (ProjectCoordinates) - The resolved project coordinates for the included build. - **gradleVariantIdentification** (GradleVariantIdentification) - Gradle variant information for the included build. ## ModuleCoordinates ### Description Represents the coordinates of a module within the project. ### Properties - **identifier** (String) - The unique identifier for the module. - **resolvedVersion** (String) - The resolved version of the module. - **gradleVariantIdentification** (GradleVariantIdentification) - Gradle variant information for the module. ``` -------------------------------- ### Tag TestKit Plugin Release Source: https://github.com/autonomousapps/dependency-analysis-gradle-plugin/blob/main/testkit/gradle-testkit-plugin/RELEASING.md Create an annotated Git tag for the released version of the TestKit Plugin. ```git 1. `git tag -a testkit-plugin-x.y -m "TestKit Plugin version x.y."` ``` -------------------------------- ### Commit Changes for Next Development Version Source: https://github.com/autonomousapps/dependency-analysis-gradle-plugin/blob/main/testkit/gradle-testkit-truth/RELEASING.md Update the version number in the build script to the next snapshot version after a release. ```bash git commit -am "chore(testkit-truth): Prepare next development version of testkit-truth." ``` -------------------------------- ### Publish Release to Maven Central Source: https://github.com/autonomousapps/dependency-analysis-gradle-plugin/blob/main/RELEASING.md Publish the final release version of the plugin to Maven Central. This command excludes the functional tests and automatically runs smoke tests before publishing. ```bash ./gradlew :publishEverywhere -x :functionalTest ``` -------------------------------- ### BuildHealthException Source: https://github.com/autonomousapps/dependency-analysis-gradle-plugin/blob/main/api/api.txt Custom exception for build health issues. ```APIDOC ## BuildHealthException ### Description Exception thrown when build health issues are detected. ``` -------------------------------- ### GunzipTaskOutput Class Definition Source: https://github.com/autonomousapps/dependency-analysis-gradle-plugin/blob/main/api/api.txt Defines the GunzipTaskOutput class and its companion object, including constructor and main method signatures. ```kotlin package com.autonomousapps.tools.gzip { public final class GunzipTaskOutput { ctor public GunzipTaskOutput(java.nio.file.FileSystem fs, String input, String output); method public static void main(java.lang.String... args); field public static final com.autonomousapps.tools.gzip.GunzipTaskOutput.Companion Companion; } public static final class GunzipTaskOutput.Companion { method public void main(java.lang.String... args); } } ```