-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.release-jar.gradle
56 lines (43 loc) · 1.33 KB
/
build.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
// Deployment script: https://github.com/blundell/release-android-library
// Run with command ./gradlew clean build generateRelease
apply plugin: 'maven'
def groupId = POM_GROUP_ID
def artifactId = POM_ARTIFACT_ID
def version = POM_VERSION_ID
def localReleaseDest = "${buildDir}/release/${version}"
task javaJavadocs(type: Javadoc) {
source = sourceSets.main.java.srcDirs
}
task javaJavadocsJar(type: Jar, dependsOn: javaJavadocs) {
classifier = 'javadoc'
//noinspection GroovyAssignabilityCheck
from destinationDir
}
task javaSourcesJar(type: Jar) {
classifier = 'sources'
//noinspection GroovyAssignabilityCheck
from sourceSets.main.java.srcDirs
}
uploadArchives {
repositories.mavenDeployer {
repository(url: "file://${localReleaseDest}")
pom.groupId = groupId
pom.artifactId = artifactId
pom.version = version
}
}
task zipRelease(type: Zip) {
from localReleaseDest
destinationDir buildDir
archiveName "release-${version}.zip"
}
task generateRelease << {
println "Release ${version} can be found at ${localReleaseDest}/"
println "Release ${version} zipped can be found ${buildDir}/release-${version}.zip"
}
generateRelease.dependsOn(uploadArchives)
generateRelease.dependsOn(zipRelease)
artifacts {
archives javaSourcesJar
archives javaJavadocsJar
}