-
Notifications
You must be signed in to change notification settings - Fork 10
/
build.gradle
145 lines (122 loc) · 5.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
apply from: 'buildsystem/dependencies.gradle'
buildscript {
apply from: 'buildsystem/dependencies.gradle'
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$versions.kotlin"
classpath "com.android.tools.build:gradle:${versions.android_gradle_plugin}"
classpath "com.getkeepsafe.dexcount:dexcount-gradle-plugin:${versions.dexcount_gradle_plugin}"
// classpath "com.github.dcendents:android-maven-gradle-plugin:2.1"
classpath "org.jetbrains.dokka:dokka-gradle-plugin:$versions.dokka"
}
}
// Top-level build file where you can add configuration options common to all sub-projects/modules.
//COMMON BUILD TOOL AND SDK VERSION FOR ALL MODULES
ext {
// note that if VERSION_NAME ends with '-SNAPSHOT' then the version is considered a snapshot
// VERSION_NAME='3.4.0-SNAPSHOT' //GLOBAL VERSION FOR REDUKS libs
VERSION_NAME='3.4.2' //GLOBAL VERSION FOR REDUKS libs
POM_NAME='Reduks: Reduxjs for Kotlin+Android'
GROUP_MAVEN_PUSH= 'com.github.beyondeye.reduks' //used by maven-push: MAKE SURE THAT THIS MATCHES group DEFINED BELOW IN THIS FILE AND USED BY JITPACK
//TODO: decide when to migrate to 1.8: see https://developer.android.com/studio/write/java8-support.html
sourceCompatibility_ = 1.8 //I want this library to be linkable from android projects JavaVersion.VERSION_1_8
targetCompatibility_ = 1.8 //I want this library to be linkable from android projects JavaVersion.VERSION_1_8
kotlinJvmTarget=1.8
}
allprojects {
//Test Logging
tasks.withType(Test) {
testLogging {
events "started", "passed", "skipped", "failed"
}
}
// disable javadoc for kotlin projects
tasks.withType(Javadoc).all {
enabled = false
}
}
//generic configuration for kotlin subprojects (not used any more: now each subprojects contains its configuration)
configure(subprojects.findAll{it.name =='some-kotlin-module' ||it.name =='some-other-kotlin-module'}) {
apply plugin: 'kotlin'
apply plugin: 'org.jetbrains.dokka'
apply plugin: 'maven-publish'
group = 'com.github.beyondeye.reduks' //required by jitpack
compileKotlin {
sourceCompatibility = sourceCompatibility_ //I want this library to be linkable from android projects
targetCompatibility = targetCompatibility_ //I want this library to be linkable from android projects
kotlinOptions.jvmTarget = kotlinJvmTarget
}
// important to set compileTestKotlin jvmTarget otherwise tests will not run
// see https://kotlinlang.org/docs/gradle-configure-project.html#check-for-jvm-target-compatibility-of-related-compile-tasks
compileTestKotlin {
kotlinOptions.jvmTarget = kotlinJvmTarget
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
test.java.srcDirs += 'src/test/kotlin'
}
dependencies {
implementation libraries.kotlinStdLib
apiElements libraries.kotlinStdLib
testImplementation libraries.junit
testImplementation libraries.assertJ
testImplementation libraries.rxJava
}
}
//generic configuration for pure java subprojects (not used any more: now each subproject contains its configuration)
configure(subprojects.findAll{it.name =='some-pure-java-module'}) {
apply plugin: 'java'
apply plugin: 'maven-publish'
group = 'com.github.beyondeye.reduks' //required by jitpack
sourceCompatibility =sourceCompatibility_
targetCompatibility =targetCompatibility_
dependencies {
testImplementation libraries.junit
testImplementation libraries.assertJ
}
}
//generic configuration for android kotlin subprojects (not used any more: now each subproject contains its configuration)
configure(subprojects.findAll{it.name =='code_fragments' || it.name =='reduks-devtools' || it.name =='reduks-kovenant' || it.name =='reduks-rx'}) {
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'org.jetbrains.dokka' //make sure this is AFTER apply plugin: 'com.android.library'
// apply plugin: 'com.github.dcendents.android-maven'
group = 'com.github.beyondeye.reduks' //required by jitpack
android {
compileSdkVersion versions.compileSdk
// buildToolsVersion androidBuildToolsVersion
defaultConfig {
minSdkVersion versions.minSdk
targetSdkVersion versions.targetSdk
versionCode = 1
versionName VERSION_NAME
}
compileOptions {
sourceCompatibility sourceCompatibility_
targetCompatibility targetCompatibility_
}
//the following would not be needed if we would move kotlin code to src/main/java
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
test.java.srcDirs += 'src/test/kotlin'
}
lintOptions {
abortOnError false
}
}
dependencies {
implementation libraries.kotlinStdLib
//api libraries.kotlinStdLib
testImplementation libraries.junit
testImplementation libraries.assertJ
testImplementation libraries.robolectric
testImplementation libraries.equalsverifier
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}