janhoy commented on a change in pull request #491:
URL: https://github.com/apache/solr/pull/491#discussion_r780572058



##########
File path: solr/distribution/build.gradle
##########
@@ -0,0 +1,153 @@
+/*
+ * 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.apache.lucene.gradle.Checksum
+
+import java.nio.charset.StandardCharsets
+import java.nio.file.Files
+
+plugins {
+  id 'signing'
+}
+
+// This project puts together the Solr "distribution", assembling bits and 
pieces
+// from across the project structure into release artifacts.
+
+ext {
+  releaseDir = file("${buildDir}/release")
+  withSignedArtifacts = { ->
+    def propValue = propertyOrDefault("sign", null)
+    // Allow -Psign to work as a shorthand for -Psign=true
+    return propValue != null && (propValue.isBlank() || 
Boolean.parseBoolean(propValue))
+  }.call()
+  useGpgForSigning = { ->
+    def propValue = propertyOrDefault("useGpg", null)
+    // Allow -PuseGpg to work as a shorthand for -PuseGpg=true
+    return propValue != null && (propValue.isBlank() || 
Boolean.parseBoolean(propValue))
+  }.call()
+}
+
+if (project.ext.useGpgForSigning) {
+  signing {
+    useGpgCmd()
+  }

Review comment:
       I guess we may need some more stuff from Lucene to do the actual maven 
publishing. @dweiss would know.
   
   But that could be done in a new PR, right? Let's get this in so we get 
progress on building a RC, playing with docker builds etc.

##########
File path: solr/distribution/build.gradle
##########
@@ -92,6 +82,25 @@ task computeChecksums(type: Checksum) {
   outputDir = file("${buildDir}/checksums")
 }
 
+task signBinaryTgz(type: Sign) {
+  sign distTarTask
+}
+task signBinaryZip(type: Sign) {
+  sign distZipTask
+}
+task signSourceTgz(type: Sign) {
+  // The source tgz is not an archive task so be explicit about the outputs to 
sign.
+  dependsOn tasks.assembleSourceTgz
+  sign tasks.assembleSourceTgz.destination
+}
+
+task signReleaseArchives(type: Sync) {
+  from tasks.signBinaryTgz
+  from tasks.signBinaryZip
+  from tasks.signSourceTgz
+
+  into "${buildDir}/signatures"

Review comment:
       Nice!




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to