-
Benachrichtigungen
You must be signed in to change notification settings - Fork 108
/
build.gradle
113 lines (102 loc) · 3.8 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
plugins {
id 'java-library'
id 'signing'
id 'maven-publish'
id 'io.codearte.nexus-staging' version '0.21.1'
}
apply from: "../java_shared.gradle"
task ciTest( type: Test ) {
useJUnit {
excludeCategories 'com.cloudinary.test.TimeoutTest'
if (System.getProperty("CLOUDINARY_ACCOUNT_URL") == "") {
exclude '**/AccountApiTest.class'
}
}
}
dependencies {
compile project(':cloudinary-core')
compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.1'
compile group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.4'
compile group: 'org.apache.httpcomponents', name: 'httpmime', version: '4.4'
testCompile project(':cloudinary-test-common')
testCompile group: 'org.hamcrest', name: 'java-hamcrest', version: '2.0.0.0'
testCompile group: 'pl.pragmatists', name: 'JUnitParams', version: '1.0.5'
testCompile group: 'junit', name: 'junit', version: '4.12'
}
if (hasProperty("ossrhPassword")) {
signing {
sign configurations.archives
}
nexusStaging {
packageGroup = group
username = project.hasProperty("ossrhUsername") ? project.ext["ossrhUsername"] : ""
password = project.hasProperty("ossrhPassword") ? project.ext["ossrhPassword"] : ""
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
pom {
name = 'Cloudinary Apache HTTP 4.4 Library'
packaging = 'jar'
groupId = publishGroupId
artifactId = 'cloudinary-http44'
description = publishDescription
url = githubUrl
licenses {
license {
name = licenseName
url = licenseUrl
}
}
developers {
developer {
id = developerId
name = developerName
email = developerEmail
}
}
scm {
connection = scmConnection
developerConnection = scmDeveloperConnection
url = scmUrl
}
}
pom.withXml {
def pomFile = file("${project.buildDir}/generated-pom.xml")
writeTo(pomFile)
def pomAscFile = signing.sign(pomFile).signatureFiles[0]
artifact(pomAscFile) {
classifier = null
extension = 'pom.asc'
}
}
// create the signed artifacts
project.tasks.signArchives.signatureFiles.each {
artifact(it) {
def matcher = it.file =~ /-(sources|javadoc)\.jar\.asc$/
if (matcher.find()) {
classifier = matcher.group(1)
} else {
classifier = null
}
extension = 'jar.asc'
}
}
}
}
model {
tasks.generatePomFileForMavenJavaPublication {
destination = file("$buildDir/generated-pom.xml")
}
tasks.publishMavenJavaPublicationToMavenLocal {
dependsOn project.tasks.signArchives
}
tasks.publishMavenJavaPublicationToSonatypeRepository {
dependsOn project.tasks.signArchives
}
}
}
}