blob: a017a0dd55b784f54edbab5cfde755e562970031 [file] [log] [blame]
/*
* 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.
*/
// This project puts together a "distribution", assembling dependencies from
// various other projects.
plugins {
id 'base'
id 'distribution'
}
description = 'Solr packaging'
ext {
distDir = file("$buildDir/solr-${version}")
devDir = file("$buildDir/dev")
}
configurations {
distSolr {
transitive = false
}
distSolrj
contrib
example
server
}
dependencies {
distSolrj project(":solr:solrj")
[":solr:contrib:analysis-extras",
":solr:contrib:analytics",
":solr:contrib:extraction",
":solr:contrib:clustering",
":solr:contrib:jaegertracer-configurator",
":solr:contrib:langid",
":solr:contrib:ltr",
":solr:contrib:prometheus-exporter",
].each { contribName ->
distSolr project(contribName)
contrib project(path: contribName, configuration: "packaging")
}
distSolr project(":solr:core")
distSolr project(":solr:solrj")
distSolr project(":solr:test-framework")
example project(path: ":solr:example", configuration: "packaging")
server project(path: ":solr:server", configuration: "packaging")
}
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.
}
}
}
distTar {
compression = Compression.GZIP
}
installDist {
into distDir
}
task dev(type: Copy) {
description "Assemble Solr distribution into 'development' folder at ${devDir}"
group "build"
from installDist.outputs
into devDir
}
assemble.dependsOn installDist