This repository was archived by the owner on Feb 8, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathbuild.gradle
More file actions
154 lines (135 loc) · 4.69 KB
/
build.gradle
File metadata and controls
154 lines (135 loc) · 4.69 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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
/*
Copyright 2015 Battams, Derek
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
plugins {
id 'java'
id 'eclipse'
id 'maven-publish'
id 'net.nemerosa.versioning' version '1.3.0'
id 'com.jfrog.bintray' version '1.1'
id 'com.jfrog.artifactory' version '3.0.1'
}
versioning {
releaseMode = 'snapshot'
}
versionFile {
def props = new File(sourceSets.main.resources.srcDirs[0], 'sdjson-api-versioning.properties')
outputs.file props
outputs.upToDateWhen { false }
file = props
}
group = 'org.schedulesdirect'
version = versioning.info.display
sourceCompatibility = '1.7'
repositories {
mavenCentral()
}
dependencies {
compile 'commons-logging:commons-logging:1.1.1'
compile 'org.json:json:20140107'
compile('com.fasterxml.jackson.datatype:jackson-datatype-json-org:2.5.1') {
exclude(group: 'org.apache.geronimo.bundles', module: 'json')
}
compile 'commons-io:commons-io:1.4'
compile 'commons-codec:commons-codec:1.3'
compile 'org.apache.httpcomponents:fluent-hc:4.2.1'
testCompile 'log4j:log4j:1.2.17'
testCompile 'org.powermock:powermock-module-junit4:1.5.4'
testCompile 'org.powermock:powermock-api-mockito:1.5.4'
}
task releaseSanityChecks << {
assert System.getProperty('bintray.user')
assert System.getProperty('bintray.key')
assert versioning.info.branch.startsWith('release/')
assert !versioning.info.display.endsWith('-SNAPSHOT')
assert !versioning.info.display.contains('-dirty')
}
task snapshotSanityChecks << {
assert System.getProperty('bintray.user')
assert System.getProperty('bintray.key')
assert versioning.info.branch.startsWith('release/')
assert versioning.info.display.endsWith('-SNAPSHOT')
assert !versioning.info.display.contains('-dirty')
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives sourcesJar, javadocJar
}
publishing {
publications {
mavenGoodies(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
// Hopefully, some day this xml hack can be removed
pom.withXml {
asNode().dependencies.'*'.findAll {
it.scope.text() == 'runtime' && project.configurations.compile.allDependencies.find { dep ->
dep.name == it.artifactId.text()
}
}.each { it.scope*.value = 'compile' }
}
}
}
}
artifactory {
contextUrl = 'https://oss.jfrog.org' //The base Artifactory URL if not overridden by the publisher/resolver
publish {
//A closure defining publishing information
repository {
repoKey = 'oss-snapshot-local' //The Artifactory repository key to publish to
username = System.getProperty('bintray.user') //The publisher user name
password = System.getProperty('bintray.key') //The publisher password
}
defaults {
//This closure defines defaults for all 'artifactoryPublish' tasks of all projects the plugin is applied to
publications ('mavenGoodies') //Optional list of publications (names or objects) to publish.
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).
}
}
}
bintray {
user = System.getProperty('bintray.user')
key = System.getProperty('bintray.key')
publications = ['mavenGoodies']
publish = false
pkg {
repo = 'maven'
name = 'sdjson-api'
desc = 'A Java client implementation of the Schedules Direct JSON data service.'
websiteUrl = 'https://github.com/Slugger/sdjson-api'
issueTrackerUrl = 'https://github.com/Slugger/sdjson-api/issues'
vcsUrl = 'https://github.com/Slugger/sdjson-api.git'
licenses = ['Apache-2.0']
labels = ['tv', 'epg', 'json', 'schedulesdirect']
attributes= ['plat': ['java']]
publicDownloadNumbers = false
version {
name = project.version
desc = 'Initial support for Schedules Direct API 20141201.'
//vcsTag = '1.3.0'
}
}
}
compileJava.dependsOn versionFile
bintrayUpload.dependsOn releaseSanityChecks
artifactoryPublish.dependsOn snapshotSanityChecks