Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

SOLR-14847: Create Solr Server TGZ (#1844)

Mike Drob14e4edc1e9b4
diff --git a/help/workflow.txt b/help/workflow.txt
index 7532d7ee9fe..d70b2436dcb 100644
--- a/help/workflow.txt
+++ b/help/workflow.txt
@@ -29,7 +29,8 @@ ls -R build/maven-local/
Put together Solr distribution:
gradlew -p solr/packaging assemble
-ls solr/packaging/build/solr-*
+ls solr/packaging/build/distributions/solr-* # release archives
+ls solr/packaging/build/solr-* # expanded directory
Other validation and checks
diff --git a/solr/packaging/build.gradle b/solr/packaging/build.gradle
index 302d5713bca..12072bc34cd 100644
--- a/solr/packaging/build.gradle
+++ b/solr/packaging/build.gradle
@@ -20,6 +20,7 @@
plugins {
id 'base'
+ id 'distribution'
}
description = 'Solr packaging'
@@ -64,58 +65,76 @@ dependencies {
server project(path: ":solr:server", configuration: "packaging")
}
-task toDir(type: Sync) {
- from(project(":solr").projectDir, {
- include "bin/**"
- include "licenses/**"
- exclude "licenses/README.committers.txt"
- include "CHANGES.txt"
- include "LICENSE.txt"
- include "NOTICE.txt"
- include "README.md"
- })
-
- from(project(":lucene").projectDir, {
- include "CHANGES.txt"
- rename { file -> 'LUCENE_CHANGES.txt' }
- })
-
- from(configurations.contrib, {
- into "contrib"
- })
-
- from(configurations.distSolr, {
- into "dist"
- })
-
- from(configurations.distSolrj - configurations.distSolr, {
- into "dist/solrj-lib"
- })
-
- from(configurations.example, {
- into "example"
- })
-
- from(configurations.server, {
- into "server"
- })
+distributions {
+ main {
+ distributionBaseName = 'solr'
+ contents {
+ // Manually correct posix permissions (matters when packaging on Windows).
+ filesMatching([
+ "**/*.sh",
+ "**/bin/post",
+ "**/bin/postlogs",
+ "**/bin/solr",
+ "**/bin/init.d/solr",
+ "**/bin/solr-exporter",
+ ]) {
+ setMode 0755
+ }
+
+ from(project(":solr").projectDir, {
+ include "bin/**"
+ include "licenses/**"
+ exclude "licenses/README.committers.txt"
+ include "CHANGES.txt"
+ include "LICENSE.txt"
+ include "NOTICE.txt"
+ include "README.md"
+ })
+
+ from(project(":lucene").projectDir, {
+ include "CHANGES.txt"
+ rename { file -> 'LUCENE_CHANGES.txt' }
+ })
+
+ from(configurations.contrib, {
+ into "contrib"
+ })
+
+ from(configurations.distSolr, {
+ into "dist"
+ })
+
+ from(configurations.distSolrj - configurations.distSolr, {
+ into "dist/solrj-lib"
+ })
+
+ from(configurations.example, {
+ into "example"
+ })
+
+ from(configurations.server, {
+ into "server"
+ })
+
+ // docs/ - TODO: this is assembled via XSLT... leaving out for now.
+ }
+ }
+}
- // docs/ - TODO: this is assembled via XSLT... leaving out for now.
+distTar {
+ compression = Compression.GZIP
+}
+installDist {
into distDir
-
- doLast {
- logger.lifecycle "Solr distribution assembled under: ${distDir}"
- }
}
task dev(type: Copy) {
description "Assemble Solr distribution into 'development' folder at ${devDir}"
group "build"
- from toDir.outputs
+ from installDist.outputs
into devDir
}
-assemble.dependsOn toDir
-
+assemble.dependsOn installDist