Skip to content

Commit

Permalink
1.修改gradle打包方式,修改上传jitpack时进行上传源码
Browse files Browse the repository at this point in the history
  • Loading branch information
keep2iron committed Nov 13, 2018
1 parent 386d46a commit 60864e6
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
2 changes: 2 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ buildscript {
dependencies {
classpath deps.android_gradle_plugin
classpath deps.kotlin_gradle_plugin
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
}
repositories {
google()
mavenCentral()
}
}

Expand Down
32 changes: 32 additions & 0 deletions lib-pineapple/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'com.github.dcendents.android-maven'

group='com.github.keep2iron' // 指定group,com.github.<用户名>

android {
compileSdkVersion versions.build.target_sdk
Expand Down Expand Up @@ -42,3 +45,32 @@ dependencies {
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

// 指定编码
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
}

// 打包源码
task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
}

task javadoc(type: Javadoc) {
failOnError false
source = android.sourceSets.main.java.sourceFiles
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
classpath += configurations.compile
}

// 制作文档(Javadoc)
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}

artifacts {
archives sourcesJar
archives javadocJar
}

0 comments on commit 60864e6

Please sign in to comment.