Files
SCM-Manager/scm-packaging/unix/build.gradle

145 lines
3.4 KiB
Groovy
Raw Normal View History

2020-12-22 14:56:01 +01:00
/*
* MIT License
*
* Copyright (c) 2020-present Cloudogu GmbH and Contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
import org.gradle.util.VersionNumber
plugins {
id 'org.scm-manager.packaging'
id 'signing'
2021-01-11 09:47:03 +01:00
id 'maven-publish'
id 'com.github.hierynomus.license-base' version '0.15.0'
}
2020-12-22 14:56:01 +01:00
configurations {
server
webapp
jsvc
unixPkg
2021-01-05 16:21:47 +01:00
packageYaml {
canBeConsumed = true
}
2020-12-22 14:56:01 +01:00
}
dependencies {
server project(':scm-server')
webapp project(path: ':scm-webapp', configuration: 'webapp')
jsvc libraries.jsvc
2020-12-22 14:56:01 +01:00
}
task unix(type: Tar) {
2020-12-22 14:56:01 +01:00
VersionNumber version = VersionNumber.parse(project.version)
archiveFileName = "unix-${project.version}-app.tar.gz"
2020-12-22 14:56:01 +01:00
into('scm-server') {
into('conf') {
from 'src/main/fs/conf'
include 'server-config.xml'
expand([version: version])
}
from('src/main/fs') {
exclude('**/server-config.xml')
}
into('bin') {
from('src/main/bin') {
fileMode 0755
}
}
into('lib') {
from project.configurations.server
}
into('var/webapp') {
from project.configurations.webapp
rename {
'scm-webapp.war'
}
}
}
project.configurations.jsvc.each { archive ->
into('.') {
from tarTree(archive)
include '**/jsvc*'
eachFile { fcd ->
fcd.relativePath = new RelativePath(true, "scm-server/libexec/${fcd.name}")
}
includeEmptyDirs = false
}
}
destinationDir file('build/libs')
compression = Compression.GZIP
}
2021-01-05 16:21:47 +01:00
task distribution(type: PackageYaml) {
type = 'unix'
artifact = file("build/libs/unix-${project.version}-app.tar.gz")
dependsOn unix
}
2021-01-05 16:21:47 +01:00
artifacts {
unixPkg unix
2021-01-05 16:21:47 +01:00
packageYaml(file('build/libs/package.yml')) {
builtBy distribution
}
}
signing {
2021-01-11 09:47:03 +01:00
sign publishing.publications
}
publishing {
publications {
mavenJava(MavenPublication) {
groupId "sonia.scm.packaging"
artifactId project.name
version project.version
artifact(unix) {
extension 'tar.gz'
}
}
}
}
2021-01-06 17:34:24 +01:00
2021-01-11 09:47:03 +01:00
project.rootProject.publishing.repositories.each { r ->
project.publishing.repositories.add(r)
}
2021-01-06 17:34:24 +01:00
license {
header rootProject.file("LICENSE.txt")
strictCheck true
mapping {
gradle = 'SLASHSTAR_STYLE'
}
exclude '**/build/**'
exclude '**/*.txt'
include '**/src/**'
include 'build.gradle'
}
task license(type: com.hierynomus.gradle.license.tasks.LicenseCheck) {
source = fileTree('.')
}