forked from arrow-kt/arrow
/
build.gradle
162 lines (136 loc) · 4.9 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
/*
* Copyright (C) 2017 The Arrow Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
buildscript {
ext {
// Constants
gradleVersion = '4.4.1'
gradleVersionsPluginVersion = '0.17.0'
javaVersion = JavaVersion.VERSION_1_7
kotlinTestVersion = '2.0.7'
kotlinVersion = '1.2.31'
daggerVersion = '2.5'
kotlinxCoroutinesVersion = '0.22.5'
kotlinxCollectionsImmutableVersion = '0.1'
}
repositories {
jcenter()
maven { url 'https://oss.jfrog.org/oss-snapshot-local/' }
maven { url 'https://jitpack.io' }
maven { url "http://dl.bintray.com/kotlin/kotlin-dev" }
maven { url "https://dl.bintray.com/jetbrains/markdown/" }
maven { url "https://dl.bintray.com/arrow-kt/arrow-kt/" }
}
dependencies {
classpath "com.github.ben-manes:gradle-versions-plugin:$gradleVersionsPluginVersion"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.0'
classpath 'io.arrow-kt:ank-gradle-plugin:0.7.0-20180405.164002-2'
classpath 'org.ajoberstar:gradle-git-publish:0.3.2'
}
}
apply from: 'detekt.gradle.kts'
allprojects {
repositories {
jcenter()
maven { url 'https://oss.jfrog.org/oss-snapshot-local/' }
maven { url 'https://kotlin.bintray.com/kotlinx' }
maven { url "http://dl.bintray.com/kotlin/kotlin-dev" }
maven { url "http://dl.bintray.com/arrow-kt/arrow-kt" }
maven { url "https://dl.bintray.com/jetbrains/markdown/" }
maven { url 'https://jitpack.io' }
}
}
subprojects { project ->
group = GROUP
version = VERSION_NAME
apply plugin: 'kotlin'
apply plugin: 'jacoco'
archivesBaseName = POM_ARTIFACT_ID
jacoco {
toolVersion '0.8.1'
}
task codeCoverageReport(type: JacocoReport) {
reports {
xml.enabled true
xml.destination file("${buildDir}/reports/jacoco/report.xml")
html.enabled true
csv.enabled false
}
classDirectories = fileTree(
dir: 'build/classes/kotlin/main',
)
sourceDirectories = files('src/main/kotlin')
executionData fileTree(project.rootDir.absolutePath).include("**/build/jacoco/*.exec")
}
apply plugin: 'com.jfrog.bintray'
bintray {
publish = true
user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER')
key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_API_KEY')
configurations = ['archives']
pkg {
repo = 'arrow-kt'
name = project.name
userOrg = POM_DEVELOPER_ID
licenses = ['Apache-2.0']
vcsUrl = 'https://github.com/arrow-kt/arrow.git'
}
}
compileKotlin.kotlinOptions.freeCompilerArgs += ["-Xskip-runtime-version-check"]
test {
testLogging {
events "passed", "skipped", "failed", "standardOut", "standardError"
}
}
tasks.withType(Test) {
maxParallelForks = Runtime.runtime.availableProcessors()
}
build.dependsOn ':detekt'
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
}
configurations {
buildableProjects
}
dependencies {
buildableProjects(subprojects)
}
tasks.create('repl') {
final classpathConfig = rootProject.buildscript.configurations.getByName("classpath")
final buildableProjectsConfig = configurations.getByName('buildableProjects')
dependsOn(buildableProjectsConfig)
doFirst {
javaexec {
classpath(
classpathConfig.resolvedConfiguration.resolvedArtifacts.findAll {
it.moduleVersion.id.group == 'org.jetbrains.kotlin'
}.collect {
it.file
}
)
main = "org.jetbrains.kotlin.cli.jvm.K2JVMCompiler"
standardInput = System.in
args("-cp", buildableProjectsConfig.files.join(':'))
}
}
}
task wrapper(type: Wrapper) {
distributionUrl = "https://services.gradle.org/distributions/gradle-${project.ext.gradleVersion}-all.zip"
}
apply plugin: 'com.github.ben-manes.versions'
configurations.all {
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}