-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrelease-jar.gradle
99 lines (85 loc) · 2.91 KB
/
release-jar.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
apply plugin: 'maven'
//apply plugin: 'signing'
task sourcesJar(type: Jar) {
from android.sourceSets.main.kotlin.srcDirs
archiveClassifier = "sources"
}
artifacts {
archives sourcesJar
}
//signing {
// sign configurations.archives
//}
def gitUrl = 'https://github.com/EranBoudjnah/solid.git'
Properties properties = new Properties()
File propertiesFile = project.rootProject.file("local.properties")
if (propertiesFile.exists()) {
properties.load(propertiesFile.newDataInputStream())
}
def pomVersion = project.PUBLISH_VERSION
def localReleaseDest = "${buildDir}/release/${pomVersion}"
def ossrhUsername = properties['ossrhUsername']
def ossrhPassword = properties['ossrhPassword']
println "packageGroup = " + project.PUBLISH_GROUP_ID
nexusStaging {
username = "${ossrhUsername}"
password = "${ossrhPassword}"
packageGroup = project.PUBLISH_GROUP_ID
}
uploadArchives {
repositories.mavenDeployer {
// beforeDeployment {
// deployment -> signing.signPom(deployment)
// }
pom {
project {
name project.PUBLISH_ARTIFACT_ID
description 'An attempt at following good engineering standards and best practices such as SOLID and DRY where Google neglected to.'
packaging 'jar'
url gitUrl
licenses {
license {
name 'MIT'
url 'https://github.com/EranBoudjnah/solid/blob/master/LICENSE'
}
}
scm {
connection gitUrl
developerConnection gitUrl
url gitUrl
}
developers {
developer {
id "EranBoudjnah"
name "Eran Boudjnah"
email "[email protected]"
}
}
}
groupId = project.PUBLISH_GROUP_ID
artifactId = project.PUBLISH_ARTIFACT_ID
version = pomVersion
}
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
repository(url: "file://${localReleaseDest}")
}
}
task zipRelease(type: Zip) {
from localReleaseDest
setDestinationDirectory buildDir
setArchiveFileName "release-${pomVersion}.zip"
}
task generateRelease {
doLast {
println "Release ${pomVersion} can be found at ${localReleaseDest}/"
println "Release ${pomVersion} zipped can be found ${buildDir}/release-${pomVersion}.zip"
}
}
generateRelease
.dependsOn(uploadArchives)
.dependsOn(zipRelease)