Files
SCM-Manager/build.gradle

157 lines
4.0 KiB
Groovy
Raw Normal View History

/*
* 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.
*/
plugins {
id 'java-platform'
2021-01-07 15:19:40 +01:00
id 'maven-publish'
}
2021-01-07 15:19:40 +01:00
subprojects { s ->
repositories {
maven {
url 'https://packages.scm-manager.org/repository/public/'
}
}
}
2021-01-06 17:34:24 +01:00
allprojects {
apply from: rootProject.file('gradle/dependencies.gradle')
}
2021-01-07 15:19:40 +01:00
publishing {
publications {
mavenJava(MavenPublication) {
artifactId project.name
from components.javaPlatform
}
}
repositories {
maven {
url = "/tmp/repo"
}
}
}
dependencies {
constraints {
2020-12-18 14:14:07 +01:00
// lombok
api libraries.lombok
2020-12-18 14:14:07 +01:00
// servlet api
api libraries.servletApi
2020-12-18 14:14:07 +01:00
// logging
api libraries.slf4jApi
api libraries.slf4jJcl
api libraries.logback
2020-12-18 14:14:07 +01:00
// injection
api libraries.guice
api libraries.guiceMultibindings
api libraries.guiceServlet
api libraries.guiceThrowingproviders
api libraries.guiceAssistedinject
2020-12-18 14:14:07 +01:00
// rest api
api libraries.jaxRs
api libraries.resteasyCore
2020-12-18 14:14:07 +01:00
// json
api libraries.jacksonCore
api libraries.jacksonAnnotations
api libraries.jacksonDatabind
2020-12-18 14:14:07 +01:00
// hypermedia
api libraries.edison
2020-12-18 14:14:07 +01:00
// dto mapping
api libraries.mapstruct
api libraries.mapstructProcessor
2020-12-18 14:14:07 +01:00
// events
api libraries.legman
2020-12-18 14:14:07 +01:00
// xml binding
api libraries.jaxbApi
api libraries.jaxbRuntime
2020-12-18 14:14:07 +01:00
// validation
api libraries.validator
api libraries.elApi
api libraries.elRuntime
2020-12-18 14:14:07 +01:00
// utils
api libraries.guava
api libraries.commonsLang
2020-12-18 14:14:07 +01:00
// security
api libraries.shiroCore
api libraries.ssp
api libraries.sspProcessor
api libraries.shiroUnit
2020-12-18 14:14:07 +01:00
// tests
api libraries.junitJupiterApi
api libraries.junitJupiterParams
api libraries.junitJupiterEngine
2020-12-18 14:14:07 +01:00
// junit 4 support
api libraries.junitVintageEngine
api libraries.junit
2020-12-18 14:14:07 +01:00
// assertions
api libraries.hamcrestCore
api libraries.hamcrestLibrary
api libraries.assertj
2020-12-18 14:14:07 +01:00
// mocking
api libraries.mockitoCore
api libraries.mockitoJunitJupiter
}
}
2020-12-23 11:18:55 +01:00
// set build props
project.ext {
timestamp = new Date().format('yyyyMMddHHmmSS')
revision = "git rev-parse --short HEAD".execute().text.trim()
if (project.version.contains('-SNAPSHOT')) {
2021-01-11 13:31:52 +01:00
isSnapshot = true
2020-12-23 11:18:55 +01:00
expandedVersion = project.version.replace('SNAPSHOT', timestamp)
expandedVersionWithDot = project.version.replace('-SNAPSHOT', ".${timestamp}")
dockerRepository = 'docker.io/cloudogu/scm-manager'
String snapshotVersion = revision
def buildNumber = System.getenv('BUILD_NUMBER')
if (buildNumber != null) {
snapshotVersion += "-${buildNumber}"
}
2021-01-06 17:34:24 +01:00
dockerTag = version.replace('SNAPSHOT', snapshotVersion)
2020-12-23 11:18:55 +01:00
} else {
2021-01-11 13:31:52 +01:00
isSnapshot = false
2020-12-23 11:18:55 +01:00
expandedVersion = project.version
expandedVersionWithDot = project.version
dockerRepository = 'docker.io/scmmanager/scm-manager'
2021-01-06 17:34:24 +01:00
dockerTag = version.replace('SNAPSHOT', snapshotVersion)
2020-12-23 11:18:55 +01:00
}
}