Skip to content

Commit 35a6c42

Browse files
author
WinWang
committed
添加jitpack发布
1 parent e1d5246 commit 35a6c42

File tree

6 files changed

+78
-14
lines changed

6 files changed

+78
-14
lines changed

app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ buildscript {
66
}
77
dependencies {
88
//加载自定义插件
9-
classpath 'com.winwang.plugin.lifecycle:ApplicationInit:1.0'
9+
classpath 'com.winwang.plugin.lifecycle:applifecycle-plugin:1.0.0'
1010
}
1111
}
1212

applifecycle-annotation/build.gradle

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,19 @@ java {
77
sourceCompatibility = JavaVersion.VERSION_1_8
88
targetCompatibility = JavaVersion.VERSION_1_8
99
}
10+
11+
/**
12+
* 发布jitpack
13+
*/
14+
afterEvaluate {
15+
publishing {
16+
publications {
17+
release(MavenPublication) {
18+
from components.java
19+
groupId = project.groupId
20+
artifactId = 'applifecycle-annotation'
21+
version = "1.0.0"
22+
}
23+
}
24+
}
25+
}

applifecycle-api/build.gradle

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,20 @@ dependencies {
3838
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
3939
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
4040
api project(path: ':applifecycle-annotation')
41+
}
42+
43+
/**
44+
* 发布jitpack
45+
*/
46+
afterEvaluate {
47+
publishing {
48+
publications {
49+
release(MavenPublication) {
50+
from components.release
51+
groupId = project.groupId
52+
artifactId = 'applifecycle-api'
53+
version = project.libVersion
54+
}
55+
}
56+
}
4157
}

applifecycle-plugin/build.gradle

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,24 +30,39 @@ dependencies {
3030

3131
//from components.java 发布java library
3232
//from components.release 发布Android Library
33+
//afterEvaluate {
34+
// publishing {
35+
// //发布服务器类似jitpack
36+
// publications {
37+
// release(MavenPublication) {
38+
// from components.java
39+
// groupId = 'com.winwang.plugin.lifecycle'
40+
// artifactId = 'ApplicationInit'
41+
// version = 1.0
42+
// }
43+
// }
44+
// //发布仓库repository
45+
// repositories {
46+
// maven {
47+
// url = "file:///Users/winwang/.m2/repository/"
48+
// }
49+
//
50+
// }
51+
// }
52+
//}
53+
54+
/**
55+
* 发布jitpack
56+
*/
3357
afterEvaluate {
3458
publishing {
35-
//发布服务器类似jitpack
3659
publications {
3760
release(MavenPublication) {
3861
from components.java
39-
groupId = 'com.winwang.plugin.lifecycle'
40-
artifactId = 'ApplicationInit'
41-
version = 1.0
62+
groupId = project.groupId
63+
artifactId = 'applifecycle-plugin'
64+
version = project.libVersion
4265
}
4366
}
44-
//发布仓库repository
45-
repositories {
46-
maven {
47-
url = "file:///Users/winwang/.m2/repository/"
48-
}
49-
50-
}
51-
5267
}
5368
}

applifecycle-processor/build.gradle

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,20 @@ dependencies {
1717
implementation 'com.squareup:javapoet:1.13.0'
1818
implementation project(path: ':applifecycle-annotation')
1919
//依赖apt-annotation
20+
}
2021

22+
/**
23+
* 发布jitpack
24+
*/
25+
afterEvaluate {
26+
publishing {
27+
publications {
28+
release(MavenPublication) {
29+
from components.java
30+
groupId = project.groupId
31+
artifactId = 'applifecycle-processor'
32+
version = project.libVersion
33+
}
34+
}
35+
}
2136
}

gradle.properties

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,6 @@ kotlin.code.style=official
2121
# resources declared in the library itself and none from the library's dependencies,
2222
# thereby reducing the size of the R class for that library
2323
android.nonTransitiveRClass=true
24-
#android.suppressUnsupportedCompileSdk=32
24+
#android.suppressUnsupportedCompileSdk=32
25+
groupId=com.github.WinWang
26+
libVersion=1.0.0

0 commit comments

Comments
 (0)