-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
135 lines (121 loc) · 4.05 KB
/
build.gradle
File metadata and controls
135 lines (121 loc) · 4.05 KB
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
buildscript {
repositories {
mavenCentral()
maven {
url "https://oss.sonatype.org/content/groups/public"
}
}
dependencies {
classpath 'com.adaptc.gradle:moab-sdk:0.14'
classpath 'com.adaptc.gradle:nexus-workflow:0.8'
classpath 'net.saliman:gradle-cobertura-plugin:2.2.7'
}
// check for updates every build
configurations.all {
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}
}
plugins {
id "com.dorongold.task-tree" version "1.3.1"
}
apply plugin: com.adaptc.gradle.moabsdk.plugins.MoabSdkInitPlugin
apply plugin: net.saliman.gradle.plugin.cobertura.CoberturaPlugin
apply plugin:'eclipse'
apply plugin:com.adaptc.gradle.nexusworkflow.NexusWorkflowPlugin
configurations.all {
resolutionStrategy.cacheChangingModulesFor(0, 'seconds')
}
subprojects { proj ->
group = "com.adaptc.mws.plugins"
apply plugin:'signing'
apply plugin:'eclipse'
configurations.all {
resolutionStrategy.cacheChangingModulesFor(0, 'seconds')
}
task assignOrderNumber(dependsOn:"loadPluginProject") << {
// Replace version snapshot with order number (date of last commit)
if (proj.version.contains("-SNAPSHOT")) {
def orderNumber = "git log --pretty=format:%ct -1".execute().in.text.trim()
proj.version = proj.version.replace("-SNAPSHOT", "-" + orderNumber)
File projectFile = moabSdk.pluginProject.projectFile
projectFile.write(projectFile.getText("UTF-8").readLines().collect {
if (it.contains("version") && it.contains("-SNAPSHOT"))
return it.replace("-SNAPSHOT", "-" + orderNumber) + "\n"
return it + "\n"
}.join())
}
}
/*
* Deployment and JAR files
*/
jar.doLast {
ant.jar(destfile:archivePath, update:true) {
delegate.manifest {
attribute(name: "Built-By", value: System.properties['user.name'])
attribute(name: "Created-By",
value: System.properties['java.vm.version'] + " (" + System.properties['java.vm.vendor'] + ")")
attribute(name: "Implementation-Title", value: moabSdk.pluginProject.title)
attribute(name: "Implementation-Version", value: proj.version)
attribute(name: "Implementation-Vendor", value: moabSdk.pluginProject.author ?: "-")
attribute(name: "Implementation-Build", value: System.env["BUILD_NUMBER"] ?: "0")
attribute(name: "Implementation-Build-Date", value: System.env["BUILD_ID"] ?: new Date())
attribute(name: "Implementation-Revision", value: System.env["GIT_COMMIT"] ?: "none")
}
}
}
artifacts {
archives jar
archives sourcesJar
archives javadocJar
}
signing {
required { !proj.version.endsWith("-SNAPSHOT") }
sign configurations.archives
}
uploadArchives {
repositories.mavenDeployer {
beforeDeployment { deployment -> signing.signPom(deployment) }
configuration = configurations.deployerJars
repository(url:rootProject."oss-releases.url") {
authentication(userName:rootProject."oss-releases.username", password:rootProject."oss-releases.password")
}
snapshotRepository(url:rootProject."oss-snapshots.url") {
authentication(userName:rootProject."oss-snapshots.username", password:rootProject."oss-snapshots.password")
}
pom {
project {
artifactId(proj.'projects.artifactId.prefix' + proj.name)
name moabSdk.pluginProject.title
description moabSdk.pluginProject.description
licenses {
license {
name "The Apache Software License, Version 2.0"
url "http://www.apache.org/licenses/LICENSE-2.0.txt"
distribution "repo"
}
}
url "http://github.com/adaptivecomputing/plugins-mws"
scm {
connection "scm:git:https://github.com/adaptivecomputing/plugins-mws.git"
developerConnection "scm:git:https://github.com/adaptivecomputing/plugins-mws.git"
url "http://github.com/adaptivecomputing/plugins-mws"
}
developers {
developer {
id "ace"
name "Adaptive Computing"
email "info@adaptivecomputing.com"
organization = "Adaptive Computing, Inc."
organizationUrl "http://adaptivecomputing.com"
timezone "-7"
}
}
}
}
}
}
}
wrapper {
gradleVersion = '2.3'
jarFile = 'wrapper/wrapper.jar'
}