No longer able to use bundleReleaseAar in MavenPublication

前端 未结 3 892
暖寄归人
暖寄归人 2021-01-11 22:44

After upgrading Gradle to 5.1.1, I found that I\'m unable to add bundleReleaseAar as an artifact to my MavenPublication. Here\'s the relevant snippet of my buil

3条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-11 23:26

    I solved it by calling the artifact function into the afterEvaluate closure, the issue is that the artifact function does not handle all the configuration lazily

    publishing {
       publications {
          aar(MavenPublication) {
            groupId libraryGroupId
            version libraryVersion
            artifactId libraryArtifactId
            afterEvaluate {
               artifact bundleReleaseAar
               //artifact sourcesJar
               //artifact packageJavadoc
            }
         }
       }
    }
    

    Reference https://github.com/moberwasserlechner/capacitor-oauth2/issues/10

提交回复
热议问题