forked from BT-OpenSource/bt-openlink-java
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
160 lines (142 loc) · 6.96 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
plugins {
id "org.sonarqube" version "2.6"
id "com.jfrog.bintray" version "1.8.0"
id "com.jfrog.artifactory" version "4.5.4"
}
allprojects {
group = 'com.bt.openlink'
version = '0.0.5-SNAPSHOT'
}
subprojects {
apply plugin: 'maven-publish'
apply plugin: 'maven'
apply plugin: 'java'
apply plugin: 'jacoco'
apply plugin: 'com.jfrog.bintray'
apply plugin: 'com.jfrog.artifactory'
repositories {
jcenter()
}
def snapshotBuild = project.version.toUpperCase().contains('SNAPSHOT')
def releaseBuild = !snapshotBuild
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceSets {
// Make the compileOnly dependencies available when compiling/running tests
test.compileClasspath += configurations.compileOnly
test.runtimeClasspath += configurations.compileOnly
}
javadoc {
source = sourceSets.main.allSource
classpath = configurations.compile + configurations.compileOnly
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
bintray {
user = System.getenv('BINTRAY_USER')
key = System.getenv('BINTRAY_KEY')
publications = ['Maven']
dryRun = false
publish = false
override = false
pkg {
repo = 'bt-openlink'
name = 'java-bt-openlink'
// userOrg = 'myorg' //An optional organization name when the repo belongs to one of the user's orgs
// desc = 'what a fantastic package indeed!'
websiteUrl = 'https://github.com/BT-OpenSource/bt-openlink-java'
issueTrackerUrl = 'https://github.com/BT-OpenSource/bt-openlink-java/issues'
vcsUrl = 'https://github.com/BT-OpenSource/bt-openlink-java.git'
licenses = ['MIT']
labels = ['Openlink']
publicDownloadNumbers = true
// attributes= ['a': ['ay1', 'ay2'], 'b': ['bee'], c: 'cee'] //Optional package-level attributes
githubRepo = 'BT-OpenSource/bt-openlink-java' //Optional Github repository
githubReleaseNotesFile = 'README.md' //Optional Github readme file
// version {
// name = '1.0-Final'
// }
}
}
publishing {
publications {
Maven(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
pom.withXml {
def root = asNode()
root.appendNode('name', project.name)
root.appendNode('description', project.ext.description)
root.appendNode('url', 'https://github.com/BT-OpenSource/bt-openlink-java')
}
}
}
}
bintrayUpload.onlyIf { releaseBuild }
artifactory {
contextUrl = 'https://oss.jfrog.org/oss-snapshot-local'
publish {
repository {
repoKey = project.group
username = System.getenv('BINTRAY_USER')
password = System.getenv('BINTRAY_KEY')
}
defaults {
//List of Gradle Publications (names or objects) from which to collect the list of artifacts to be deployed to Artifactory.
// publications('ivyJava', 'mavenJava', 'foo')
////List of Gradle Configurations (names or objects) from which to collect the list of artifacts to be deployed to Artifactory.
publishConfigs('archives')
//properties = ['qa.level': 'basic', 'q.os': 'win32, deb, osx']
//Optional map of properties to attach to all published artifacts
/*
The properties closure in the "defaults" task uses the following syntax:
properties {
publicationName 'group:module:version:classifier@type', key1:'value1', key2:'value2', ...
}
publicationName: A valid name for a publication of the project. You can use all to apply the properties to all publications.
group:module:version:classifier@type: A filter that specifies the artifacts to which properties should be attached.
The filter may contain wildcards: * for all characters or ? for a single character.
key:'value': A list of key/value properties that will be attached to to the published artifacts matching the filter.
*/
// properties {
// //Optional closure to attach properties to artifacts based on a list of artifact patterns per project publication
// foo '*:*:*:*@*', platform: 'linux', 'win64'
// //The property platform=linux,win64 will be set on all artifacts in foo publication
// mavenJava 'org.jfrog:*:*:*@*', key1: 'val1'
// //The property key1=val1 will be set on all artifacts part of the mavenJava publication and with group org.jfrog
// all 'org.jfrog:shared:1.?:*@*', key2: 'val2', key3: 'val3'
// //The properties key2 and key3 will be set on all published artifacts (all publications) with group:artifact:version
// //equal to org.jfrog:shared:1.?
// }
publishBuildInfo = true //Publish build-info to Artifactory (true by default)
publishArtifacts = true //Publish artifacts to Artifactory (true by default)
publishPom = true //Publish generated POM files to Artifactory (true by default).
publishIvy = true //Publish generated Ivy descriptor files to Artifactory (true by default).
}
}
// resolve {
// contextUrl = 'http://repo.myorg.com/artifactory' //The base Artifactory URL for the resolver
// repository {
// +repoKey = 'libs-releases' //The Artifactory (preferably virtual) repository key to resolve from
// username = 'resolver' //Optional resolver user name (leave out to use anonymous resolution)
// password = 'resolverPaS*' //The resolver password
// maven = true //Resolve Maven-style artifacts and descriptors (true by default)
// }
// }
// Redefine basic properties of the build info object
// clientConfig.setIncludeEnvVars(true)
// clientConfig.setEnvVarsExcludePatterns('*password*,*secret*,*KEY*')
// clientConfig.setEnvVarsIncludePatterns('*not-secret*')
// clientConfig.info.addEnvironmentProperty('test.adding.dynVar', new java.util.Date().toString())
// clientConfig.info.setBuildName('new-strange-name')
// clientConfig.info.setBuildNumber('' + new java.util.Random(System.currentTimeMillis()).nextInt(20000))
}
artifactoryPublish.onlyIf { snapshotBuild }
}