Skip to content

Commit d97965b

Browse files
committed
improve gradle
1 parent 53b76f4 commit d97965b

File tree

2 files changed

+17
-11
lines changed

2 files changed

+17
-11
lines changed

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ android.useAndroidX=true
1919
android.enableJetifier=true
2020
# Kotlin code style for this project: "official" or "obsolete":
2121
kotlin.code.style=official
22-
sdkVersion=2.9.4
22+
sdkVersion=2.9.5

sdk/build.gradle

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ ext {
1919
PUBLISH_SCM_URL = 'https://github.com/apphud/ApphudSDK-Android/tree/master'
2020
}
2121

22-
apply from: "${rootProject.projectDir}/scripts/publish-module.gradle"
22+
// Apply full publishing script for Maven Central, but not for JitPack
23+
if (!project.hasProperty('group') || !project.group.toString().startsWith('com.github.')) {
24+
apply from: "${rootProject.projectDir}/scripts/publish-module.gradle"
25+
}
2326

2427
android {
2528
defaultConfig {
@@ -60,15 +63,18 @@ android {
6063
}
6164
}
6265

63-
//afterEvaluate {
64-
// publishing {
65-
// publications {
66-
// release(MavenPublication) {
67-
// from components.release
68-
// }
69-
// }
70-
// }
71-
//}
66+
// Simple publishing configuration for JitPack only
67+
if (project.hasProperty('group') && project.group.toString().startsWith('com.github.')) {
68+
afterEvaluate {
69+
publishing {
70+
publications {
71+
release(MavenPublication) {
72+
from components.release
73+
}
74+
}
75+
}
76+
}
77+
}
7278

7379
dependencies {
7480
implementation fileTree(dir: "libs", include: ["*.jar"])

0 commit comments

Comments
 (0)