Skip to content

Commit 1b82820

Browse files
committed
添加源码输出
1 parent 96e2d95 commit 1b82820

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

listrelated/build.gradle

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,32 @@ dependencies {
4848
// compile 'com.orhanobut:logger:1.15@aar'
4949
compile 'com.github.zhaokaiqiang.klog:library:1.6.0'
5050
}
51+
52+
// 指定编码
53+
tasks.withType(JavaCompile) {
54+
options.encoding = "UTF-8"
55+
}
56+
57+
// 打包源码
58+
task sourcesJar(type: Jar) {
59+
from android.sourceSets.main.java.srcDirs
60+
classifier = 'sources'
61+
}
62+
63+
task javadoc(type: Javadoc) {
64+
failOnError false
65+
source = android.sourceSets.main.java.sourceFiles
66+
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
67+
classpath += configurations.compile
68+
}
69+
70+
// 制作文档(Javadoc)
71+
task javadocJar(type: Jar, dependsOn: javadoc) {
72+
classifier = 'javadoc'
73+
from javadoc.destinationDir
74+
}
75+
76+
artifacts {
77+
archives sourcesJar
78+
archives javadocJar
79+
}

0 commit comments

Comments
 (0)