Skip to content

Commit 1227b97

Browse files
committed
Fix gradle.
1 parent b5bfd87 commit 1227b97

1 file changed

Lines changed: 33 additions & 15 deletions

File tree

activitytasklib/build.gradle

Lines changed: 33 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
apply plugin: 'com.android.library'
22
apply plugin: 'maven-publish'
33

4+
task generateSourcesJar(type: Jar){
5+
from android.sourceSets.main.java.srcDirs
6+
classifier 'sources'
7+
}
8+
49
android {
510
compileSdkVersion 31
611

@@ -14,11 +19,19 @@ android {
1419
consumerProguardFiles "consumer-rules.pro"
1520
}
1621

22+
publishing {
23+
singleVariant("release")
24+
singleVariant("debug")
25+
}
1726
buildTypes {
1827
release {
1928
minifyEnabled false
2029
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
2130
}
31+
debug{
32+
minifyEnabled false
33+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
34+
}
2235
}
2336
compileOptions {
2437
sourceCompatibility JavaVersion.VERSION_11
@@ -32,21 +45,26 @@ dependencies {
3245
}
3346

3447

35-
// ------------ publish to jitpack ------------
36-
def GROUP_ID = "cc.rome753"
37-
def ARTIFACT_ID = "activitytasklib"
38-
def VERSION = "1.0"
39-
40-
publishing {
41-
publications {
42-
register("release", MavenPublication) {
43-
groupId = GROUP_ID
44-
artifactId = ARTIFACT_ID
45-
version = VERSION
46-
47-
afterEvaluate {
48-
from(components["release"])
48+
afterEvaluate {
49+
publishing {
50+
publications {
51+
// Creates a Maven publication called "release".
52+
group = 'cc.rome753'
53+
version = '1.0.0'
54+
release(MavenPublication) {
55+
// Applies the component for the release build variant.
56+
from components.release
57+
groupId = group
58+
artifactId = 'activitytasklib'
59+
version = version
60+
}
61+
debug(MavenPublication) {
62+
// Applies the component for the release build variant.
63+
from components.debug
64+
groupId = group
65+
artifactId = 'activitytasklib'
66+
version = version
4967
}
5068
}
5169
}
52-
}
70+
}

0 commit comments

Comments
 (0)