Skip to content

Commit d59cc4b

Browse files
committed
trying to skip based on environment
1 parent 47a0dd9 commit d59cc4b

1 file changed

Lines changed: 76 additions & 84 deletions

File tree

build.gradle

Lines changed: 76 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -6,60 +6,87 @@ apply plugin: 'io.codearte.nexus-staging'
66
apply plugin: "me.champeau.gradle.jmh"
77

88
sourceCompatibility = 1.8
9+
targetCompatibility = 1.8
910

1011
group = "com.github.protobufel"
1112
archivesBaseName = "multikeymapjava"
1213
version = '0.4.1'
1314

14-
uploadArchives {
15-
onlyIf { project.hasProperty('ossrhUsername') }
16-
repositories {
17-
mavenDeployer {
18-
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
19-
20-
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
21-
authentication(userName: ossrhUsername, password: ossrhPassword)
22-
}
23-
24-
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
25-
authentication(userName: ossrhUsername, password: ossrhPassword)
26-
}
27-
28-
pom.project {
29-
name 'multikeymapjava'
30-
packaging 'jar'
31-
description 'Java 8 implementation of the multi-key map. It behaves like a regular generic Map with the additional ability of getting its values by any combination of partial keys.'
32-
url 'https://github.com/protobufel/multikeymapjava'
33-
34-
scm {
35-
connection 'scm:git:https://github.com/protobufel/multikeymapjava.git'
36-
developerConnection 'scm:git@github.com:protobufel/multikeymapjava.git'
37-
url 'https://github.com/protobufel/multikeymapjava'
38-
}
39-
40-
licenses {
41-
license {
42-
name 'The Apache License, Version 2.0'
43-
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
44-
}
45-
}
46-
47-
developers {
48-
developer {
49-
id 'protobufel'
50-
name 'David Tesler'
51-
email 'protobufel@gmail.com'
52-
}
53-
}
54-
}
55-
}
56-
}
57-
}
58-
59-
nexusStaging {
60-
//onlyIf { project.hasProperty('ossrhUsername') }
61-
packageGroup = "com.github.protobufel.multikeymapjava" //optional if packageGroup == project.getGroup()
62-
stagingProfileId = "com.github.protobufel" //when not defined will be got from server using "packageGroup"
15+
if (project.hasProperty('ossrhUsername')) {
16+
uploadArchives {
17+
repositories {
18+
mavenDeployer {
19+
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
20+
21+
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
22+
authentication(userName: ossrhUsername, password: ossrhPassword)
23+
}
24+
25+
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
26+
authentication(userName: ossrhUsername, password: ossrhPassword)
27+
}
28+
29+
pom.project {
30+
name 'multikeymapjava'
31+
packaging 'jar'
32+
description 'Java 8 implementation of the multi-key map. It behaves like a regular generic Map with the additional ability of getting its values by any combination of partial keys.'
33+
url 'https://github.com/protobufel/multikeymapjava'
34+
35+
scm {
36+
connection 'scm:git:https://github.com/protobufel/multikeymapjava.git'
37+
developerConnection 'scm:git@github.com:protobufel/multikeymapjava.git'
38+
url 'https://github.com/protobufel/multikeymapjava'
39+
}
40+
41+
licenses {
42+
license {
43+
name 'The Apache License, Version 2.0'
44+
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
45+
}
46+
}
47+
48+
developers {
49+
developer {
50+
id 'protobufel'
51+
name 'David Tesler'
52+
email 'protobufel@gmail.com'
53+
}
54+
}
55+
}
56+
}
57+
}
58+
}
59+
60+
nexusStaging {
61+
packageGroup = "com.github.protobufel.multikeymapjava" //optional if packageGroup == project.getGroup()
62+
stagingProfileId = "com.github.protobufel" //when not defined will be got from server using "packageGroup"
63+
}
64+
65+
task sourcesJar(type: Jar) {
66+
onlyIf { project.hasProperty('ossrhUsername') }
67+
classifier = 'sources'
68+
from sourceSets.main.allSource
69+
}
70+
71+
signing {
72+
sign configurations.archives
73+
}
74+
75+
task javadocJar(type: Jar) {
76+
onlyIf { project.hasProperty('ossrhUsername') }
77+
classifier = 'javadoc'
78+
from javadoc
79+
}
80+
81+
task copyJavadocToDoc(type: Copy) {
82+
dependsOn javadoc
83+
from ("build/docs/javadoc")
84+
into ("docs/javadoc")
85+
}
86+
87+
artifacts {
88+
archives javadocJar, sourcesJar
89+
}
6390
}
6491

6592
jar {
@@ -69,41 +96,6 @@ jar {
6996
}
7097
}
7198

72-
task copyJavadocToDoc(type: Copy) {
73-
dependsOn javadoc
74-
from ("build/docs/javadoc")
75-
into ("docs/javadoc")
76-
}
77-
78-
task javadocJar(type: Jar) {
79-
onlyIf { project.hasProperty('ossrhUsername') }
80-
classifier = 'javadoc'
81-
from javadoc
82-
}
83-
84-
task sourcesJar(type: Jar) {
85-
onlyIf { project.hasProperty('ossrhUsername') }
86-
classifier = 'sources'
87-
from sourceSets.main.allSource
88-
}
89-
90-
artifacts {
91-
archives javadocJar, sourcesJar
92-
}
93-
94-
signing {
95-
sign configurations.archives
96-
}
97-
98-
if( !rootProject.hasProperty("ossrhUsername") ){
99-
uploadArchives.enable = false
100-
nexusStaging.enable = false
101-
javadocJar.enable = false
102-
sourcesJar.enable = false
103-
artifacts.enable = false
104-
signing.enable = false
105-
}
106-
10799
repositories {
108100
jcenter()
109101
mavenCentral()

0 commit comments

Comments
 (0)