-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathbuild.gradle
201 lines (170 loc) · 6.48 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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
/*
* This build file was auto generated by running the Gradle 'init' task
* by 'andes' at '4/29/15 3:01 PM' with Gradle 2.2.1
*
* This generated file contains a sample Java project to get you started.
* For more details take a look at the Java Quickstart chapter in the Gradle
* user guide available at http://gradle.org/docs/2.2.1/userguide/tutorial_java_projects.html
*/
buildscript {
repositories { jcenter() }
dependencies {
classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.4'
}
}
plugins {
id "com.jfrog.bintray" version "1.1"
id "java"
id "com.github.johnrengelman.shadow" version "1.2.4"
}
// Apply the java plugin to add support for Java
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'com.github.johnrengelman.shadow'
def siteUrl = 'https://github.com/veritrans/veritrans-java'
def gitUrl = 'https://github.com/veritrans/veritrans-java.git'
def gitIssuesUrl = 'https://github.com/veritrans/veritrans-java/issues'
group = 'id.co.veritrans'
version = '1.5.0'
sourceCompatibility = '1.7'
targetCompatibility = '1.7'
// In this section you declare where to find the dependencies of your project
repositories {
// Use 'jcenter' for resolving your dependencies.
// You can declare any Maven/Ivy/file repository here.
jcenter()
}
// In this section you declare the dependencies for your production and test code
dependencies {
// The production code uses the SLF4J logging API at compile time
compile 'org.slf4j:slf4j-api:1.7.12'
compile 'org.apache.httpcomponents:httpclient:4.4.1'
compile 'org.apache.httpcomponents:httpasyncclient:4.1'
compile 'commons-codec:commons-codec:1.10'
compile 'javax.validation:validation-api:1.1.0.Final'
compile 'org.hibernate:hibernate-validator:5.2.0.Beta1'
compile 'com.fasterxml.jackson.core:jackson-databind:2.8.4'
testCompile 'org.slf4j:log4j-over-slf4j:1.7.12'
testCompile 'ch.qos.logback:logback-classic:1.1.3'
testCompile 'org.testng:testng:6.8.17'
testCompile 'org.mockito:mockito-all:1.10.19'
}
test {
testLogging {
events "started", "passed", "skipped", "failed", "standardOut", "standardError"
exceptionFormat "full"
}
useTestNG {
excludeGroups 'integrationTest', 'disabled'
}
}
task integrationTest(type: Test, dependsOn: 'test') {
testLogging {
events "started", "passed", "skipped", "failed", "standardOut", "standardError"
exceptionFormat "full"
}
useTestNG() {
includeGroups 'integrationTest'
}
}
configurations.all {
resolutionStrategy {
}
}
task wrapper(type: Wrapper) {
gradleVersion = '2.3'
}
task sourceJar(type: Jar) {
from sourceSets.main.allSource
classifier = 'sources'
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives sourceJar
archives javadocJar
archives shadowJar
}
install {
repositories.mavenInstaller {
// This generates POM.xml with proper parameters
pom {
project {
packaging 'jar'
// Add your description here
name 'Midtrans Java Client Library'
description = 'Official Midtrans Payment API Java Client.'
url siteUrl
// Set your license
licenses {
license {
name 'Unlicense'
url 'http://unlicense.org/UNLICENSE'
}
}
developers {
[
developer {
id 'gde.satrigraha'
name 'Gde Mahardhikha Satrigraha'
email '[email protected]'
},
developer {
id 'andes.yudanto'
name 'Andes Haryo Yudanto'
email '[email protected]'
},
developer {
id 'adam.pahlevi'
name 'Adam Pahlevi'
email '[email protected]'
}
]
}
scm {
connection gitUrl
developerConnection gitUrl
url siteUrl
}
}
}
}
}
def Properties bintrayProperties = new Properties()
bintrayProperties.load(project.file('bintray.properties').newDataInputStream())
bintray {
user = bintrayProperties.getProperty("bintray.user")
key = bintrayProperties.getProperty("bintray.apikey")
configurations = ['archives']
dryRun = false //Whether to run this as dry-run, without deploying
publish = true //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 = 'veritrans-java-client'
userOrg = 'pt-midtrans'
desc = 'Official Veritrans Indonesia Payment API Java Client.'
websiteUrl = siteUrl
issueTrackerUrl = gitIssuesUrl
vcsUrl = gitUrl
licenses = ['Unlicense']
publicDownloadNumbers = true
//Optional version descriptor
version {
//Optional configuration for GPG signing
gpg {
sign = true //Determines whether to GPG sign the files. The default is false
passphrase = bintrayProperties.getProperty("bintray.gpg.passphrase") //Optional. The passphrase for GPG signing'
}
//Optional configuration for Maven Central Synchronization
mavenCentralSync {
sync = true //Optional (true by default). Determines whether to sync the version to Maven Central.
user = bintrayProperties.getProperty("bintray.oss.user") //OSS user token
password = bintrayProperties.getProperty("bintray.oss.password") //OSS user password
close = '0' //Optional property. By default the staging repository is closed and artifacts are released to Maven Central. You can optionally turn this behaviour off (by puting 0 as value) and release the version manually.
}
}
}
}