forked from JetBrains/teamcity-rest-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
123 lines (107 loc) · 3.5 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
plugins {
id "org.jetbrains.kotlin.jvm" version "1.3.71"
}
allprojects {
apply plugin: 'java'
apply plugin: 'kotlin'
repositories {
mavenCentral()
}
}
configure(project(':teamcity-rest-client-api')) {
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
}
}
configure(project(':teamcity-rest-client-impl')) {
dependencies {
compile 'com.squareup.retrofit:retrofit:1.9.0'
compile "com.squareup.okhttp3:okhttp:4.7.2"
compile 'com.jakewharton.retrofit:retrofit1-okhttp3-client:1.1.0'
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
compile 'org.slf4j:slf4j-api:1.7.12'
testCompile 'junit:junit:4.12'
testCompile 'org.assertj:assertj-core:3.12.2'
testCompile 'org.slf4j:slf4j-log4j12:1.7.12'
testCompile "org.jetbrains.kotlin:kotlin-test"
testCompile "org.jetbrains.kotlin:kotlin-reflect"
compile project(':teamcity-rest-client-api')
}
}
dependencies {
compile project(':teamcity-rest-client-api')
compile project(':teamcity-rest-client-impl')
}
group = 'org.jetbrains.teamcity'
if (hasProperty("buildNumber")) {
version buildNumber
println "##teamcity[buildNumber '$version']"
} else if (hasProperty("buildCounter")) {
version projectVersion + "." + buildCounter
println "##teamcity[buildNumber '$version']"
} else {
version projectVersion + '.9999-SNAPSHOT'
}
apply plugin: 'maven-publish'
task sourceJar(type: Jar) {
subprojects {
from sourceSets.main.kotlin
}
}
task mainJar(type: Jar) {
subprojects {
dependsOn it.classes
}
subprojects {
from it.sourceSets.main.output
}
}
artifacts {
archives sourceJar, mainJar
}
publishing {
publications {
mavenJava(MavenPublication) {
artifact mainJar
artifact sourceJar {
classifier "sources"
}
//the standard components.java doesn't work for multiple artifacts so we need to define dependencies manually
pom.withXml {
def dependenciesNode = asNode().appendNode('dependencies')
rootProject.subprojects { project ->
project.configurations.compile.allDependencies.each {
if (!it.name.startsWith("teamcity-rest-client")) {
def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', it.group)
dependencyNode.appendNode('artifactId', it.name)
dependencyNode.appendNode('version', it.version)
}
}
}
}
repositories {
maven {
url "https://packages.jetbrains.team/maven/p/teamcity-rest-client/teamcity-rest-client"
credentials {
username = System.getenv('SPACE_USER')
password = System.getenv('SPACE_KEY')
}
}
}
}
}
}
subprojects {
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
kotlinOptions { jvmTarget = '1.8' }
}
compileJava {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
}
wrapper {
gradleVersion = '6.1.1'
distributionUrl = "https://cache-redirector.jetbrains.com/services.gradle.org/distributions/gradle-${gradleVersion}-all.zip"
}