-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.gradle
130 lines (109 loc) · 3.49 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
buildscript {
apply from: 'gradle/versions.gradle'
repositories {
mavenLocal()
mavenCentral()
jcenter()
maven { url 'https://jetbrains.jfrog.io/jetbrains/spek-snapshots' }
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$versions.jetbrains.kotlin"
classpath "org.junit.platform:junit-platform-gradle-plugin:$versions.junitrunner"
}
}
plugins {
id 'com.github.kt3k.coveralls' version '2.10.1'
id 'com.github.ben-manes.versions' version '0.28.0'
id "com.jfrog.bintray" version "1.8.4"
}
apply plugin: 'jacoco'
apply plugin: 'idea'
idea {
module {
downloadJavadoc = true
downloadSources = true
}
}
project.ext {
artifactGroup = "com.jdiazcano.cfg4k"
artifactVersion = "0.9.5"
}
repositories {
mavenCentral()
}
subprojects { p ->
apply plugin: 'java'
apply plugin: 'kotlin'
apply plugin: 'jacoco'
apply plugin: 'org.junit.platform.gradle.plugin'
apply plugin: "maven-publish"
apply plugin: "com.jfrog.bintray"
sourceCompatibility = 1.8
repositories {
mavenLocal()
mavenCentral()
jcenter()
maven { url 'https://jetbrains.jfrog.io/jetbrains/spek-snapshots' }
}
bintray {
user = 'jdiazcano'
key = System.getenv("BINTRAY_KEY")
publications = ["kotlinPublish"]
//configurations = ["archives"]
publish = true
override = true
pkg {
repo = 'cfg4k'
name = p.name
userOrg = 'jdiazcano'
licenses = ['Apache-2.0']
vcsUrl = 'https://github.com/jdiazcano/cfg4k.git'
publicDownloadNumbers = true
version {
name = project.artifactVersion
desc = 'Cfg4k is a configuration library made for Kotlin in Kotlin!'
released = new Date()
vcsTag = project.artifactVersion
}
}
}
// custom tasks for creating source/javadoc jars
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
// add javadoc/source jar tasks as artifacts
artifacts {
archives sourcesJar, javadocJar
}
publishing {
publications {
kotlinPublish(MavenPublication) {
from components.java
groupId 'com.jdiazcano.cfg4k'
artifactId p.name
version project.artifactVersion
artifact sourcesJar
artifact javadocJar
}
}
}
// Needed because there's something messy with kotlin version numbers and dependencies
configurations.all {
resolutionStrategy {
eachDependency { DependencyResolveDetails details ->
if (details.requested.group == 'org.jetbrains.kotlin') {
details.useVersion "$versions.jetbrains.kotlin"
}
}
}
}
}
def activeSubprojects = subprojects.findAll { it.name.startsWith("cfg4k") }
def subprojectsExecFiles = files( activeSubprojects.collect { "${it.name}/build/jacoco/junitPlatformTest.exec" } )
task publish(dependsOn: activeSubprojects.collect { it.tasks.findByPath("bintrayUpload") }) {}
task publishLocal(dependsOn: activeSubprojects.collect { it.tasks.findByPath("publishToMavenLocal") }) {}