1
- // 文件开头配置
2
- apply plugin : ' com.android.library'
3
- apply plugin : ' com.jfrog.bintray'
4
- apply plugin : ' com.github.dcendents.android-maven'
5
-
6
- android {
7
- compileSdkVersion 25
8
- buildToolsVersion " 25.0.3"
9
-
10
- defaultConfig {
11
- minSdkVersion 11
12
- targetSdkVersion 25
13
- versionCode 1
14
- versionName " 1.0 "
15
- }
16
- }
17
-
18
- def siteUrl = ' https://github.com/getActivity/XXPermissions' // 项目在github中的地址
19
- def gitUrl = siteUrl + " .git" // 项目在github中的地址
20
-
21
- // compile 'com.hjq:xxpermissions:1.0 '
22
- def groupId = ' com.hjq' // 定义的maven group id最终引用形式
23
- def artifactId = ' xxpermissions' // maven的artifact id,不要带大写,可以用“-”代替
24
- def versionName = ' 1.0 ' // maven 上发布版本号
25
-
26
- def repositoryName = ' maven' // 自己创建的仓库名,直接在bintray账号下创建的
27
- def repositoryDesc = ' Android 6.0 permissions adaptation framework' // 仓库描述,自己定义
28
- def packageName = ' XXPermissions' // 在仓库创建的包名称,在maven jcenter上显示的名字,最终引用的名字
29
-
30
- def idName = ' getactivity' // 填写bintray用户名,注意大小写
31
- def orgName = idName // 自己的organization(组织)名称,这里的组织直接就是自己的用户名
32
- def developerName = ' huangjinqun' // 开发者姓名
33
- def developerEmail = ' jinqun0730@gmail.com' // 开发者邮箱
34
-
35
- def licensesName = ' Apache-2.0' // 不能随便写,只能是仓库创建时选择的license type
36
- def licensesUrl = ' http://www.apache.org/licenses/LICENSE-2.0.txt' // 协议地址
37
-
38
- def codedFormat = ' UTF-8' // 如果你的项目里面有中文注释的话,必须将格式设置为UTF-8,不然会出现乱码
39
- def packagingType = ' aar' // 打包类型,可以打包成aar也可以打包成jar,本质上都是zip包
40
-
41
- Properties properties = new Properties ()
42
- properties. load(project. rootProject. file(' local.properties' ). newDataInputStream())
43
-
44
- // Gradle配置
45
- version = versionName
46
- group = groupId
47
- bintray {
48
- user = properties. getProperty(' bintray.user' )
49
- key = properties. getProperty(' bintray.apikey' )
50
- pkg {
51
- repo = repositoryName
52
- name = packageName
53
- websiteUrl = siteUrl
54
- vcsUrl = gitUrl
55
- licenses = [licensesName]
56
- userOrg = orgName
57
- publish = true // 是否是公开项目,公开别人可以引用
58
- version {
59
- name = versionName
60
- desc = repositoryDesc
61
- released = new Date ()
62
- vcsTag = ' v1.0'
63
- attributes = [' gradle-plugin' : ' com.use.less:com.use.less.gradle:gradle-useless-plugin' ]
64
- }
65
- }
66
- configurations = [' archives' ]
67
- }
68
-
69
- install {
70
- repositories. mavenInstaller {
71
- // This generates POM.xml with proper parameters
72
- pom {
73
- project {
74
- packaging packagingType
75
- name artifactId
76
- description repositoryDesc
77
- url siteUrl
78
- // Set your license
79
- licenses {
80
- license {
81
- name licensesName
82
- url licensesUrl
83
- }
84
- }
85
- developers {
86
- developer {
87
- id idName
88
- name developerName
89
- email developerEmail
90
- }
91
- }
92
- scm {
93
- connection gitUrl
94
- developerConnection gitUrl
95
- url siteUrl
96
- }
97
- }
98
- }
99
- }
100
- }
101
-
102
- task sourcesJar (type : Jar ) {
103
- from android. sourceSets. main. java. srcDirs
104
- classifier = ' sources'
105
- }
106
-
107
- task javadoc (type : Javadoc ) {
108
- failOnError false // 必须添加以免出错
109
- source = android. sourceSets. main. java. srcDirs
110
- classpath + = project. files(android. getBootClasspath(). join(File . pathSeparator))
111
- }
112
-
113
- task javadocJar (type : Jar , dependsOn : javadoc) {
114
- classifier = ' javadoc'
115
- from javadoc. destinationDir
116
- }
117
-
118
- artifacts {
119
- archives javadocJar
120
- archives sourcesJar
121
- }
122
-
123
- javadoc {
124
- options {
125
- encoding codedFormat
126
- charSet codedFormat
127
- author true
128
- version true
129
- links ' http://docs.oracle.com/javase/7/docs/api'
130
- }
1
+ // 文件开头配置
2
+ apply plugin : ' com.android.library'
3
+ apply plugin : ' com.jfrog.bintray'
4
+ apply plugin : ' com.github.dcendents.android-maven'
5
+
6
+ android {
7
+ compileSdkVersion 25
8
+ buildToolsVersion " 25.0.3"
9
+
10
+ defaultConfig {
11
+ minSdkVersion 11
12
+ targetSdkVersion 25
13
+ versionCode 2
14
+ versionName " 1.1 "
15
+ }
16
+ }
17
+
18
+ def siteUrl = ' https://github.com/getActivity/XXPermissions' // 项目在github中的地址
19
+ def gitUrl = siteUrl + " .git" // 项目在github中的地址
20
+
21
+ // compile 'com.hjq:xxpermissions:1.1 '
22
+ def groupId = ' com.hjq' // 定义的maven group id最终引用形式
23
+ def artifactId = ' xxpermissions' // maven的artifact id,不要带大写,可以用“-”代替
24
+ def versionName = ' 1.1 ' // maven 上发布版本号
25
+
26
+ def repositoryName = ' maven' // 自己创建的仓库名,直接在bintray账号下创建的
27
+ def repositoryDesc = ' Android 6.0 permissions adaptation framework' // 仓库描述,自己定义
28
+ def packageName = ' XXPermissions' // 在仓库创建的包名称,在maven jcenter上显示的名字,最终引用的名字
29
+
30
+ def idName = ' getactivity' // 填写bintray用户名,注意大小写
31
+ def orgName = idName // 自己的organization(组织)名称,这里的组织直接就是自己的用户名
32
+ def developerName = ' huangjinqun' // 开发者姓名
33
+ def developerEmail = ' jinqun0730@gmail.com' // 开发者邮箱
34
+
35
+ def licensesName = ' Apache-2.0' // 不能随便写,只能是仓库创建时选择的license type
36
+ def licensesUrl = ' http://www.apache.org/licenses/LICENSE-2.0.txt' // 协议地址
37
+
38
+ def codedFormat = ' UTF-8' // 如果你的项目里面有中文注释的话,必须将格式设置为UTF-8,不然会出现乱码
39
+ def packagingType = ' aar' // 打包类型,可以打包成aar也可以打包成jar,本质上都是zip包
40
+
41
+ Properties properties = new Properties ()
42
+ properties. load(project. rootProject. file(' local.properties' ). newDataInputStream())
43
+
44
+ // Gradle配置
45
+ version = versionName
46
+ group = groupId
47
+ bintray {
48
+ user = properties. getProperty(' bintray.user' )
49
+ key = properties. getProperty(' bintray.apikey' )
50
+ pkg {
51
+ repo = repositoryName
52
+ name = packageName
53
+ websiteUrl = siteUrl
54
+ vcsUrl = gitUrl
55
+ licenses = [licensesName]
56
+ userOrg = orgName
57
+ publish = true // 是否是公开项目,公开别人可以引用
58
+ version {
59
+ name = versionName
60
+ desc = repositoryDesc
61
+ released = new Date ()
62
+ vcsTag = ' v1.0'
63
+ attributes = [' gradle-plugin' : ' com.use.less:com.use.less.gradle:gradle-useless-plugin' ]
64
+ }
65
+ }
66
+ configurations = [' archives' ]
67
+ }
68
+
69
+ install {
70
+ repositories. mavenInstaller {
71
+ // This generates POM.xml with proper parameters
72
+ pom {
73
+ project {
74
+ packaging packagingType
75
+ name artifactId
76
+ description repositoryDesc
77
+ url siteUrl
78
+ // Set your license
79
+ licenses {
80
+ license {
81
+ name licensesName
82
+ url licensesUrl
83
+ }
84
+ }
85
+ developers {
86
+ developer {
87
+ id idName
88
+ name developerName
89
+ email developerEmail
90
+ }
91
+ }
92
+ scm {
93
+ connection gitUrl
94
+ developerConnection gitUrl
95
+ url siteUrl
96
+ }
97
+ }
98
+ }
99
+ }
100
+ }
101
+
102
+ task sourcesJar (type : Jar ) {
103
+ from android. sourceSets. main. java. srcDirs
104
+ classifier = ' sources'
105
+ }
106
+
107
+ task javadoc (type : Javadoc ) {
108
+ failOnError false // 必须添加以免出错
109
+ source = android. sourceSets. main. java. srcDirs
110
+ classpath + = project. files(android. getBootClasspath(). join(File . pathSeparator))
111
+ }
112
+
113
+ task javadocJar (type : Jar , dependsOn : javadoc) {
114
+ classifier = ' javadoc'
115
+ from javadoc. destinationDir
116
+ }
117
+
118
+ artifacts {
119
+ archives javadocJar
120
+ archives sourcesJar
121
+ }
122
+
123
+ javadoc {
124
+ options {
125
+ encoding codedFormat
126
+ charSet codedFormat
127
+ author true
128
+ version true
129
+ links ' http://docs.oracle.com/javase/7/docs/api'
130
+ }
131
131
}
0 commit comments