-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
112 lines (103 loc) · 3.34 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
buildscript {
repositories {
maven {
if ('true'.equals(System.getProperty("runExternally"))) {
url "https://plugins.gradle.org/m2/"
} else {
url 'http://nexus.standardbank.co.za:8090/nexus/content/groups/public/'
}
}
}
dependencies {
classpath 'org.hibernate.build.gradle:gradle-maven-publish-auth:2.0.1'
}
}
group='com.sbg.bdd'
version='0.2.14'
subprojects {
apply plugin: 'java'
apply plugin: 'groovy'
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'maven-publish-auth'
ext {
GROOVY_VERSION = '2.4.5'
CUKES_VERSION = '1.2.5'
WIREMOCK_VERSION = '2.11.0'
SCOPED_WIREMOCK_VERSION = '0.2.8'
}
repositories {
if ('true'.equals(System.getProperty("runExternally"))) {
mavenLocal()
maven { url "http://repo.maven.apache.org/maven2" }
} else {
maven {
url 'http://nexus.standardbank.co.za:8090/nexus/content/groups/public/'
}
}
}
dependencies {
testCompile 'junit:junit:4.12'
testCompile "org.codehaus.groovy:groovy-all:$GROOVY_VERSION"
testCompile("org.spockframework:spock-core:0.7-groovy-2.0") {
exclude group: "junit"
exclude module: "groovy-all"
}
}
sourceCompatibility = 1.7
targetCompatibility = 1.7
task packageSources(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
artifacts.archives packageSources
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives sourcesJar, javadocJar
}
publishing {
repositories {
maven {
name 'releases'
url 'http://nexus.standardbank.co.za:8090/nexus/content/repositories/releases/'
}
}
publications {
mavenJava(MavenPublication) {
println "Publishing $project.name:$project.group:$rootProject.version"
groupId "$rootProject.group"
artifactId "$project.name"
version "$rootProject.version"
from components.java
artifact sourcesJar {
classifier "sources"
}
artifact javadocJar {
classifier "javadoc"
}
pom.withXml {
asNode().children().last() + {
resolveStrategy = Closure.DELEGATE_FIRST
name "$rootProject.name"
description "$rootProject.description"
}
// Preserve compile-scope dependencies
asNode().dependencies.'*'.findAll() {
it.scope.text() == 'runtime' && project.configurations.compile.allDependencies.find { dep ->
dep.name == it.artifactId.text()
}
}.each() {
it.scope*.value = 'compile'
}
}
}
}
}
}