forked from alibaba/GaiaX
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
152 lines (128 loc) · 4.28 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
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'maven-publish'
apply plugin: 'org.jetbrains.dokka'
allprojects {
repositories {
mavenLocal()
google()
maven { url "https://jitpack.io" }
mavenCentral()
maven { url 'https://mvnrepository.com/artifact/com.github.gundy/semver4j'}
}
}
buildscript {
ext.kotlin_version = '1.5.31'
repositories {
mavenLocal()
google()
maven { url "https://jitpack.io" }
mavenCentral()
maven { url 'https://mvnrepository.com/artifact/com.github.gundy/semver4j'}
}
dependencies {
classpath "com.android.tools.build:gradle:4.2.2"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.dokka:dokka-gradle-plugin:1.6.10"
}
}
android {
compileSdkVersion 28
defaultConfig {
minSdkVersion 16
targetSdkVersion 28
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
}
// https://www.jianshu.com/p/681589927f1f
compileOptions {
kotlinOptions.freeCompilerArgs += ['-module-name', "GaiaX"]
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
sourceSets {
main {
java.srcDirs = ['src/main/kotlin', 'src/main/java']
jniLibs.srcDir 'src/main/jniLibs'
}
// https://stackoverflow.com/questions/26663539/configuring-res-srcdirs-for-androidtest-sourceset
// https://stackoverflow.com/questions/23643189/android-gradle-src-androidtest-res-layout-mylayout-xml-not-found-in-mypackage-r
androidTest {
java.srcDirs = ['src/androidTest/java']
res.srcDirs = ['src/androidTest/res']
jniLibs.srcDir 'src/main/jniLibs'
}
}
lintOptions {
abortOnError false
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
testOptions {
unitTests {
includeAndroidResources = true
}
}
buildTypes {
debug {
ndk {
abiFilters "x86", 'armeabi-v7a', 'arm64-v8a'
}
}
release {
ndk {
abiFilters 'armeabi-v7a', 'arm64-v8a'
}
}
}
}
dependencies {
implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.5.31@jar'
implementation 'com.alibaba:fastjson:1.2.26@jar'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'androidx.appcompat:appcompat:1.0.0'
if (System.getProperties().get("GaiaXDemo") == "true") {
implementation project(path: ':GXAnalyzeAndroid')
} else {
implementation 'com.github.alibaba.GaiaX:GaiaX-Analyze:main-SNAPSHOT'
}
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'com.github.bumptech.glide:glide:4.12.0'
androidTestImplementation 'com.github.alibaba.GaiaX:GaiaX-Analyze:main-SNAPSHOT'
androidTestImplementation 'com.airbnb.android:lottie:4.1.0'
androidTestImplementation 'androidx.annotation:annotation:1.0.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-intents:3.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.1.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
}
dokkaHtml {
outputDirectory.set(file("$buildDir/GaiaXApiDocs"))
moduleName.set("GaiaX")
}
afterEvaluate {
publishing {
publications {
// Creates a Maven publication called "release".
release(MavenPublication) {
from components.release
if (project.hasProperty("version")) {
version = project.getProperty("version")
} else {
version = '0.0.0'
}
if (project.hasProperty("group")) {
groupId = project.getProperty("group")
} else {
groupId = 'com.github.alibaba.GaiaX'
}
artifactId = 'GaiaX'
}
}
}
}