-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
210 lines (168 loc) · 5.26 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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
VERSION = file("${rootDir}/version.txt").text
binTrayKey = System.getenv("BINTRAY_API_KEY") ?: ""
/**
* Publish all local
*/
publishProjects = [
"kdux-android",
"kdux-core"
]
}
apply from: "${rootDir}/gradle/versions.gradle"
repositories {
google()
//gradlePluginPortal()
jcenter()
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:${Versions.androidGradle}"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${Versions.kotlin}"
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:${Versions.bintray}"
}
}
//def buildTask = null
//try {
// buildTask = tasks.getByName("build")
//} catch (ex) {}
//
//if (buildTask == null) {
// task build() {
// doLast {
// println("Built")
// }
// }
//}
/**
* Publish install all
*/
task publishAll() {
dependsOn(build)
doLast {
println("All published")
}
}
/**
* Publish install all
*/
task publishAllLocal() {
doLast {
println("All published locally")
}
}
task installAllLocal() {
doLast {
println("All installed locally")
}
}
task installLocal() {
dependsOn publishAllLocal, installAllLocal
}
/**
* Configure all projects
*/
allprojects {currentProject ->
// SET VERSION
currentProject.version = VERSION
buildscript {
apply from: "${rootDir}/gradle/versions.gradle"
}
// PLUGINS
apply plugin: 'idea'
// IF NOT APP THEN APPLY
if (!["example-app","kdux-android"].contains(currentProject.name)) {
apply plugin: 'java'
apply plugin: 'kotlin'
sourceCompatibility = Versions.SOURCE_VERSION
targetCompatibility = Versions.SOURCE_VERSION
} else if (currentProject.name == "kdux-android") {
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
} else {
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
}
// KOTLIN
kotlin {
experimental { coroutines 'enable' }
}
configurations.all {
resolutionStrategy {
exclude group: 'org.jetbrains.kotlin', module: 'kotlin-stdlib-jre7'
exclude group: 'org.jetbrains.kotlin', module: 'kotlin-stdlib-jre8'
exclude group: 'org.jetbrains.kotlin', module: 'kotlin-stdlib-jdk7'
exclude group: 'org.jetbrains.kotlin', module: 'kotlin-stdlib-jdk7'
force(
"org.jetbrains.kotlin:kotlin-stdlib:${Versions.kotlin}",
"org.jetbrains.kotlin:kotlin-stdlib-jre7:${Versions.kotlin}",
"org.jetbrains.kotlin:kotlin-stdlib-jre8:${Versions.kotlin}",
"org.jetbrains.kotlin:kotlin-stdlib-jdk8:${Versions.kotlin}",
"org.jetbrains.kotlin:kotlin-reflect:${Versions.kotlin}",
"androidx.test:core:${Versions.androidTestCore}",
// AndroidJUnitRunner and JUnit Rules
"androidx.test:runner:${Versions.androidTest}",
"androidx.test:rules:${Versions.androidTest}",
// Assertions
"androidx.test.ext:junit:${Versions.androidTestExt}",
"androidx.test.ext:truth:${Versions.androidTestExt}",
"com.google.truth:truth:${Versions.googleTruth}",
// Espresso dependencies
"androidx.test.espresso:espresso-core:${Versions.androidTestEspresso}",
"androidx.test.espresso:espresso-contrib:${Versions.androidTestEspresso}",
"androidx.test.espresso:espresso-intents:${Versions.androidTestEspresso}",
"androidx.test.espresso:espresso-accessibility:${Versions.androidTestEspresso}",
"androidx.test.espresso:espresso-web:${Versions.androidTestEspresso}",
"androidx.test.espresso.idling:idling-concurrent:${Versions.androidTestEspresso}",
"androidx.test.espresso:espresso-idling-resource:${Versions.androidTestEspresso}"
)
}
}
// PUBLISHING
if (publishProjects.contains(currentProject.name)) {
apply plugin: 'com.jfrog.bintray'
bintray {
user = 'jonglanz'
key = binTrayKey
publications = ['mavenJava']
pkg {
repo = 'oss'
name = currentProject.name
userOrg = 'densebrain'
licenses = ['Apache-2.0']
vcsUrl = 'https://github.com/jglanz/kdux.git'
version {
name = VERSION
released = new Date()
}
}
}
build.dependsOn(build)
publishAll.dependsOn(bintrayUpload)
publishAllLocal.dependsOn(publishToMavenLocal)
installAllLocal.dependsOn(install)
}
// REPOS
repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
implementation(
"org.jetbrains.kotlin:kotlin-stdlib-jdk8:${Versions.kotlin}",
"org.jetbrains.kotlin:kotlin-stdlib:${Versions.kotlin}",
"org.jetbrains.kotlin:kotlin-reflect:${Versions.kotlin}",
"io.arrow-kt:arrow-core:${Versions.arrow}",
"io.arrow-kt:arrow-typeclasses:${Versions.arrow}",
"io.arrow-kt:arrow-data:${Versions.arrow}",
"io.arrow-kt:arrow-syntax:${Versions.arrow}",
"io.arrow-kt:arrow-effects-kotlinx-coroutines:${Versions.arrow}",
"org.slf4j:slf4j-api:${Versions.slf4j}"
)
//testImplementation("junit:junit:${junitVersion}")
}
}