File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,10 +19,15 @@ plugins {
1919}
2020
2121def versionFile = file(" version.properties" )
22- def projectVersion = versionFile. text. split(" VERSION_NAME=" )[1 ]. trim()
22+ def fileVersion = versionFile. text. split(" VERSION_NAME=" )[1 ]. trim()
23+ // Use version passed by JitPack (-Pversion=vX.Y.Z), stripping the 'v' prefix if present.
24+ // Falls back to version.properties for local builds.
25+ def jitpackVersion = (project. hasProperty(' version' ) && project. version != ' unspecified' )
26+ ? project. version. toString(). replaceAll(' ^v' , ' ' )
27+ : fileVersion
2328
2429project(' :personalization-sdk' ) {
25- version= projectVersion
30+ version = jitpackVersion
2631}
2732
2833allprojects {
Original file line number Diff line number Diff line change @@ -11,7 +11,9 @@ publishing {
1111 return
1212 }
1313
14- if (variant. flavorName != variantName) {
14+ // When variantName is empty (e.g. JitPack builds), publish all release variants.
15+ // When variantName is set (CI/CD), publish only the matching flavor.
16+ if (variantName && variant. flavorName != variantName) {
1517 println " Skipping variant due to flavor mismatch: ${ variant.flavorName} != ${ variantName} "
1618 return
1719 }
Original file line number Diff line number Diff line change @@ -124,7 +124,8 @@ tasks.register('sourcesJar', Jar) {
124124}
125125
126126tasks. register(' javadoc' , Javadoc ) {
127- source = fileTree(dir : ' src/main/kotlin' , include : ' **/*.kt' )
127+ // Javadoc tool cannot process .kt files — only include generated .java stubs
128+ source = fileTree(dir : ' src/main/kotlin' , include : ' **/*.java' )
128129 classpath + = files(" ${ android.sdkDirectory} /platforms/${ android.compileSdkVersion} /android.jar" )
129130 failOnError false
130131 options. encoding = ' UTF-8'
You can’t perform that action at this time.
0 commit comments