forked from bambora-na/beanstream-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
199 lines (159 loc) · 5.11 KB
/
build.gradle
File metadata and controls
199 lines (159 loc) · 5.11 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
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
import org.gradle.api.XmlProvider
import org.gradle.api.artifacts.maven.MavenDeployment
// NetBeans will automatically add "run" and "debug" tasks relying on the
// "mainClass" property. You may however define the property prior executing
// tasks by passing a "-PmainClass=<QUALIFIED_CLASS_NAME>" argument.
//
// Note however, that you may define your own "run" and "debug" task if you
// prefer. In this case NetBeans will not add these tasks but you may rely on
// your own implementation.
if (!hasProperty('mainClass')) {
ext.mainClass = 'com.beanstream.api.test.SampleTransactions'
}
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'signing'
apply plugin: 'osgi'
sourceCompatibility = '1.7'
group = "com.beanstream.api"
version = "1.0.0"
repositories {
mavenCentral()
}
dependencies {
compile 'junit:junit:4.12'
compile 'org.hamcrest:java-hamcrest:2.0.0.0'
compile 'com.google.code.gson:gson:2.3'
compile 'org.apache.httpcomponents:httpclient:4.3.5'
compile group: 'com.google.guava', name: 'guava', version: '14.0'
}
jar.doFirst {
manifest {
attributes(
"Manifest-Version" : "1.0",
"Created-By" : "Beanstream",
"Specification-Title" : "Beanstream Java SDK",
"Specification-Version" : version,
"Specification-Vendor" : "Beanstream",
"Implementation-Title" : "Beanstream Java SDK",
"Implementation-Version" : version,
"Implementation-Vendor" : "Beanstream"
)
}
}
task distJar(type: Jar) {
dependsOn jar
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from tasks.javadoc.destinationDir
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
artifacts {
archives sourcesJar
archives javadocJar
}
signing {
sign configurations.archives
}
repositories {
flatDir {
name "fileRepo"
dirs "build/repo"
}
}
def sonatype_un = hasProperty('sonatypeUsername') ? sonatypeUsername : System.getenv('sonatypeUsername')
def sonatype_pw = hasProperty('sonatypePassword') ? sonatypePassword : System.getenv('sonatypePassword')
uploadArchives {
repositories {
add project.repositories.fileRepo
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
// SNAPSHOT
//repository(url: "https://oss.sonatype.org/content/repositories/snapshots") {
// authentication(userName: sonatype_un, password: sonatype_pw)
//}
// RELEASE
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2") {
authentication(userName: sonatype_un, password: sonatype_pw)
}
pom.project {
name 'Beanstream API SDK'
description 'A library (SDK) for connecting to the Beanstream APIs'
url 'http://developer.beanstream.com'
packaging 'jar'
developers {
developer {
id 'Brent Owens'
name 'Brent Owens'
}
developer {
id 'Pedro Garcia'
name 'Pedro Garcia'
}
developer {
id 'Chris Tihor'
name 'Chris Tihor'
}
developer {
id 'Michael Sanchez'
name 'Michael Sanchez'
}
}
licenses {
license {
name 'The MIT License (MIT)'
url 'http://opensource.org/licenses/MIT'
distribution 'repo'
}
}
scm {
url 'https://github.com/Beanstream-DRWP/beanstream-java'
}
}
}
}
}
// start artifactory ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`
/*apply plugin: 'com.jfrog.artifactory'
apply plugin: 'maven-publish'
buildscript {
repositories {
maven {
url 'http://localhost:8080/artifactory/plugins-release'
credentials {
username = "${artifactoryUsername}"
password = "${artifactoryPassword}"
}
name = "maven-main-cache"
}
}
dependencies {
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:3.0.1"
}
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
}
artifactory {
contextUrl = "${artifactory_contextUrl}"
publish {
repository {
repoKey = 'libs-snapshot-local'
username = "${artifactoryUsername}"
password = "${artifactoryPassword}"
maven = true
}
defaults {
publications ('mavenJava')
}
}
}*/
// end artifactory ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^