Skip to content

Commit 34767cf

Browse files
Update version to 20.5.12 and refine publishing configuration
1 parent b230c58 commit 34767cf

4 files changed

Lines changed: 23 additions & 11 deletions

File tree

build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ buildscript {
88
}
99
dependencies {
1010
classpath 'com.android.tools.build:gradle:9.2.1'
11-
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
1211
classpath 'io.github.gradle-nexus:publish-plugin:2.0.0'
1312
}
1413
}

library/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
apply plugin: 'com.android.library'
2+
apply plugin: 'maven-publish'
23

34
ext {
45
PUBLISH_GROUP_ID = 'io.github.tutorialsandroid'
5-
PUBLISH_VERSION = '20.5.11'
6+
PUBLISH_VERSION = '20.5.12'
67
PUBLISH_ARTIFACT_ID = 'kalertdialog'
78
PUBLISH_DESCRIPTION = 'AlertDialog for Android, a beautiful and material alert dialog to use in your android app.'
89
PUBLISH_URL = 'https://github.com/tutorialsandroid/KAlertDialog'

sample/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ android {
88
applicationId "com.developer.kalert.alert"
99
minSdkVersion 23
1010
targetSdkVersion 37
11-
versionCode 40
12-
versionName "20.5.11"
11+
versionCode 41
12+
versionName "20.5.12"
1313
}
1414

1515
compileOptions {

scripts/publish-module.gradle

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ apply plugin: 'signing'
44
group = PUBLISH_GROUP_ID
55
version = PUBLISH_VERSION
66

7+
def isJitPack = System.getenv("JITPACK") == "true"
8+
79
afterEvaluate {
810
publishing {
911
publications {
@@ -46,17 +48,27 @@ afterEvaluate {
4648
}
4749
}
4850

51+
def hasSigningKeys =
52+
project.hasProperty("signing.keyId") &&
53+
project.hasProperty("signing.password") &&
54+
project.hasProperty("signing.secretKeyRingFile") &&
55+
project.property("signing.keyId") &&
56+
project.property("signing.password") &&
57+
project.property("signing.secretKeyRingFile")
58+
4959
signing {
5060
required {
51-
gradle.taskGraph.allTasks.any { task ->
52-
task.name.toLowerCase().contains("publish")
53-
}
61+
!isJitPack &&
62+
hasSigningKeys &&
63+
!version.toString().endsWith("SNAPSHOT")
5464
}
5565

5666
sign publishing.publications.release
5767
}
58-
}
59-
ext["signing.keyId"] = rootProject.ext["signing.keyId"]
60-
ext["signing.password"] = rootProject.ext["signing.password"]
61-
ext["signing.secretKeyRingFile"] = rootProject.ext["signing.secretKeyRingFile"]
6268

69+
tasks.withType(Sign).configureEach {
70+
onlyIf {
71+
!isJitPack && hasSigningKeys
72+
}
73+
}
74+
}

0 commit comments

Comments
 (0)