-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
204 lines (170 loc) · 4.51 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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
buildscript {
repositories {
maven {
url "http://repo.jfrog.org/artifactory/gradle"
}
mavenLocal()
jcenter()
dependencies {
classpath(group: 'org.jfrog.buildinfo', name: 'build-info-extractor-gradle', version: '3.0.1')
}
}
}
plugins {
id "com.jfrog.artifactory" version "3.0.1"
//id "com.jfrog.artifactory-upload" version "3.0.1"
id 'osgi'
id 'maven'
}
//import java.text.DateFormat
//import java.text.SimpleDateFormat
apply from: 'version.gradle'
def globalVersion = new Version(currentVersion)
// All projects under this project folder will have the group and version below.
allprojects {
apply plugin: 'com.jfrog.artifactory-upload'
group = 'pnnl.goss'
version = globalVersion
status = version.status
configure(subprojects.findAll { new File(it.projectDir, 'src').directory }) {
apply plugin: "osgi"
apply plugin: 'groovy'
}
// repositories {
// mavenLocal()
// mavenCentral()
// jcenter()
// }
// repositories {
// maven {
// url 'http://maven.pnnl.gov/artifactory/plugins-release'
// credentials {
// username = "${artifactory_user}"
// password = "${artifactory_password}"
// }
// }
//
// }
}
task wrapper (type: Wrapper) {
gradleVersion = '2.1'
}
artifactoryPublish.skip = true
subprojects {
apply plugin: 'maven'
apply plugin: 'maven-publish'
sourceCompatibility = '1.7'
// buildscript {
// repositories {
// maven {
// url 'http://maven.pnnl.gov/artifactory/plugins-release'
// credentials {
// username = "${artifactory_user}"
// password = "${artifactory_password}"
// }
// }
// jcenter()
//
// }
// }
//apply plugin: "osgi"
//apply plugin: "maven"
//apply plugin: 'artifactory-publish'
if (project.plugins.hasPlugin('java')) {
println project.name
jar {
// Include source with the jar
from sourceSets.main.allSource
manifest {
instruction 'Bundle-Vendor', 'PNNL'
instruction 'Bundle-DocURL', 'https://github.com/GridOPTICS/GOSS'
[
compileJava,
compileTestJava,
javadoc
]*.options*.encoding = 'UTF-8'
}
}
configurations {
published
}
task sourceJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
// task generateStuffJavaDocs(type: Javadoc) {
// println "Generating javadocs"
// source = sourceSets.main.allJava
// classpath = configurations.compile
// options.memberLevel = JavadocMemberLevel.PUBLIC
// excludes = ['*OWLMicroReasonerFactory.java']
// }
artifactoryPublish {
dependsOn sourceJar, javadocJar
}
artifacts {
published sourceJar
published javadocJar
}
}
dependencies {
compile 'org.codehaus.groovy:groovy-all:2.3.3'
// Logging should be available to all projects
compile "org.slf4j:slf4j-api:1.7.5"
compile "org.slf4j:slf4j-log4j12:1.7.5"
// ipojo annotations for service registry/retrieval.
compile 'org.apache.felix:org.apache.felix.ipojo.annotations:1.11.2'
// For testing we are going to use these ubiquitous
testCompile "junit:junit:4.11"
testCompile "org.mockito:mockito-core:1.+"
testCompile 'org.spockframework:spock-core:0.7-groovy-2.0'
// Both client and server need access to the following dependencies
//compile 'com.impetus.kundera.core:kundera-core:2.13.1'
//compile "pnnl.goss:goss-core:0.1.6-SNAPSHOT"
}
}
configurations {
published
}
artifactory {
def myContextUrl = pnnl_artifactory_contextUrl
def myRepoKey = pnnl_artifactory_publish_key
def myContextUser = pnnl_artifactory_user
def myContextPassword = pnnl_artifactory_password
if (project.hasProperty('remote')){
myRepoKey = artifactory_publish_key
myContextUrl = artifactory_contextUrl
myContextUser = artifactory_user
myContextPassword = artifactory_password
}
contextUrl = myContextUrl //The base Artifactory URL if not overridden by the publisher/resolver
publish {
repository {
repoKey = myRepoKey
//repoKey = 'oss-local-snapshot'
username = "${myContextUser}"
password = "${myContextPassword}"
maven = true
}
defaults {
publishConfigs('archives', 'published')
properties = ['build.status': "$it.project.status".toString()]
//publications ('mavenJava')
publishBuildInfo = true
publishArtifacts = true
publishPom = true
}
}
resolve {
repository {
repoKey = 'libs-release'
username = "${myContextUser}"
password = "${myContextPassword}"
maven = true
}
}
}