-
Notifications
You must be signed in to change notification settings - Fork 29.3k
Open
Labels
a: buildBuilding flutter applications with the toolBuilding flutter applications with the toolp: toolingAffects the flutter_plugin_tools packageAffects the flutter_plugin_tools packaget: gradle"flutter build" and "flutter run" on Android"flutter build" and "flutter run" on Androidteam-androidOwned by Android platform teamOwned by Android platform teamtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.
Description
We want a command like flutter build --config-only
(or similar) to download Gradle dependencies and list the jar files. Preferably this should work even if the Flutter project is a plugin and not an application with a main
function.
This is useful for jnigen where we want to generate Dart bindings for an application's gradle dependencies.
Similarly, downloading source jars and Javadocs are useful, here is a task that downloads the source artifacts. (Replacing SourcesArtifact
with JavadocArtifact
will do the same for Javadocs)
tasks.register("getSources") {
doLast {
val componentIds =
configurations["releaseCompileClasspath"].incoming.resolutionResult.allDependencies.map { it.from.id }
val result = dependencies.createArtifactResolutionQuery().forComponents(componentIds)
.withArtifacts(JvmLibrary::class.java, SourcesArtifact::class.java).execute()
val sourceArtifacts = mutableListOf<File>()
result.resolvedComponents.forEach { component ->
val sources = component.getArtifacts(SourcesArtifact::class.java)
sources.forEach { artifact ->
if (artifact is ResolvedArtifactResult) {
sourceArtifacts.add(artifact.file)
}
}
}
sourceArtifacts.forEach { println(it) }
}
}
Context: dart-lang/native#628
Metadata
Metadata
Assignees
Labels
a: buildBuilding flutter applications with the toolBuilding flutter applications with the toolp: toolingAffects the flutter_plugin_tools packageAffects the flutter_plugin_tools packaget: gradle"flutter build" and "flutter run" on Android"flutter build" and "flutter run" on Androidteam-androidOwned by Android platform teamOwned by Android platform teamtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.