You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by pa...@apache.org on 2017/01/10 22:34:28 UTC
[1/2] groovy git commit: fault tolerance if signing properties not set
Repository: groovy
Updated Branches:
refs/heads/master 1d6862712 -> 86065a72b
fault tolerance if signing properties not set
Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/f9a3c0e2
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/f9a3c0e2
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/f9a3c0e2
Branch: refs/heads/master
Commit: f9a3c0e2443c6e5f8404029193e13ca2e4c87ed2
Parents: 1d68627
Author: paulk <pa...@asert.com.au>
Authored: Tue Jan 10 18:18:50 2017 +1000
Committer: paulk <pa...@asert.com.au>
Committed: Wed Jan 11 08:32:30 2017 +1000
----------------------------------------------------------------------
gradle/upload.gradle | 48 +++++++++++++++++++++++++++++------------------
1 file changed, 30 insertions(+), 18 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/groovy/blob/f9a3c0e2/gradle/upload.gradle
----------------------------------------------------------------------
diff --git a/gradle/upload.gradle b/gradle/upload.gradle
index 9eaef25..85ca9db 100644
--- a/gradle/upload.gradle
+++ b/gradle/upload.gradle
@@ -46,10 +46,13 @@ allprojects {
ext.signWithClassifier = { String c, File f ->
if (rootProject.isReleaseVersion) {
signing.sign(c, f)
- project.artifacts.add('archives', new File(f.parent, f.name + '.asc')) {
- classifier = c
- type = 'asc'
- extension = 'jar.asc'
+ def ascFile = new File(f.parent, f.name + '.asc')
+ if (ascFile.exists()) {
+ project.artifacts.add('archives', ascFile) {
+ classifier = c
+ type = 'asc'
+ extension = 'jar.asc'
+ }
}
}
}
@@ -57,11 +60,14 @@ allprojects {
ext.signArchiveTask = { archiveTask ->
if (rootProject.isReleaseVersion) {
signing.sign(archiveTask.classifier, archiveTask.archivePath)
- project.artifacts.add('archives', new File(archiveTask.destinationDir, archiveTask.archiveName + '.asc')) {
- name = archiveTask.baseName
- classifier = archiveTask.classifier
- type = 'asc'
- extension = archiveTask.extension + '.asc'
+ def ascFile = new File(archiveTask.destinationDir, archiveTask.archiveName + '.asc')
+ if (ascFile.exists()) {
+ project.artifacts.add('archives', ascFile) {
+ name = archiveTask.baseName
+ classifier = archiveTask.classifier
+ type = 'asc'
+ extension = archiveTask.extension + '.asc'
+ }
}
}
}
@@ -160,10 +166,13 @@ allprojects {
// TODO rework these?
if (isReleaseVersion) {
signing.sign(distBin.archivePath)
- project.artifacts.add('archives', new File(distBin.destinationDir, distBin.archiveName + '.asc')) {
- name = 'groovy-binary'
- type = 'asc'
- extension = 'zip.asc'
+ def ascFile = new File(distBin.destinationDir, distBin.archiveName + '.asc')
+ if (ascFile.exists()) {
+ project.artifacts.add('archives', ascFile) {
+ name = 'groovy-binary'
+ type = 'asc'
+ extension = 'zip.asc'
+ }
}
signing.sign(distSrc.archivePath)
signing.sign(distDoc.archivePath)
@@ -178,11 +187,14 @@ allprojects {
}
if (isReleaseVersion) {
signing.sign(t.classifier, t.archivePath)
- project.artifacts.add('archives', new File(t.destinationDir, t.archiveName + '.asc')) {
- name = t.baseName
- classifier = t.classifier
- type = 'asc'
- extension = t.extension + '.asc'
+ def ascFile = new File(t.destinationDir, t.archiveName + '.asc')
+ if (ascFile.exists()) {
+ project.artifacts.add('archives', ascFile) {
+ name = t.baseName
+ classifier = t.classifier
+ type = 'asc'
+ extension = t.extension + '.asc'
+ }
}
}
}
[2/2] groovy git commit: rename a property to better reflect reality
Posted by pa...@apache.org.
rename a property to better reflect reality
Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/86065a72
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/86065a72
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/86065a72
Branch: refs/heads/master
Commit: 86065a72b343b0eb965a884edfdd8242acb86880
Parents: f9a3c0e
Author: paulk <pa...@asert.com.au>
Authored: Tue Jan 10 18:41:40 2017 +1000
Committer: paulk <pa...@asert.com.au>
Committed: Wed Jan 11 08:34:06 2017 +1000
----------------------------------------------------------------------
build.gradle | 2 +-
gradle/assemble.gradle | 2 +-
gradle/bintray.gradle | 97 ---------------------------------------------
gradle/publish.gradle | 97 +++++++++++++++++++++++++++++++++++++++++++++
gradle/upload.gradle | 8 ++--
5 files changed, 103 insertions(+), 103 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/groovy/blob/86065a72/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index 70f8732..9343891 100644
--- a/build.gradle
+++ b/build.gradle
@@ -61,7 +61,7 @@ buildScan {
apply from: 'gradle/filter.gradle'
apply from: 'gradle/indy.gradle'
-apply from: 'gradle/bintray.gradle'
+apply from: 'gradle/publish.gradle'
apply plugin: 'javadocHotfix'
apply plugin: "com.github.jk1.dependency-license-report"
http://git-wip-us.apache.org/repos/asf/groovy/blob/86065a72/gradle/assemble.gradle
----------------------------------------------------------------------
diff --git a/gradle/assemble.gradle b/gradle/assemble.gradle
index 12f2917..050a9ec 100644
--- a/gradle/assemble.gradle
+++ b/gradle/assemble.gradle
@@ -41,7 +41,7 @@ ext.srcSpec = copySpec {
'cobertura.ser',
'junitvmwatcher*.properties',
'out',
- 'bintray.properties', // generated by the CI server
+ 'artifactory.properties', // generated by the CI server
'gradle.properties.gz', // generated by the CI server
'**/*.iml', // used by Intellij IDEA
'**/*.ipr', // used by Intellij IDEA
http://git-wip-us.apache.org/repos/asf/groovy/blob/86065a72/gradle/bintray.gradle
----------------------------------------------------------------------
diff --git a/gradle/bintray.gradle b/gradle/bintray.gradle
deleted file mode 100644
index d52f89c..0000000
--- a/gradle/bintray.gradle
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-import org.gradle.api.internal.artifacts.publish.DefaultPublishArtifact
-
-ext.bintrayUser = project.hasProperty('bintrayUser') ? project.bintrayUser : System.getenv('BINTRAY_USER')
-ext.bintrayPassword = project.hasProperty('bintrayPassword') ? project.bintrayPassword : System.getenv('BINTRAY_PASSWORD')
-
-if (!bintrayUser) {
- // try to read from properties
- def bintrayFile = file('bintray.properties')
- if (bintrayFile.exists()) {
- def props = new Properties()
- props.load(bintrayFile.newReader())
- ext.bintrayUser = props.getProperty('bintrayUser','')
- ext.bintrayPassword = props.getProperty('bintrayPassword','')
- }
-}
-
-logger.lifecycle "Bintray user: $bintrayUser"
-
-allprojects {
- apply plugin: 'com.jfrog.artifactory-upload'
-
- artifactory {
- contextUrl = project.hasProperty('bintrayContext') ? project.bintrayContext : 'https://oss.jfrog.org'
- resolve {
- repository {
- repoKey = 'libs-release'
- }
- }
- publish {
- excludePatterns = "org/codehaus/groovy/groovy/*/groovy-all-*,org/codehaus/groovy/groovy/*/groovy-backports-*,org/codehaus/groovy/groovy/*/groovy-binary-*"
- repository {
- repoKey = project.hasProperty('bintrayRepoKey') ? project.bintrayRepoKey : 'oss-snapshot-local' //The Artifactory repository key to publish to
- //when using oss.jfrog.org the credentials are from Bintray. For local build we expect them to be found in
- //~/.gradle/gradle.properties, otherwise to be set in the build server
- username = rootProject.bintrayUser
- password = rootProject.bintrayPassword
- }
- }
- }
-}
-
-artifactoryPublish {
- def curDate = new Date()
- def pomSource = { a -> "$projectDir/target/poms/pom-${a.name - 'groovy-'}.xml" }
- def destBase = { a -> "org/codehaus/groovy/${a.name}/${version}/${a.name}-${version}${a.classifier ? '-' + a.classifier : ''}" }
- def newDetails = { orig, newFile, newExt, newType -> gradleDeployDetails(new DefaultPublishArtifact(
- orig.name, newExt, newType, orig.classifier, curDate, newFile), 'artifacts', destBase(orig) + '.' + newExt) }
- def makeTransformedDetails = { orig -> newDetails(orig, orig.file, orig.extension, orig.extension) }
- def makeTransformedPomDetails = { orig -> newDetails(orig, file(pomSource(orig)), 'pom', 'pom') }
- def makeTransformedPomSigDetails = { orig -> newDetails(orig, file(pomSource(orig) + '.asc'), 'pom.asc', 'asc') }
- mavenDescriptor = new File("$projectDir/target/poms/pom-groovy.xml")
- doFirst{
- configurations.archives.artifacts.findAll{ it.name != project.name }.each {
- // the plugin we are using uses the project name rather than the artifact name
- // as the artifactId, so we add the transformed one ourselves
- // this also covers signatures which we already added during install
- deployDetails.add(makeTransformedDetails(it))
- if (!it.classifier && (it.type == 'jar' || it.type == 'zip')) {
- // add the pom and its signature
- deployDetails.add(makeTransformedPomDetails(it))
- if (isReleaseVersion) {
- deployDetails.add(makeTransformedPomSigDetails(it))
- }
- }
- }
-
- if (isReleaseVersion) {
- allprojects {
- configurations.archives.artifacts.findAll{ it.name == project.name && it.type == 'jar' && it.extension == 'jar' && !it.classifier }.each {
- // add pom signatures
- def pomSigLocation = "$project.projectDir/target/poms/pom-${project == rootProject ? 'groovy' : 'default'}.xml.asc"
- deployDetails.add(newDetails(it, file(pomSigLocation), 'pom.asc', 'pom'))
- }
- }
- }
- }
-}
-
-artifactoryPublish.dependsOn('backportJars')
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/groovy/blob/86065a72/gradle/publish.gradle
----------------------------------------------------------------------
diff --git a/gradle/publish.gradle b/gradle/publish.gradle
new file mode 100644
index 0000000..b7f07de
--- /dev/null
+++ b/gradle/publish.gradle
@@ -0,0 +1,97 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import org.gradle.api.internal.artifacts.publish.DefaultPublishArtifact
+
+ext.artifactoryUser = project.hasProperty('artifactoryUser') ? project.artifactoryUser : System.getenv('ARTIFACTORY_USER')
+ext.artifactoryPassword = project.hasProperty('artifactoryPassword') ? project.artifactoryPassword : System.getenv('ARTIFACTORY_PASSWORD')
+
+if (!artifactoryUser) {
+ // try to read from properties
+ def artifactoryFile = file('artifactory.properties')
+ if (artifactoryFile.exists()) {
+ def props = new Properties()
+ props.load(artifactoryFile.newReader())
+ ext.artifactoryUser = props.getProperty('artifactoryUser','')
+ ext.artifactoryPassword = props.getProperty('artifactoryPassword','')
+ }
+}
+
+logger.lifecycle "Bintray user: $bintrayUser"
+
+allprojects {
+ apply plugin: 'com.jfrog.artifactory-upload'
+
+ artifactory {
+ contextUrl = project.hasProperty('artifactoryContext') ? project.artifactoryContext : 'https://oss.jfrog.org'
+ resolve {
+ repository {
+ repoKey = 'libs-release'
+ }
+ }
+ publish {
+ excludePatterns = "org/codehaus/groovy/groovy/*/groovy-all-*,org/codehaus/groovy/groovy/*/groovy-backports-*,org/codehaus/groovy/groovy/*/groovy-binary-*"
+ repository {
+ repoKey = project.hasProperty('artifactoryRepoKey') ? project.artifactoryRepoKey : 'oss-snapshot-local' //The Artifactory repository key to publish to
+ //when using oss.jfrog.org the credentials are from Bintray. For local build we expect them to be found in
+ //~/.gradle/gradle.properties, otherwise to be set in the build server
+ username = rootProject.artifactoryUser
+ password = rootProject.artifactoryPassword
+ }
+ }
+ }
+}
+
+artifactoryPublish {
+ def curDate = new Date()
+ def pomSource = { a -> "$projectDir/target/poms/pom-${a.name - 'groovy-'}.xml" }
+ def destBase = { a -> "org/codehaus/groovy/${a.name}/${version}/${a.name}-${version}${a.classifier ? '-' + a.classifier : ''}" }
+ def newDetails = { orig, newFile, newExt, newType -> gradleDeployDetails(new DefaultPublishArtifact(
+ orig.name, newExt, newType, orig.classifier, curDate, newFile), 'artifacts', destBase(orig) + '.' + newExt) }
+ def makeTransformedDetails = { orig -> newDetails(orig, orig.file, orig.extension, orig.extension) }
+ def makeTransformedPomDetails = { orig -> newDetails(orig, file(pomSource(orig)), 'pom', 'pom') }
+ def makeTransformedPomSigDetails = { orig -> newDetails(orig, file(pomSource(orig) + '.asc'), 'pom.asc', 'asc') }
+ mavenDescriptor = new File("$projectDir/target/poms/pom-groovy.xml")
+ doFirst{
+ configurations.archives.artifacts.findAll{ it.name != project.name }.each {
+ // the plugin we are using uses the project name rather than the artifact name
+ // as the artifactId, so we add the transformed one ourselves
+ // this also covers signatures which we already added during install
+ deployDetails.add(makeTransformedDetails(it))
+ if (!it.classifier && (it.type == 'jar' || it.type == 'zip')) {
+ // add the pom and its signature
+ deployDetails.add(makeTransformedPomDetails(it))
+ if (isReleaseVersion) {
+ deployDetails.add(makeTransformedPomSigDetails(it))
+ }
+ }
+ }
+
+ if (isReleaseVersion) {
+ allprojects {
+ configurations.archives.artifacts.findAll{ it.name == project.name && it.type == 'jar' && it.extension == 'jar' && !it.classifier }.each {
+ // add pom signatures
+ def pomSigLocation = "$project.projectDir/target/poms/pom-${project == rootProject ? 'groovy' : 'default'}.xml.asc"
+ deployDetails.add(newDetails(it, file(pomSigLocation), 'pom.asc', 'pom'))
+ }
+ }
+ }
+ }
+}
+
+artifactoryPublish.dependsOn('backportJars')
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/groovy/blob/86065a72/gradle/upload.gradle
----------------------------------------------------------------------
diff --git a/gradle/upload.gradle b/gradle/upload.gradle
index 85ca9db..c6c1c01 100644
--- a/gradle/upload.gradle
+++ b/gradle/upload.gradle
@@ -17,11 +17,11 @@
* under the License.
*/
-boolean isUsingBintray = rootProject.hasProperty('bintrayUser') && rootProject.bintrayUser &&
- rootProject.hasProperty('bintrayPassword') && rootProject.bintrayPassword
+boolean isUsingArtifactory = rootProject.hasProperty('artifactoryUser') && rootProject.artifactoryUser &&
+ rootProject.hasProperty('artifactoryPassword') && rootProject.artifactoryPassword
-if (isUsingBintray) {
- logger.lifecycle 'Deployment environment set to Bintray'
+if (isUsingArtifactory) {
+ logger.lifecycle 'Deployment environment set to Artifactory'
}
def embedded = ['asm', 'asm-util', 'asm-analysis', 'asm-tree', 'asm-commons', 'antlr', 'commons-cli', 'openbeans']