forked from ZKTttttttttt/AndroidTestTool
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
111 lines (102 loc) · 4.28 KB
/
build.gradle
File metadata and controls
111 lines (102 loc) · 4.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'
android {
compileSdkVersion 26
defaultConfig {
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:recyclerview-v7:26.1.0'
implementation 'com.android.support:support-v4:26.1.0'
}
version = "1.0.0"
def siteUrl = 'https://github.com/ZKTian/AndroidTestTool'
def gitUrl = 'https://github.com/ZKTian/AndroidTestTool.git'
group = "com.zkt"
install {
repositories.mavenInstaller {
// 生成pom.xml和参数
pom {
project {
packaging 'aar'
// 项目描述,复制我的话,这里需要修改。
name 'AndroidTestTool'// 可选,项目名称。
description 'A TestTool For Android'// 可选,项目描述。
url siteUrl // 项目主页,这里是引用上面定义好。
// 软件开源协议,现在一般都是Apache License2.0吧,复制我的,这里不需要修改。
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
//填写开发者基本信息,复制我的,这里需要修改。
developers {
developer {
id 'ZangKeTian' // 开发者的id。
name 'ZangKeTian' // 开发者名字。
email '1047631152zkt@gmail.com' // 开发者邮箱。
}
}
// SCM,复制我的,这里不需要修改。
scm {
connection gitUrl // Git仓库地址。
developerConnection gitUrl // Git仓库地址。
url siteUrl // 项目主页。
}
}
}
}
}
// 生成jar包的task,不需要修改。
task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
}
// 生成jarDoc的task,不需要修改。
task javadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
// destinationDir = file("../javadoc/")
failOnError false // 忽略注释语法错误,如果用jdk1.8你的注释写的不规范就编译不过。
}
// 生成javaDoc的jar,不需要修改。
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives javadocJar
archives sourcesJar
}
// 这里是读取Bintray相关的信息,我们上传项目到github上的时候会把gradle文件传上去,所以不要把帐号密码的信息直接写在这里,写在local.properties中,这里动态读取。
Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
bintray {
user = properties.getProperty("bintray.user") // Bintray的用户名。
key = properties.getProperty("bintray.apikey") // Bintray刚才保存的ApiKey。
configurations = ['archives']
pkg {
repo = "AndroidTestTool" // 上传到maven库。(这里要特别注意,如果写了maven报404错误,请在bintray创建一个仓库,这里填改成你创建的仓库的名字,如何创建请看下图。)
name = "testtool" // 发布到Bintray上的项目名字,这里的名字不是compile 'com.yanzhenjie:andserver:1.0.1'中的andserver。
userOrg = '1047631152zkt' // Bintray的用户名,2016年11月更新。
websiteUrl = siteUrl
vcsUrl = gitUrl
licenses = ["Apache-2.0"]
publish = true // 是否是公开项目。
}
}