Skip to content

Commit e2356e7

Browse files
committed
Publish to maven.
1 parent 1588280 commit e2356e7

6 files changed

Lines changed: 25 additions & 50 deletions

File tree

activitytasklib/build.gradle

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
apply plugin: 'com.android.library'
2+
apply plugin: 'maven-publish'
23

34
android {
45
compileSdkVersion 31
@@ -25,9 +26,25 @@ android {
2526

2627
dependencies {
2728
implementation 'androidx.appcompat:appcompat:1.1.0'
28-
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
2929
implementation 'androidx.startup:startup-runtime:1.1.1'
30-
testImplementation 'junit:junit:4.12'
31-
androidTestImplementation 'androidx.test:runner:1.2.0'
32-
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
30+
}
31+
32+
33+
// ------------ publish to jitpack ------------
34+
def GROUP_ID = "cc.rome753"
35+
def ARTIFACT_ID = "activitytasklib"
36+
def VERSION = "1.0.0"
37+
38+
publishing {
39+
publications {
40+
register("release", MavenPublication) {
41+
groupId = GROUP_ID
42+
artifactId = ARTIFACT_ID
43+
version = VERSION
44+
45+
afterEvaluate {
46+
from(components["release"])
47+
}
48+
}
49+
}
3350
}

activitytasklib/src/androidTest/java/cc/rome753/activitytasklib/ExampleInstrumentedTest.java

Lines changed: 0 additions & 26 deletions
This file was deleted.

activitytasklib/src/test/java/cc/rome753/activitytasklib/ExampleUnitTest.java

Lines changed: 0 additions & 17 deletions
This file was deleted.

app/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ android {
2121
}
2222

2323
dependencies {
24-
debugImplementation project(path: ':activitytasklib')
24+
// debugImplementation project(path: ':activitytasklib')
25+
debugImplementation "cc.rome753:activitytasklib:1.0.0"
2526
implementation 'androidx.appcompat:appcompat:1.1.0'
2627
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
2728
testImplementation 'junit:junit:4.12'

app/src/main/java/cc/rome753/demo/DemoApplication.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
import android.app.Application;
44

5-
import cc.rome753.activitytasklib.ActivityTaskHelper;
6-
75
/**
86
* Created by rome753@163.com on 2017/3/23.
97
*/

build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ buildscript {
44
repositories {
55
jcenter()
66
google()
7+
mavenLocal()
78
}
89
dependencies {
910
classpath "com.android.tools.build:gradle:4.1.0"
@@ -17,6 +18,7 @@ allprojects {
1718
repositories {
1819
jcenter()
1920
google()
21+
mavenLocal()
2022
}
2123
}
2224

0 commit comments

Comments
 (0)