Open enaess opened 9 months ago
This issus seems similar to https://github.com/jfrog/artifactory-gradle-plugin/issues/75 . From your stack trace it looks like Artifactory plugin uses internal Gradle apis, that were removed in latest Gradle version.
@mricciuti Yes, this seems to be new behavior from version 8.x with AGP. Even when I revert to 7.4.2 (the latest of the AGP 7.x series), it gets passed this "unknown property 'release'" problem.
In looking at this in greater detail, the
android
{
publishing {
multipleVariants {
allVariants()
}
}
}
Creates a publication for the "components.default". If you use the following
android {
publishing
singleVariant("release") {
withSourcesJar()
}
}
}
Creates a publication for the "components.release".
In either case, you can further detail the publication clause:
afterEvaluate {
android
{
publishing {
// name it something else, e.g. multiple
multipleVariants("multiple") {
allVariants()
}
}
publishing {
publications {
release(MavenPublication) {
from components.multiple // <- becomes multiple instead of "default" if you left the above unnamed.
artifactId = "${rootProject.name}"
groupId = "com.example.testlibrary"
version = "${android.defaultConfig.versionName}"
}
}
}
}
I still think there needs a documentation update on JFrog's behalf, either by updating the gradle examples and/or documentation.
Describe the bug
The use of the 'maven-publish' plugin is being deprecated for Android builds in favor of using Android's
See here: https://developer.android.com/build/publish-library/configure-pub-variants#groovy
Current behavior
I've looked at the examples by
git clone https://github.com/jfrog/project-examples.git
, and following the gradle example: gradle-android-library-example-ci-server/app/build.gradleThis unfortunately doesn't seem to work at all. I am in lack of a better example / guidance for how to integrate Artifactory into our Android build.
Reproduction steps
git clone https://github.com/jfrog/project-examples.git cd into the android-library-example-ci-server
Do necessary upgrades to run example with Android 8.1.2 and Gradle 8.4
Here is a patch for getting it to comple:
Produces the following error:
Expected behavior
Should work
Artifactory Gradle plugin version
5.1.10
Operating system type and version
Ubuntu 22.04 Linux
JFrog Artifactory version
7.41.14
Gradle version
8.4