1
+ apply plugin : ' com.android.library'
2
+
3
+ android {
4
+ compileSdkVersion 24
5
+ buildToolsVersion " 24.0.3"
6
+
7
+ defaultConfig {
8
+ minSdkVersion 14
9
+ targetSdkVersion 24
10
+ versionCode 10
11
+ versionName " 1.0.1"
12
+ }
13
+ buildTypes {
14
+ release {
15
+ minifyEnabled false
16
+ proguardFiles getDefaultProguardFile(' proguard-android.txt' ), ' proguard-rules.pro'
17
+ }
18
+ }
19
+ }
20
+
21
+ dependencies {
22
+ compile fileTree(dir : ' libs' , include : [' *.jar' ])
23
+ compile ' com.android.support:appcompat-v7:24.2.1'
24
+ }
25
+
26
+
27
+
28
+
29
+ apply plugin : ' com.github.dcendents.android-maven'
30
+ apply plugin : ' com.jfrog.bintray'
31
+ // This is the library version used when deploying the artifact
32
+ version = " 1.1"
33
+
34
+ def siteUrl = ' https://github.com/teprinciple/SlideBack' // 项目的主页
35
+ def gitUrl = ' https://github.com/teprinciple/SlideBack.git' // Git仓库的url
36
+ group = " com.teprinciple" // Maven Group ID for the artifact,一般填你唯一的包名
37
+ install {
38
+ repositories. mavenInstaller {
39
+ // This generates POM.file_paths with proper parameters
40
+ pom {
41
+ project {
42
+ packaging ' aar'
43
+ // Add your description here
44
+ name ' A Simple library for Android Activity slideback'
45
+ url siteUrl
46
+ // Set your license
47
+ licenses {
48
+ license {
49
+ name ' The Apache Software License, Version 2.0'
50
+ url ' http://www.apache.org/licenses/LICENSE-2.0.txt'
51
+ }
52
+ }
53
+ developers {
54
+ developer {
55
+ id ' teprinciple' // 填写的一些基本信息
56
+ name ' teprinciple'
57
+
58
+ }
59
+ }
60
+ scm {
61
+ connection gitUrl
62
+ developerConnection gitUrl
63
+ url siteUrl
64
+ }
65
+ }
66
+ }
67
+ }
68
+ }
69
+ task sourcesJar (type : Jar ) {
70
+ from android. sourceSets. main. java. srcDirs
71
+ classifier = ' sources'
72
+ }
73
+ task javadoc (type : Javadoc ) {
74
+ source = android. sourceSets. main. java. srcDirs
75
+ classpath + = project. files(android. getBootClasspath(). join(File . pathSeparator))
76
+ }
77
+ task javadocJar (type : Jar , dependsOn : javadoc) {
78
+ classifier = ' javadoc'
79
+ from javadoc. destinationDir
80
+ }
81
+ artifacts {
82
+ archives javadocJar
83
+ archives sourcesJar
84
+ }
85
+ Properties properties = new Properties ()
86
+ properties. load(project. rootProject. file(' local.properties' ). newDataInputStream())
87
+ bintray {
88
+ user = properties. getProperty(" bintray.user" )
89
+ key = properties. getProperty(" bintray.apikey" )
90
+ configurations = [' archives' ]
91
+ pkg {
92
+ repo = " maven" // //跟上面创建的Maven仓库名字保持一致
93
+ name = " slideback" // 发布到JCenter上的项目名字
94
+ websiteUrl = siteUrl
95
+ vcsUrl = gitUrl
96
+ licenses = [" Apache-2.0" ]
97
+ publish = true
98
+ }
99
+ }
100
+ javadoc { // jav doc采用utf-8编码否则会报“GBK的不可映射字符”错误
101
+ options{
102
+ encoding " UTF-8"
103
+ charSet ' UTF-8'
104
+ }
105
+ }
0 commit comments