Skip to content

Commit 3efe5ae

Browse files
committed
Tweak signing process for release 4.2-beta-1
1 parent 607cb06 commit 3efe5ae

File tree

4 files changed

+80
-63
lines changed

4 files changed

+80
-63
lines changed

build.gradle

Lines changed: 4 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11

22
defaultTasks 'build'
33

4-
Boolean doSigning() {
5-
signingEnabled.trim() == "true"
6-
}
7-
84
ext {
95
}
106

@@ -19,13 +15,15 @@ if (JavaVersion.current().isJava8Compatible()) {
1915
allprojects {
2016

2117
ext {
22-
isSnapshot = true
18+
isSnapshot = false
2319
fjBaseVersion = "4.2-beta-1"
2420

2521
snapshotAppendix = "-SNAPSHOT"
2622
fjVersion = fjBaseVersion + (isSnapshot ? snapshotAppendix : "")
2723
fjConsumeVersion = "4.1"
2824

25+
signModule = false
26+
2927
projectTitle = "Functional Java"
3028
projectName = "functionaljava"
3129
pomProjectName = projectTitle
@@ -74,16 +72,10 @@ subprojects {
7472
apply from: "$rootDir/lib.gradle"
7573
apply plugin: "maven"
7674
apply plugin: "java"
75+
apply plugin: "signing"
7776

7877
sourceCompatibility = "1.8"
7978

80-
if (doSigning()) {
81-
apply plugin: "signing"
82-
signing {
83-
sign configurations.archives
84-
}
85-
}
86-
8779
task javadocJar(type: Jar, dependsOn: "javadoc") {
8880
classifier = 'javadoc'
8981
from "build/docs/javadoc"
@@ -107,49 +99,6 @@ subprojects {
10799
}
108100
}
109101

110-
uploadArchives {
111-
enabled = false
112-
repositories {
113-
mavenDeployer {
114-
if (doSigning()) {
115-
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
116-
}
117-
118-
repository(url: sonatypeUploadUrl) {
119-
authentication(userName: sonatypeUsername, password: sonatypePassword)
120-
}
121-
pom {
122-
groupId = project.group
123-
project {
124-
name pomProjectName
125-
packaging 'jar'
126-
description projectDescription
127-
url projectUrl
128-
organization {
129-
name pomOrganisation
130-
url projectUrl
131-
}
132-
scm {
133-
url scmUrl
134-
}
135-
licenses {
136-
license {
137-
name "The BSD3 License"
138-
url "https://github.com/functionaljava/functionaljava/blob/master/etc/LICENCE"
139-
distribution 'repo'
140-
}
141-
}
142-
developers {
143-
developer {
144-
email primaryEmail
145-
}
146-
}
147-
}
148-
}
149-
}
150-
}
151-
}
152-
153102
}
154103

155104
task wrapper(type: Wrapper) {

core/build.gradle

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
11

22
apply plugin: 'retrolambda'
33

4-
jar {
5-
baseName project.projectName
4+
ext {
5+
signModule = true
66
}
77

8+
archivesBaseName = project.projectName
9+
810
dependencies {
911
testCompile dependencyJunit
1012
}
1113

14+
performSigning(signingEnabled, signModule)
15+
configureUpload(signingEnabled, signModule)
16+
17+
uploadArchives.enabled = true
1218

1319
retrolambda {
1420
jdk System.getenv("JAVA8_HOME")
1521
oldJdk System.getenv("JAVA7_HOME")
1622
javaVersion JavaVersion.VERSION_1_7
1723
}
18-
19-
uploadArchives.enabled = true
20-

java8/build.gradle

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11

2-
jar {
3-
baseName "${project.projectName}-${project.name}"
4-
}
2+
archivesBaseName = "${project.projectName}-${project.name}"
53

4+
ext {
5+
signModule = true
6+
}
67

78
dependencies {
89
compile project(":core")
910
testCompile dependencyJunit
1011
}
1112

13+
performSigning(signingEnabled, signModule)
14+
configureUpload(signingEnabled, signModule)
1215

1316
uploadArchives.enabled = true

lib.gradle

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,68 @@ String findJavaCommand(String command) {
1818
findCommand("$jh/bin", command)
1919
}
2020

21+
Boolean doSigning(String signingAllowed, Boolean doModule) {
22+
def b = signingAllowed.trim() == "true" && doModule
23+
println("signModule: ${project.name} signingEnabled: $signingAllowed module: $doModule")
24+
b
25+
}
26+
27+
void performSigning(String signingAllowed, Boolean doModule) {
28+
signing {
29+
required { doSigning(signingEnabled, signModule) }
30+
sign configurations.archives
31+
}
32+
}
33+
34+
void configureUpload(String signingEnabled, Boolean signModule) {
35+
36+
uploadArchives {
37+
enabled = false
38+
repositories {
39+
mavenDeployer {
40+
if (doSigning(signingEnabled, signModule)) {
41+
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
42+
}
43+
44+
repository(url: sonatypeUploadUrl) {
45+
authentication(userName: sonatypeUsername, password: sonatypePassword)
46+
}
47+
pom {
48+
groupId = project.group
49+
project {
50+
name pomProjectName
51+
packaging 'jar'
52+
description projectDescription
53+
url projectUrl
54+
organization {
55+
name pomOrganisation
56+
url projectUrl
57+
}
58+
scm {
59+
url scmUrl
60+
}
61+
licenses {
62+
license {
63+
name "The BSD3 License"
64+
url "https://github.com/functionaljava/functionaljava/blob/master/etc/LICENCE"
65+
distribution 'repo'
66+
}
67+
}
68+
developers {
69+
developer {
70+
email primaryEmail
71+
}
72+
}
73+
}
74+
}
75+
}
76+
}
77+
}
78+
}
79+
2180
ext {
2281
findJavaCommand = this.&findJavaCommand
82+
doSigning = this.&doSigning
83+
performSigning = this.&performSigning
84+
configureUpload = this.&configureUpload
2385
}

0 commit comments

Comments
 (0)