Kelvin Chung
08/16/2024, 9:57 PMconfigurations.all {
resolutionStrategy {
force("foo:bar:1.0")
}
}
and using a platform
dependencies {
constraints {
api("foo:bar:1.0")
}
}
snowe
08/19/2024, 1:05 AMpluginManagement
in settings.gradle.kts..Kelvin Chung
08/29/2024, 6:08 PMval configuration = configurations.register("something") {
defaultDependencies {
add(project.dependencies.create("foo:bar:1.0"))
}
}
ant.taskdef("someAnt", "my.ant.AntType", configuration.get())
The error is resulting from a ModuleNotFoundException
, saying
Cannot resolve external dependency foo:bar:1.0 because no repositories are defined.
Yet, the plugin is being applied (transitively) to a project for which repositories are defined. Anyone have any insight?Niels Doucet
08/30/2024, 2:43 PMimplementation(variantOf(libs.myLib) { classifier("myClassifier") })
How can I do the same inside the dependencies block of a JvmTestSuite
?zhiqiang zhang
09/03/2024, 6:06 AMTrevJonez
09/06/2024, 7:06 PMmelix
09/16/2024, 2:28 PMConfigurableFileCollection
. It's been several times that I have a similar use case. In the context of GraalVM native build tools, there's a classpath for compilation, which is built from several different things. It is therefore using ConfigurableFileCollection
. The user may add whatever they want in there, a Configuration
, a File
, ... However, for some features, I have to reason about the kind of files that are part of this collection. In particular, I need to be able to reason about the GAV coordinates of an artifact. Obviously, a File
doesn't give us this information. The closest thing that I can use is an ArtifactView
, but it only works for things that I handle, e.g, if I configure the default classpath to be derived from a Configuration
, I can reason about it, but who knows what the user would do: clear the collection, add files, add more `Configuration`s, etc. Is there any chance we can get an API which wouldn't be just getFiles()
but something richer that we can reason about?Ian Brandt
09/19/2024, 10:02 PMtestImplementation
configuration extendsFrom
the project's implementation
configuration (and in turn, api
). However, for any other test suite I add, that's not the case, and the docs show adding an implementation(project())
dependency instead. I believe I understand why the project dependency isn't added automatically, i.e. to give build authors more flexibility for their test suite dependencies. My question is, why a project dependency instead of extending from the project's implementation
configuration like the built-in unit test suite does? I'm looking to more thoroughly understand the design difference.Tomáš Procházka
10/05/2024, 2:16 PMandroidx-compose-bom
and inside of Gradle scripts "-" are replaced by "." this is so awful solution and it is used everywhere 😭 It completely prevent to use code suggestion / auto completion inside of IDE.
When you have something like androidx-compose-material3-adaptive-navigation
and you don't remember the whole name, just know that it is navigation, you are lost. With androidxComposeMaterial3AdaptiveNavigation
, you can write just nav
and you are done. Or if you want to add some dependency even before project is properly synced, with camel case you can just copy&paste it, with current format is a huge pain.
The same if you are using currently popular build-logic
in project plugins to simplify multi-module setup. Then you need to use
add("implementation", libs.findLibrary("androidx.compose.material3.adaptive.navigation").get())
And you need to manually handle replacing -
by .
. Or when you want to found where it is used, you cannot just select text and search.
Is there any petition for stop using a-b-c
syntax. I would sign in immediately 😉.Partha Suresh
10/13/2024, 7:20 AMCould not create an instance of type com.android.build.api.variant.impl.LibraryVariantBuilderImpl.> Namespace not specified. Specify a namespace in the module's build file: /Users/parthas/.pub-cache/hosted/pub.dev/flutter_inappwebview-5.8.0/android/build.gradle. See https://d.android.com/r/tools/upgrade-assistant/set-namespace for information about setting the namespace. If you've specified the package attribute in the source AndroidManifest.xml, you can use the AGP Upgrade Assistant to migrate to the namespace value in the build file. Refer to https://d.android.com/r/tools/upgrade-assistant/agp-upgrade-assistant for general information about using the AGP Upgrade Assistant. is anybody facing this issue? Provide any solution for this
Martin
10/20/2024, 5:45 PMMartin
10/27/2024, 7:39 PMMartin
11/07/2024, 3:19 PMpom.license.url
in addition to pom.license.name
?
We're considering removing the url from our poms because they duplicate information and make the pom validation somewhat harder: url can take many forms while license.name
can point to a well defined SPDX id. Are we breaking someone's workflow by doing this?Daymon
11/11/2024, 4:28 PMeb4c1bfd4f042f6dddccec917721f63bd38b4796
on the ubuntu keyserver, we'd have to manually add a <trusted-key>
entry per subkey.
I can see the value in doing this, since subkeys are usually rotated- but from a consumer standpoint, this seems verbose. I guess a better question would be, is there a way to have gradle automatically add subkeys of a trusted key to the metadata xml file? I understand you can run ./gradlew --write-verification-metadata pgp,sha256
to automatically populate the metadata, but that can potentially introduce excessive positives for untrusted artifacts. Ideally, we want to automatically update the metadata file, but only for updating trusted keys per remote key servers.
Am I missing some feature or misunderstanding something about the process here?Martin
11/21/2024, 4:16 PMIvan CLOVIS Canet
12/06/2024, 2:18 PMIvan CLOVIS Canet
12/15/2024, 4:57 PMefemoney
12/18/2024, 2:23 PMDependencyCollector
& DependencyModifier
etc APIs? Its been incubating for a while & entire ecosystem is in shambles regarding dependencies (*_stares directly at KGP_ 👀), Any blockers to stabilizing these APIs?Dmitry Lapshin
01/08/2025, 7:23 PMConfiguration.getResolvedConfiguration()
to Configuration.getIncoming()
?
I've found an observable behaviour change, even though it's a bit small: if one adds file dependencies (like implementation(files("libs/a.jar"))
):
• Old API wouldn't return them from ResolvedConfiguration.getResolvedArtifacts()
but would return them in ResolvedConfiguration.getFiles()
,
• But new one will return both from ResolvableConfiguration.getArtifacts()
, but for standalone files their ResolvedArtifactResult.getId()
would be (at 8.12 at least) of org.gradle.internal.component.local.model.OpaqueComponentArtifactIdentifier
, and the only things accessible without using the internal class are `toString`/`displayName` and friends, and they aren't fully informative, for me they only contain file name.
On older API I've run through ResolvedConfiguration.getFiles()
and for all files not found in .getResolvedArtifacts()
I'd mark them down for my usage by their path, but in new API those are in artifacts, and the component name lacks full path.Martin
01/10/2025, 6:11 PMMartin
01/15/2025, 4:11 PMIncluded build 'apollo-kotlin' not found in build 'apollo-kotlin'
Moving away from pluginManagement { includeBuild() }
/`plugins { id() }` to includeBuild()
/`buildscript { dependencies {} }` fixes the issue but it feels really weird. Does anyone have any clue what could have gone wrong here?Jacob Skillin
01/20/2025, 4:03 PMfailOnVersionConflict
resolution strategy, and dependency locking lockAllConfigurations
turned on, ends up requiring also the exact same version of Gradle to reproduce the same build. This appears to be because the kotlin-dsl plugin aggressively writes the stdlib and other dependencies into the graph:
* What went wrong:
Execution failed for task ':dependencies'.
> Could not resolve all dependencies for configuration ':compileClasspath'.
> Conflicts found for the following modules:
- org.jetbrains.kotlin:kotlin-stdlib between versions 1.9.24 and 1.9.22
- org.jetbrains.kotlin:kotlin-reflect between versions 1.9.24 and 1.9.22
In order to correctly reproduce a Gradle build that uses Kotlin, is it also required that I use the exact same version of Gradle to invoke the exact same Kotlin compiler as well? Or is it possible to ask Kotlin to use different dependencies in my project?Robert Elliot
02/11/2025, 4:01 PM:app
, which has the spring boot plugin applied, so it generates a runnable jar artifact from tasks.bootJar
into layout.buildDirectory.dir("libs")
- in practice, app/build/libs/app-boot.jar
. It also has the application
plugin so it generates app/build/libs/app-plain.jar
(which does not contain all the other deps).
I would like the parent project to copy app-boot.jar
into is build dir - layout.buildDirectory.dir("artifacts")
, in practice build/artifacts/app-boot.jar
.
Non-working attempt in thread...Barteks2x
02/17/2025, 7:44 PMBarteks2x
02/17/2025, 9:40 PMChris Doré
02/18/2025, 9:09 PMplatform(<dep>)
(Gradle 2.8 to be precise), did Gradle properly work with importing boms? I'm working with an old build that I cannot upgrade. The POM of one of the deps contains:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>my.group</groupId>
<artifactId>myPlatform</artifactId>
<version>1.2.3</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
That platform contains a dependencyManagement
element as expected, however the versions listed appear to have no influence on the resolved dep tree.
I cannot recall whether such an old Gradle version fully resolves dep management sections or not, and I'm not sure if I've got something broken in the build or if it's just the Gradle version.pablozki
02/24/2025, 8:31 PMMichal Klusák
03/03/2025, 11:00 AM// include(":A") // Commented out
// include(":B") // Commented out
build.gradle.kts:
kotlin.sourceSets {
if (isABEnabled()) { // false
val commonMain by getting {
dependencies {
implementation(projects.A) // Gradle sync fails
implementation(projects.B) // Gradle sync fails
}
}
}
}
The old dependency declaration works, but I would like to use type-safe access everywhere:
kotlin.sourceSets {
if (isABEnabled()) { // false
val commonMain by getting {
dependencies {
implementation(":A") // Gradle sync works
implementation(":B") // Gradle sync works
}
}
}
}
kris
04/02/2025, 12:10 AMtesting {
suites {
// Configure the default test suite (unit tests)
val test by getting(JvmTestSuite::class) {
useJUnitJupiter()
}
// Register an integration test suite
register<JvmTestSuite>("testGraphql") {
// Define test sources directories
sources {
kotlin {
srcDir("src/testGraphql/kotlin")
}
resources {
srcDir("src/testGraphql/resources")
}
}
dependencies {
implementation(project())
}
// Configure the implementation configuration to extend from the main implementation
configurations {
// Make testGraphqlImplementation extend from implementation
named(sources.implementationConfigurationName) {
extendsFrom(configurations["implementation"])
// Also extend from testImplementation to get all test dependencies
extendsFrom(configurations["testImplementation"])
}
// Make testGraphqlRuntimeOnly extend from runtimeOnly
named(sources.runtimeOnlyConfigurationName) {
extendsFrom(configurations["runtimeOnly"])
extendsFrom(configurations["testRuntimeOnly"])
}
}
// Test framework
useJUnitJupiter()
targets {
all {
testTask.configure {
// Make integration tests run after unit tests
shouldRunAfter(test)
// Only run tests if they've changed
outputs.upToDateWhen { false }
}
}
}
}
}
}
tasks.named("check") {
dependsOn(testing.suites.named("testGraphql"))
}
tasks.withType<Test> {
useJUnitPlatform()
}
Also I was having an issue where I have some duplicate test resources, I have solved it with this. but ideally I wouldn't need a duplicate strategy, it would just not put the the resources from a different jvmtestsuite on the classpath, that way they are seperate but can exist in the same project, but I don't know how to arrange this.
tasks.named<ProcessResources>("processTestResources") {
duplicatesStrategy = DuplicatesStrategy.INCLUDE // Options: INCLUDE, WARN, EXCLUDE
}
tasks.named<ProcessResources>("processTestGraphqlResources") {
duplicatesStrategy = DuplicatesStrategy.INCLUDE // Options: INCLUDE, WARN, EXCLUDE
}
Satyarth Sampath
04/24/2025, 8:08 AM