Skip to content

Commit 3ec9656

Browse files
committed
update gradle
1 parent 1d63b85 commit 3ec9656

File tree

2 files changed

+36
-4
lines changed

2 files changed

+36
-4
lines changed

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ buildscript {
44
'compileSdk' : 32,
55
'minSdk' : 21,
66
'targetSdk' : 32,
7-
'versionCode' : 11,
8-
'versionName' : "2.2.0",
7+
'versionCode' : 12,
8+
'versionName' : "2.2.1",
99
'sourceCompatibility': JavaVersion.VERSION_11,
1010
'targetCompatibility': JavaVersion.VERSION_11,
1111
'kotlin' : '1.7.10',

library/build.gradle

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,49 @@ android {
4646

4747
dependencies {
4848
api fileTree(dir: 'libs', include: ['*.jar'])
49-
implementation deps.androidxLifecycle
49+
api deps.androidxLifecycle
5050
implementation deps.androidxAnnotations
5151
implementation deps.androidxCore
52-
implementation 'androidx.appcompat:appcompat:1.5.1'
52+
compileOnly 'androidx.appcompat:appcompat:1.5.1'
5353

5454

5555
testImplementation deps.junit
5656

5757
androidTestImplementation deps.androidxJunit
5858
androidTestImplementation deps.androidxTestRunner
5959
}
60+
//---------------------------------------------
61+
62+
// 指定编码
63+
tasks.withType(JavaCompile) {
64+
options.encoding = "UTF-8"
65+
}
66+
67+
// 打包源码
68+
task sourcesJar(type: Jar) {
69+
from android.sourceSets.main.java.srcDirs
70+
archiveClassifier.set("sources")
71+
}
72+
73+
task javadoc(type: Javadoc) {
74+
failOnError false
75+
source = android.sourceSets.main.java.sourceFiles
76+
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
77+
classpath += configurations.api
78+
classpath += configurations.implementation
79+
classpath += configurations.compileOnly
80+
}
81+
82+
// 制作文档(Javadoc)
83+
task javadocJar(type: Jar, dependsOn: javadoc) {
84+
archiveClassifier.set("javadoc")
85+
from javadoc.destinationDir
86+
}
87+
88+
artifacts {
89+
archives sourcesJar
90+
archives javadocJar
91+
}
6092

6193
afterEvaluate {
6294
publishing {

0 commit comments

Comments
 (0)