forked from pact-foundation/pact-jvm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
173 lines (145 loc) · 5.26 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
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'org.apache.commons:commons-lang3:3.3.2'
}
}
subprojects {
def scalaVersionLookup = [
'2.10': '2.10.4',
'2.11': '2.11.2'
]
def m = project.name =~ /.*_(2\.1\d)(_0\.\d+)?/
if (m.matches()) {
project.ext {
scalaVersion = m.group(1)
scalaFullVersion = scalaVersionLookup[m.group(1)]
sbtVersion = '0.13.5'
}
buildDir = new File(projectDir, "build/" + project.scalaVersion)
}
apply plugin: 'java'
apply plugin: 'scala'
apply plugin: 'groovy'
apply plugin: 'maven'
apply plugin: 'signing'
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
if (project.hasProperty('scalaVersion')) {
compile 'org.slf4j:slf4j-api:1.7.5', "org.scala-lang:scala-library:${project.scalaFullVersion}",
"com.typesafe.scala-logging:scala-logging-slf4j_${project.scalaVersion}:2.1.2",
"net.databinder:unfiltered-netty-server_${project.scalaVersion}:0.8.2",
"net.databinder.dispatch:dispatch-core_${project.scalaVersion}:0.11.0",
"org.json4s:json4s-native_${project.scalaVersion}:3.2.10",
"org.json4s:json4s-jackson_${project.scalaVersion}:3.2.10"
testCompile "org.specs2:specs2_${project.scalaVersion}:2.3.13"
if (project.scalaVersion == '2.11') {
compile "org.scala-lang.modules:scala-xml_2.11:1.0.2"
}
}
testCompile 'junit:junit:4.11', 'org.mockito:mockito-all:1.9.5'
}
group = 'au.com.dius'
version = '2.1.2'
targetCompatibility = '1.6'
sourceCompatibility = '1.6'
tasks.withType(ScalaCompile) {
scalaCompileOptions.useCompileDaemon = false
scalaCompileOptions.useAnt = false
scalaCompileOptions.additionalParameters = ['-target:jvm-1.6']
}
jar {
manifest.attributes provider: 'gradle',
'Implementation-Title': project.name, 'Implementation-Version': version,
'Implementation-Vendor': project.group, 'Implementation-Vendor-Id': project.group,
'Specification-Vendor': project.group,
'Specification-Title': project.name,
'Specification-Version': version
}
task javadocJar(type: Jar, dependsOn: [javadoc, scaladoc, groovydoc]) {
classifier = 'javadoc'
from javadoc.destinationDir, scaladoc.destinationDir, groovydoc.destinationDir
}
task sourceJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
artifacts {
archives javadocJar
archives sourceJar
}
def pomCustomisation = {
name project.name
description new File(projectDir, 'README.md').text
url 'https://github.com/DiUS/pact-jvm'
licenses {
license {
name 'Apache 2'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution 'repo'
}
}
scm {
url 'https://github.com/DiUS/pact-jvm'
connection 'https://github.com/DiUS/pact-jvm.git'
}
developers {
developer {
id 'thetrav'
name 'Travis Dixon'
email 'the.trav@gmail.com'
}
developer {
id 'rholshausen'
name 'Ronald Holshausen'
email 'rholshausen@dius.com.au'
}
developer {
id 'kenbot'
name 'Ken Scambler'
email 'ken.scambler@gmail.com'
}
}
}
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { def deployment -> signing.signPom(deployment) }
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
if (project.hasProperty('sonatypeUsername')) {
authentication(userName: sonatypeUsername, password: sonatypePassword)
}
}
}
}
}
ext.installer = install.repositories.mavenInstaller
ext.deployer = uploadArchives.repositories.mavenDeployer
installer.pom.project(pomCustomisation)
deployer.pom.project(pomCustomisation)
signing {
required { gradle.taskGraph.hasTask("uploadArchives") }
sign configurations.archives
}
}
task build_2_10(description: 'Build all artifacts against Scala 2.10')
task build_2_11(description: 'Build all artifacts against Scala 2.11')
task install_2_10(description: 'Install all artifacts built against Scala 2.10')
task install_2_11(description: 'Install all artifacts built against Scala 2.11')
build_2_10.dependsOn {
subprojects.findAll { project -> project.name.endsWith('_2.10') }.collect { it.name + ':build' }
}
build_2_11.dependsOn {
subprojects.findAll { project -> project.name.endsWith('_2.11') }.collect { it.name + ':build' }
}
install_2_10.dependsOn {
subprojects.findAll { project -> project.name.endsWith('_2.10') }.collect { it.name + ':install' }
}
install_2_11.dependsOn {
subprojects.findAll { project -> project.name.endsWith('_2.11') }.collect { it.name + ':install' }
}