forked from jfrog/artifactory-client-java
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
134 lines (115 loc) · 4.4 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
import static java.lang.System.getenv
buildscript {
repositories {
jcenter()
}
dependencies {
classpath(group: 'org.jfrog.buildinfo', name: 'build-info-extractor-gradle', version: '2.2.2')
classpath(group: 'eu.appsatori', name: 'gradle-fatjar-plugin', version: '0.2-rc1')
}
}
allprojects {
apply plugin: 'maven-publish'
apply plugin: 'artifactory-publish'
group = 'org.jfrog.artifactory.client'
version = currentVersion
status = version.endsWith('-SNAPSHOT') ? 'integration' : 'release'
project.tasks.withType(Jar).each {
it.version = currentVersion
}
artifactory {
contextUrl = 'https://oss.jfrog.org'
}
}
artifactoryPublish.skip = true
subprojects {
apply plugin: 'java'
sourceCompatibility = 1.7
targetCompatibility = 1.7
final env = getenv()
artifactory {
contextUrl = 'https://oss.jfrog.org'
resolve {
repository {
repoKey = 'libs-release'
}
}
publish {
repository {
repoKey = 'oss-snapshot-local' //The Artifactory repository key to publish to
//when using oss.jfrog.org the credentials are from Bintray. For local build we expect them to be found in
//~/.gradle/gradle.properties, otherwise to be set in the build server
username = project.hasProperty('bintrayUser') ? project.bintrayUser : getenv()['BINTRAY_USER']
password = project.hasProperty('bintrayKey') ? project.bintrayKey : getenv()['BINTRAY_KEY']
}
defaults {
publications 'main'
}
}
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
// add javadoc/source jar tasks as artifacts
artifacts {
archives sourcesJar, javadocJar, jar
}
test {
useTestNG()
testLogging {
exceptionFormat "full"
events "started", "passed", "skipped", "failed", "standardOut", "standardError"
minGranularity 0
}
}
publishing {
publications {
main(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
pom.withXml {
asNode().with {
appendNode('packaging', 'jar')
appendNode('name', 'artifactory-java-client')
appendNode('description', 'Java client for working with Artifactory')
appendNode('url', 'https://github.com/JFrogDev/artifactory-client-java')
appendNode('licenses').with {
appendNode('license').with {
appendNode('name', 'The Apache Software License, Version 2.0')
appendNode('url', 'http://www.apache.org/licenses/LICENSE-2.0')
}
}
appendNode('developers').with {
appendNode('developer').with {
appendNode('id', 'jbaruch')
appendNode('name', 'Baruch Sadogursky')
appendNode('email', '[email protected]')
}
}
appendNode('scm').with {
appendNode('connection', '[email protected]:JFrogDev/artifactory-client-java.git')
appendNode('developerConnection', '[email protected]:JFrogDev/artifactory-client-java.git')
appendNode('url', 'https://github.com/JFrogDev/artifactory-client-java')
}
}
asNode().dependencies.'*'.findAll() {
it.scope.text() == 'runtime' && project.configurations.compile.allDependencies.find { dep ->
dep.name == it.artifactId.text()
}
}.each() {
it.scope*.value = 'compile'
}
}
}
}
}
}
task wrapper(type: Wrapper) {
gradleVersion = '1.10'
}