forked from eleme/lancet
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
156 lines (141 loc) · 4.6 KB
/
build.gradle
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
// Top-level build file where you can add configuration options common to all sub-projects/modules.
apply plugin: 'base'
buildscript {
ext {
Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
ele = true
ele = "true" == properties.getProperty("ele")
if (!ele) {
bintrayUser = properties.getProperty('bintrayUser')
bintrayKey = properties.getProperty('bintrayKey')
}
lancet_group = 'me.ele'
lancet_version = '1.0.6'
//lancet_version = '0.0.1.8-SNAPSHOT'
asm_version = '5.1'
//android_tools_version = '2.4.0-alpha6'
android_tools_version = '3.3.2'
guava_version = '24.0'
}
repositories {
jcenter()
mavenCentral()
maven {
if (ele) {
url "http://maven.dev.elenet.me/nexus/content/groups/public"
} else {
url "https://dl.bintray.com/eleme-mt-arch/maven"
}
}
}
dependencies {
if (ele) {
classpath 'me.ele:eradle:1.7.0'
} else {
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
}
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
subprojects { pro ->
repositories {
jcenter()
mavenCentral()
maven {
url 'https://maven.google.com'
}
}
if (pro.name == 'sample-test')return
version = lancet_version
group = lancet_group
if (ele) {
apply plugin: 'eradle'
modifyPom {
project {
groupId lancet_group
artifactId pro.name
version lancet_version
packaging 'jar'
}
}
extraArchive {
sources = true
}
} else {
apply plugin: 'maven'
apply plugin: 'com.jfrog.bintray'
afterEvaluate {
task sourcesJar(type: Jar) {
from sourceSets.main.java.srcDirs
classifier = 'sources'
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives sourcesJar
archives javadocJar
}
tasks.install {
repositories.mavenInstaller {
pom {
project {
packaging 'jar'
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id 'dieyidezui'
name '耿万鹏'
email '[email protected]'
}
developer {
id 'jude95'
name '朱晨曦'
email '[email protected]'
}
}
}
}
}
}
}
bintray {
user = bintrayUser
key = bintrayKey
configurations = ['archives']
pkg {
userOrg = "eleme-mt-arch"
repo = "maven"
userOrg = "eleme-mt-arch"
name = pro.name //发布到JCenter上的项目名字
websiteUrl = "https://github.com/eleme/lancet"
vcsUrl = "[email protected]:eleme/lancet.git"
licenses = ["Apache-2.0"]
publish = true
}
}
}
}
task uploadAll { task ->
task.group = 'upload'
gradle.projectsEvaluated {
task.dependsOn project.tasks.clean
task.dependsOn project.tasks.build
project.tasks.build.mustRunAfter project.tasks.clean
project.subprojects {
if (it.name != 'sample-test') {
Task upload = !ele ? it.tasks.bintrayUpload : it.tasks.uploadArchives;
task.dependsOn upload
upload.mustRunAfter project.tasks.build
}
}
}
}