forked from Tencent/Shadow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
84 lines (74 loc) · 2.54 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
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.2.41'
repositories {
maven {
url "http://maven.oa.com/nexus/content/repositories/jcenter"
}
maven {
url "http://maven.oa.com/nexus/content/repositories/google-maven/"
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
ext.COMPILE_SDK_VERSION = 27
ext.MIN_SDK_VERSION = 15
ext.TARGET_SDK_VERSION = 27
if ("${System.env.CI}".equalsIgnoreCase("true")) {
ext.VERSION_CODE = Integer.parseInt("${System.env.BuildNo}")
ext.VERSION_NAME = "${System.env.MajorVersion}.${System.env.MinorVersion}.${System.env.FixVersion}"
} else {
ext.VERSION_CODE = 1
ext.VERSION_NAME = "local"
}
if ("${System.env.PUBLISH_RELEASE}".equalsIgnoreCase("true")) {
ext.VERSION_SUFFIX = ""
} else {
ext.VERSION_SUFFIX = "-SNAPSHOT"
}
ext.ARTIFACT_VERSION = ext.VERSION_NAME + ext.VERSION_SUFFIX
repositories {
maven {
url "http://maven.oa.com/nexus/content/repositories/google-maven/"
}
maven {
url "http://maven.oa.com/nexus/content/repositories/jcenter"
}
maven {
url "http://maven.oa.com/nexus/content/repositories/thirdparty/"
}
if (!"${System.env.PUBLISH_RELEASE}".equalsIgnoreCase("true")) {
maven {
url "http://maven.oa.com/nexus/content/repositories/thirdparty-snapshots/"
}
}
}
ext.PLUGINMANAGER_VERSION = "1.3.8"
}
task clean(type: Delete) {
delete rootProject.buildDir
}
static def sdkTasks(task) {
return [":shadow-sdk:shadow-loader:$task",
":shadow-sdk:shadow-runtime:$task",
":shadow-sdk:shadow-transform:$task"]
}
tasks.create('cleanSdk').dependsOn(sdkTasks('clean'))
tasks.create('lintSdk').dependsOn(
":shadow-sdk:shadow-loader:lintRelease",
":shadow-sdk:shadow-runtime:lintRelease"
)
tasks.create('publishSdkToMaven')
.dependsOn(lintSdk)
.dependsOn(sdkTasks('publishReleasePublicationToMavenRepository'))
.mustRunAfter(cleanSdk)
tasks.create('cleanThenPublishSdkToMaven').dependsOn(
cleanSdk,
publishSdkToMaven
)