forked from moberwasserlechner/jopencage
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
100 lines (81 loc) · 2.98 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
plugins {
id "com.jfrog.bintray" version "1.8.4"
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'maven-publish'
repositories {
jcenter()
}
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
dependencies {
compile ("org.slf4j:slf4j-api:${slf4jVersion}")
compile ("org.apache.httpcomponents:httpclient:${httpClientVersion}")
compile ("com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}")
compile ("com.fasterxml.jackson.core:jackson-core:${jacksonVersion}")
compile ("com.fasterxml.jackson.core:jackson-annotations:${jacksonVersion}")
// Tests
testCompile ("junit:junit:4.12")
testRuntime ("org.slf4j:slf4j-simple:${slf4jVersion}")
}
// custom tasks for creating source/javadoc jars
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
}
// ###################################
// ### Publish to local maven repo ###
// ###################################
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
}
}
}
// ##########################
// ### Publish to bintray ###
// ##########################
bintray {
user = project.hasProperty('BINTRAY_USER') ? BINTRAY_USER : null //this usually comes from gradle.properties file in ~/.gradle
key = project.hasProperty('BINTRAY_API_KEY') ? BINTRAY_API_KEY : null //this usually comes from gradle.properties file in ~/.gradle
// configurations = ['archives'] //When uploading configuration files
// - OR -
publications = ['mavenJava'] //When uploading Maven-based publication files
dryRun = false //Whether to run this as dry-run, without deploying
publish = false //If version should be auto published after an upload
// Package configuration. The plugin will use the repo and name properties to check if the package already exists.
// In that case, there's no need to configure the other package properties (like userOrg, desc, etc).
pkg {
repo = 'maven'
name = 'jopencage'
//userOrg = 'byteowls' //An optional organization name when the repo belongs to one of the user's orgs
desc = 'OpenCage geocoding client for Java'
websiteUrl = 'https://github.com/moberwasserlechner/jopencage'
issueTrackerUrl = 'https://github.com/moberwasserlechner/jopencage/issues'
vcsUrl = 'https://github.com/moberwasserlechner/jopencage.git'
licenses = ['Apache-2.0']
labels = ['geocoding', 'opencage', 'openstreetmap']
publicDownloadNumbers = true
version {
name = project.version //Bintray logical version name
// desc = 'optional'
vcsTag = project.version
}
}
}
task wrapper(type: Wrapper) {
gradleVersion = '4.6'
}