How to enable all optional dependencies for tests
I. Transitive dependencies do not work “out of the box” - in my example ‘:main’ depends on ‘:sub2’, which depends on ‘:sub1’, which has an optional dependency. If I simply add testRuntime...
View ArticleUnit test fail when I run "gradle test" but run in Intellij successfully
Ran into this issue as well. Works fine from IntelliJ running a single test or all tests in a class but fails when I try to build with gradle (e.g. gradlew clean build). Found that setting forkEvery=1...
View ArticleArtifact builder task not invoked when resolving configuration
In general this should work. two remarks regarding your snippets. in your dependency declaration there’s a typo. instead of implementation(project(":builder"), configuration = "builderConfig") it...
View ArticleUnsafe configuration resolution warning in a single project
I’ve encountered the following warning when running on a single project build and Gradle 6.3 The configuration :runtimeClasspath was resolved without accessing the project in a safe manner. This may...
View ArticleUnsafe configuration resolution warning in a single project
I think Gradle is basically confused because you’re configuring a task (the jar task) within a configuration block of the configuration itself. And that within the configuration block of the...
View ArticleUpgrade Gradle 4.0
I am working in Andriod Studio 3.6.1. I need to update from Gradle 4.0 to at least Gradle 5.6.4. Step 2 of 7 in an article on docs.gradle.org...
View ArticleForce resolving (and downloading) all dependencies
Hello, I have solved a similar use case. The following script provides a task that can leverage the incremental task support of Gradle, without resolving configurations for other tasks (thanks to the...
View ArticleShare downloaded dependencies : does it work with snapshots?
Gradle 6.2 fixed the Let multiple containers share downloaded dependencies. My question is, does it work well with snapshots? Does Gradle still honor changing resolution mechanisms? If a changing is...
View ArticleShare downloaded dependencies : does it work with snapshots?
Yes it does. Newer snapshots will be downloaded in the write cache.
View ArticleForce resolving (and downloading) all dependencies
The dependency verification feature of Gradle does something like that internally, when calling --write-verification-metadata. Note, however, that as the documentation explains, it’s an approximation...
View ArticleHow do you programmatically access resolved implementation dependencies?
You can access the resolution result using configurations.runtimeClasspath.incoming.resolutionResult. The implementation configuration is just a set of dependencies. So you don’t “access the resolved...
View ArticleArtifact builder task not invoked when resolving configuration
Thanks, that was a typo and I also create the configuration. But still it doesn’t work. I have spent a lot of time on this and I am starting to feel confident there’s a bug somewhere, just not sure...
View ArticleHow to enable all optional dependencies for tests
You’d need to join the optional configurations too. Eg project(':sub1') { dependencies { optional 'org.postgresql:postgresql:42.2.9' } } project(':sub2') { dependencies { implementation...
View ArticleUpgrade Gradle 4.0
The problem is that the Android plugin is doing a check on the Gradle version. But what step 2 means is that you should run with --scan on your current Gradle version to see what deprecated APIs you...
View ArticleArtifact builder task not invoked when resolving configuration
I have created a simple repro project here: https://github.com/natario1/gradle-transform-bug You can see that consumer:consumeAar fails unless you call producer:produceAar first.
View ArticleArtifact builder task not invoked when resolving configuration
consumeAar should declare an input on something that resolves the implementation configuration. For example, inputs.files(configurations.compileClasspath) (I have no idea if the kotlin syntax looks...
View ArticleArtifact builder task not invoked when resolving configuration
@Chris_Dore thanks for your answer - I have added a “consume task” just for demonstration, but in practice I don’t have one, the file is meant to be consumed by the Android Gradle Plugin internally....
View ArticleUnresolved References in settings.gradle.kts moving from 5.6 to 6.2
I have the same problem when migrate from 5.6.4 to 6.4. did you found what is the problem?
View ArticleUnsafe configuration resolution warning in a single project
I was actually wrong, you can configure the manifest classpath entry with a provider { ... } so no need to do it as execution time.
View ArticleGuidance on api vs implemetation dependency on Jackson libraries
So, is that a yes or no? Honestly, I’m still unsure. You say an annotation is a first-class citizen. And I guess using an annotation on a public class creates an instance of the annotation at runtime....
View Article