Closed seab4ss closed 1 month ago
Hi 👋 I'm guessing you're using something like so to configure the android publication?
android {
publishing {
singleVariant("release") {
withSourcesJar()
}
}
}
The generated sources are registered using srcDir() and I would have expected that to carry task dependencies but maybe there's more to it. I'll take a deeper look. In the meantime your workaround should work fine.
Yes. that's how we configured the android publication. Thank you
Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo Kotlin usage and allow us to serve you better.
(PR merged, SNAPSHOTs are deploying here)
@martinbonnin this issue is fixed in Apollo Kotlin v4.0.1
. Thank you!
Glad to hear that! Thanks for the follow up!
Version
4.0.0
Summary
Our library project includes Apollo Kotlin. We use
maven-publish
plugin for publishing the library.aar
file. After migrating fromv3.8.2
tov4.0.0
, we started seeing error when attempting to publish our library.aar
artifact. It seems that taskmylibrary:sourceReleaseJar
has to depend on:mylibrary:generateMylibrarysvcApolloSources
task To fix the issue, i added the following code inafterEvaluate {}
in themyLibrary/build.gradle.kts
:Is there some configuration setting in Apollo Gradle Plugin that will fix this issue?
Steps to reproduce the behavior
here is publishing section in
mylibrary/build.gradle.kts
run
myLibrary/publishToMavenLocal
task in Android StudioLogs
FAILURE: Build failed with an exception.
What went wrong: A problem was found with the configuration of task ‘:mylibrary:sourceReleaseJar' (type 'SourceJarTask').
Reason: Task ':mylibrary:sourceReleaseJar' uses this output of task ':mylibrary:generateMylibrarysvcApolloSources' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.
Possible solutions:
For more information, please refer to https://docs.gradle.org/8.2/userguide/validation_problems.html#implicit_dependency in the Gradle documentation.