This repository has been archived by the owner on Jul 13, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
/
build.gradle
214 lines (183 loc) · 5.98 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
209
210
211
212
213
214
import org.gradle.plugins.ide.idea.model.IdeaModel
import org.gradle.plugins.ide.idea.model.IdeaProject
buildscript {
repositories {
mavenCentral()
jcenter()
maven {
url 'http://repo.spring.io/plugins-release'
}
maven {
url 'http://oss.sonatype.org/content/repositories/snapshots'
}
/* only during EAP builds
maven {
url 'http://dl.bintray.com/kotlin/kotlin-eap'
}
*/
}
//noinspection GroovyAssignabilityCheck
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$version_kotlin"
classpath "org.springframework.build.gradle:propdeps-plugin:0.0.7"
classpath 'com.bmuschko:gradle-nexus-plugin:2.3.1'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.4'
// one day... classpath "org.jetbrains.dokka:dokka-gradle-plugin:0.1-SNAPSHOT"
}
}
subprojects {
apply plugin: 'propdeps'
apply plugin: 'propdeps-maven'
apply plugin: 'propdeps-idea'
apply plugin: 'java'
apply plugin: 'kotlin'
if (name.endsWith("jdk8")) {
println("Project ${name} set to JDK 8")
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
} else if (name.endsWith("jdk7")) {
println("Project ${name} set to JDK 7")
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
} else if (name.endsWith("jdk6")) {
println("Project ${name} set to JDK 6")
sourceCompatibility = JavaVersion.VERSION_1_6
targetCompatibility = JavaVersion.VERSION_1_6
} else {
println("Project ${name} set to JDK 6 (Default)")
sourceCompatibility = JavaVersion.VERSION_1_6
targetCompatibility = JavaVersion.VERSION_1_6
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
options.incremental = true
options.compilerArgs << '-Xlint:unchecked'
}
IdeaModel idea = project.idea
IdeaProject ideaProject = idea.getProject()
if (ideaProject != null) {
ideaProject.setJdkName(project.targetCompatibility.getName())
ideaProject.setLanguageLevel(project.sourceCompatibility.getName())
if (ideaProject.hasProperty("vcs")) {
ideaProject.setVcs('Git')
}
}
idea.module {
downloadJavadoc = true
downloadSources = true
}
repositories {
mavenCentral()
maven {
url 'http://oss.sonatype.org/content/repositories/snapshots'
}
/** only during EAP builds
maven {
url 'http://dl.bintray.com/kotlin/kotlin-eap'
}
*/
}
dependencies {
provided "org.jetbrains.kotlin:kotlin-stdlib:$version_kotlin"
testCompile "junit:junit:$version_junit"
testCompile "org.jetbrains.kotlin:kotlin-test:$version_kotlin"
testCompile "org.slf4j:slf4j-api:$version_slf4j"
// testCompile "org.jetbrains.kotlin:kotlin-reflect:$version_kotlin"
testRuntime "ch.qos.logback:logback-classic:$version_logback"
}
//noinspection GroovyAssignabilityCheck
configurations.all {
// kill all logging anything else might bring in, all of our projects use slf4j if any
exclude group: "org.slf4j", module: "slf4j-simple"
exclude group: "commons-logging"
exclude group: "log4j"
exclude group: "com.google.code.findbugs"
exclude group: "org.slf4j", module: "slf4j-log4j12"
resolutionStrategy {
cacheDynamicVersionsFor 12, 'hours' // things with wildcard version numbers
cacheChangingModulesFor 0, 'hours'
// things with same version, but content of module changes, i.e. SNAPSHOT
}
}
}
subprojects {
apply plugin: 'com.bmuschko.nexus'
apply plugin: 'com.jfrog.bintray'
def pomOnlyModule = !(new File("${projectDir.toString()}/src/main/kotlin").exists())
if (pomOnlyModule) {
println("Project $name is POM ONLY (has no code of its own)")
}
task jars() {
dependsOn build
}
if (pomOnlyModule) {
artifacts {}
task subRelease() {
dependsOn uploadArchives
}
}
else {
task subRelease() {
dependsOn jars, uploadArchives
}
}
modifyPom {
project {
name 'Injekt for Kotlin'
description 'Dependency injection library for Kotlin.'
url 'https://github.com/kohesive/injekt'
inceptionYear '2015'
scm {
url 'https://github.com/kohesive/injekt'
connection 'scm:https://github.com/kohesive/injekt'
developerConnection 'scm:git@github.com:kohesive/injekt.git'
}
licenses {
license {
name 'MIT'
url 'https://github.com/kohesive/injekt/blob/master/LICENSE'
distribution 'repo'
}
}
developers {
developer {
id 'apatrida'
name 'Jayson Minard'
email 'jayson.minard@gmail.com'
}
}
}
}
nexus {
sign = true
}
bintray {
user = "$bintrayUser"
key = "$bintrayKey"
pkg {
repo = 'kohesive'
name = project.name
licenses = ['MIT']
vcsUrl = 'scm:git:git@github.com:kohesive/injekt.git'
version {
name = project.version
desc = 'n/a'
released = new Date()
}
publicDownloadNumbers = false
configurations = ['archives']
}
publish = true
dryRun = false
}
}
task wrapper(type: Wrapper) {
gradleVersion = "$version_gradle"
}
task jars() {
dependsOn subprojects.jars
}
task release() {
dependsOn subprojects.subRelease
}
defaultTasks 'clean', 'jars'