This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ResolveDependenciesPlugin : Plugin<Project> { | |
override fun apply(target: Project): Unit = target.run { | |
pluginManager.withPlugin("java") { | |
registerTask(theJars = artifactFilesProvider("compileClasspath", "jar")) | |
} | |
pluginManager.withPlugin("com.android.base") { | |
// This lets us call `./gradlew resolveDependencies` and have it Just Work. | |
val lifecycleTask = tasks.register(RESOLVE_DEPENDENCIES_TASK_NAME) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* An example usage of https://github.com/autonomousapps/dependency-analysis-gradle-plugin/tree/main/testkit. | |
* This uses JUnit5 as the test framework. The test is paramaterized as well. The custom task `printVersions`, | |
* in the test fixture, unzips the jar and prints the contents of a resource file in that jar. The resource file | |
* is generated by "my-plugin", which is an internal plugin that bundles the runtime classpath artifact names | |
* (group:artifact:version) into the final jar built by the application. | |
*/ | |
internal class PluginTest { | |
private companion object { |
OlderNewer