-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathbuild.gradle
130 lines (113 loc) · 4.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
apply from: file('scala.gradle')
allprojects {
apply plugin: 'scala'
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'signing'
repositories {
mavenCentral()
}
archivesBaseName = "scala-etcd_${baseScalaVersion}"
}
dependencies {
if (scalaVersion.startsWith('2.11')) {
compile 'org.scala-lang:scala-library:2.11.5'
compile 'io.spray:spray-client_2.11:1.3.2'
compile 'io.spray:spray-json_2.11:1.3.1'
compile 'com.typesafe.akka:akka-actor_2.11:2.3.6'
} else if (scalaVersion.startsWith('2.10')) {
compile 'org.scala-lang:scala-library:2.10.4'
compile 'io.spray:spray-client_2.10:1.3.2'
compile 'io.spray:spray-json_2.10:1.3.1'
compile 'com.typesafe.akka:akka-actor_2.10:2.3.6'
}
}
for (sv in ['2_10_4', '2_11_5']) {
String svInDot = sv.replaceAll("_", ".")
tasks.create(name: "jar_core_${sv}", type: GradleBuild) {
buildFile = './build.gradle'
tasks = ['jar']
startParameter.projectProperties = [scalaVersion: "${svInDot}"]
}
tasks.create(name: "test_core_${sv}", type: GradleBuild) {
buildFile = './build.gradle'
tasks = ['test']
startParameter.projectProperties = [scalaVersion: "${svInDot}"]
}
tasks.create(name: "srcJar_${sv}", type: GradleBuild) {
buildFile = './build.gradle'
tasks = ['srcJar']
startParameter.projectProperties = [scalaVersion: "${svInDot}"]
}
tasks.create(name: "docsJar_${sv}", type: GradleBuild) {
buildFile = './build.gradle'
tasks = ['docsJar']
startParameter.projectProperties = [scalaVersion: "${svInDot}"]
}
tasks.create(name: "uploadCoreArchives_${sv}", type: GradleBuild) {
buildFile = './build.gradle'
tasks = ['uploadArchives']
startParameter.projectProperties = [scalaVersion: "${svInDot}"]
}
}
tasks.create(name: "jarAll", dependsOn: ['jar_core_2_10_4', 'jar_core_2_11_5']) {}
tasks.create(name: "srcJarAll", dependsOn: ['srcJar_2_10_4', 'srcJar_2_11_5']) {}
tasks.create(name: "docsJarAll", dependsOn: ['docsJar_2_10_4', 'docsJar_2_11_5']) {}
tasks.create(name: "testAll", dependsOn: ['test_core_2_10_4', 'test_core_2_11_5']) {}
tasks.create(name: "uploadArchivesAll", dependsOn: ['uploadCoreArchives_2_10_4', 'uploadCoreArchives_2_11_5']) {}
task srcJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.java
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier 'javadoc'
from javadoc.destinationDir
}
task docsJar(dependsOn: javadocJar)
artifacts {
archives jar
archives javadocJar
archives srcJar
}
if (project.hasProperty('release')) {
println "Signing jars"
signing {
required { gradle.taskGraph.hasTask("uploadArchives") }
sign configurations.archives
}
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: mavenUsername, password: mavenPassword)
}
pom.artifactId = "${archivesBaseName}"
pom.project {
name 'scala-etcd'
packaging 'jar'
description 'native scala client for etcd'
url 'https://github.com/nikore/scala-etcd'
scm {
url 'scm:git@github.com:nikore/scala-etcd.git'
connection 'scm:git@github.com:nikore/scala-etcd.git'
developerConnection 'scm:git@github.com:nikore/scala-etcd.git'
}
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution 'repo'
}
}
developers {
developer {
id 'nikore'
name 'Matt Christiansen'
}
}
}
}
}
}
}