forked from taskadapter/redmine-java-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
116 lines (99 loc) · 3.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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'signing'
// 'eclipse' plugin is used to generate native project files for Eclipse
// from this Gradle script - for those who don't have Gradle plugin installed in Eclipse
apply plugin: 'eclipse'
group = 'com.taskadapter'
version = '2.1.0'
sourceCompatibility = 1.6
targetCompatibility = 1.6
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
repositories {
mavenCentral()
}
dependencies {
compile ('org.apache.httpcomponents:httpclient:4.2',
'org.apache.httpcomponents:httpcore:4.2',
'org.json:json:20090211',
'org.slf4j:slf4j-api:1.7.1')
testCompile(
'junit:junit:4.10',
'org.easytesting:fest-assert:1.4',
'org.slf4j:slf4j-jdk14:1.7.1'
)
}
ext.isReleaseVersion = !version.endsWith("SNAPSHOT")
// A PGP key is required to sign the artifacts before uploading to OSS Sonatype Maven repository.
// Put the PGP key info in your <home>/.gradle/gradle.properties file:
// signing.keyId=...
// signing.password=...
// signing.secretKeyRingFile=c:/Users/ask/.gnupg/secring.gpg
signing {
required { isReleaseVersion && gradle.taskGraph.hasTask("uploadArchives") }
sign configurations.archives
}
// password can be set in gradle.properties or environment variable (check "build environment" on Jenkins)
// typically you set "ossUser" and "ossPassword" properties in your <home>/.gradle/gradle.properties file,
// standard properties file format: "ossUser=myOssUser", etc.
def ossUserVar = hasProperty("ossUser") ? ossUser : ""
def ossPasswordVar = hasProperty("ossPassword") ? ossPassword : ""
uploadArchives {
repositories {
mavenDeployer {
repository(url: 'https://oss.sonatype.org/service/local/staging/deploy/maven2') {
authentication(userName: ossUserVar, password: ossPasswordVar)
}
snapshotRepository(url: 'https://oss.sonatype.org/content/repositories/snapshots') {
authentication(userName: ossUserVar, password: ossPasswordVar)
}
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
pom.project {
name 'Redmine Java API'
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution 'repo'
}
}
url 'http://github.com/taskadapter/redmine-java-api'
description 'Free open-source Java API for Redmine and Chiliproject bug/task management systems.' +
'This project was originally a part of Task Adapter application (http://www.taskadapter.com)'
developers {
developer {
name 'Alexey Skorokhodov'
email '[email protected]'
}
}
scm {
connection 'scm:git:git://github.com/taskadapter/redmine-java-api.git'
// "developerConnection" is required for Maven Release plugin.
developerConnection 'scm:git:[email protected]:taskadapter/redmine-java-api.git'
tag 'HEAD'
// A publicly browsable repository. For example, via ViewCVS
url 'http://github.com/taskadapter/redmine-java-api/tree/master/'
}
issueManagement {
system 'github'
url 'http://github.com/taskadapter/redmine-java-api/issues'
}
}
}
}
}
task packageSources(type: Jar) {
from sourceSets.main.allSource
classifier = 'sources'
}
task packageJavadoc(type: Jar, dependsOn: 'javadoc') {
from javadoc.destinationDir
classifier = 'javadoc'
}
artifacts {
archives packageSources
archives packageJavadoc
}