forked from bintray/bintray-client-java
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
170 lines (148 loc) · 5.62 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
import static java.lang.System.getenv
buildscript {
repositories {
jcenter()
}
dependencies {
classpath(group: 'org.jfrog.buildinfo', name: 'build-info-extractor-gradle', version: '3.0.1')
}
}
allprojects {
apply plugin: 'idea'
apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.artifactory'
group = 'com.jfrog.bintray.client'
artifactory {
contextUrl = 'https://oss.jfrog.org'
resolve {
repository {
repoKey = 'libs-release'
}
}
publish {
repository {
repoKey = 'oss-snapshot-local' //The Artifactory repository key to publish to
username = project.hasProperty('bintrayUser') ? project.bintrayUser : getenv()['BINTRAY_USER']
password = project.hasProperty('bintrayKey') ? project.bintrayKey : getenv()['BINTRAY_KEY']
}
defaults {
publications 'main'
}
}
}
}
artifactoryPublish.skip = true
subprojects() {
apply plugin: 'java'
sourceCompatibility = 1.5
targetCompatibility = 1.5
dependencies {
compile 'joda-time:joda-time:2.3'
}
task sourcesJar(type: Jar) {
from sourceSets.main.allSource
classifier = 'sources'
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
task testResultsZip(type: Zip) {
classifier = 'testreports'
from testReportDir
}
test {
finalizedBy(testResultsZip)
jvmArgs (['-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog',
'-Dorg.apache.commons.logging.simplelog.showdatetime=true',
'-Dorg.apache.commons.logging.simplelog.log.org.apache.http=DEBUG',
'-Dorg.apache.commons.logging.simplelog.log.org.apache.http.wire=ERROR'])
testLogging {
exceptionFormat "full"
events "started", "passed", "skipped", "failed", "standardOut", "standardError"
minGranularity 0
}
}
publishing {
publications {
main(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
if (testResultsZip.archivePath.exists()) {
artifact testResultsZip
}
pom.withXml {
asNode().with {
appendNode('packaging', 'jar')
appendNode('name', 'Bintray Java client')
appendNode('description', 'Java client for working with Bintray')
appendNode('url', 'https://github.com/bintray/bintray-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', 'NoamTenne')
appendNode('name', 'Noam Tenne')
appendNode('email', '[email protected]')
}
appendNode('developer').with {
appendNode('id', 'jbaruch')
appendNode('name', 'Baruch Sadogursky')
appendNode('email', '[email protected]')
}
}
appendNode('scm').with {
appendNode('connection', '[email protected]:JFrogDev/bintray/bintray-client-java.git')
appendNode('developerConnection', '[email protected]:bintray/bintray-client-java.git')
appendNode('url', 'https://github.com/bintray/bintray-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'
}
}
}
}
}
}
project(':bintray-client-java-service') {
apply plugin: 'groovy'
dependencies {
compile project(':bintray-client-java-api')
compile localGroovy()
compile "org.codehaus.gpars:gpars:1.2.1"
compile 'org.codehaus.groovy.modules.http-builder:http-builder:0.7.1'
testCompile("org.spockframework:spock-core:0.7-groovy-2.0") {
exclude module: 'groovy-all'
//localGroovy and spock groovy will probably conflict. Both are 2.x, we're good.
}
testCompile group: 'com.timgroup', name: 'jgravatar', version: '1.0'
}
}
task wrapper(type: Wrapper) {
gradleVersion = '2.1'
}
idea {
project {
jdkName = '1.7'
languageLevel = '1.5'
wildcards += '?*.gradle'
ipr {
withXml { provider ->
def node = provider.asNode()
// Use git
def vcsConfig = node.component.find { it.'@name' == 'VcsDirectoryMappings' }
vcsConfig.mapping[0].'@vcs' = 'Git'
}
}
}
}