Files
SCM-Manager/scm-webapp/build.gradle

227 lines
6.5 KiB
Groovy
Raw Normal View History

2020-12-21 07:42:21 +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.
*/
plugins {
id 'war'
id 'org.scm-manager.java'
id 'org.scm-manager.run'
id 'org.scm-manager.core-plugins'
id 'io.swagger.core.v3.swagger-gradle-plugin' version '2.2.19'
2020-12-21 07:42:21 +01:00
}
configurations {
assets
2020-12-22 14:56:01 +01:00
webapp {
canBeConsumed = true
canBeResolved = false
create("swaggerCoreDeps").defaultDependencies(new Action<DependencySet>() {
@Override
void execute(DependencySet dependencies) {
dependencies.add(project.getDependencies().create("org.apache.commons:commons-lang3:3.12.0"))
dependencies.add(project.getDependencies().create("jakarta.ws.rs:jakarta.ws.rs-api:3.1.0"))
dependencies.add(project.getDependencies().create("jakarta.servlet:jakarta.servlet-api:6.0.0"))
dependencies.add(project.getDependencies().create("io.swagger.core.v3:swagger-jaxrs2-jakarta:2.2.19"))
dependencies.add(project.getDependencies().create("com.fasterxml.jackson.core:jackson-core:2.15.2"))
}
})
2020-12-22 14:56:01 +01:00
}
}
2020-12-21 07:42:21 +01:00
dependencies {
implementation platform(project(':'))
2020-12-21 15:22:24 +01:00
corePlugin project(path: ':scm-plugins:scm-git-plugin', configuration: 'smp')
corePlugin project(path: ':scm-plugins:scm-hg-plugin', configuration: 'smp')
corePlugin project(path: ':scm-plugins:scm-svn-plugin', configuration: 'smp')
2021-01-11 16:33:58 +01:00
corePlugin project(path: ':scm-plugins:scm-legacy-plugin', configuration: 'smp')
assets project(path: ':scm-ui', configuration: 'assets')
2020-12-21 15:22:24 +01:00
2020-12-21 07:42:21 +01:00
implementation project(':scm-core')
implementation project(':scm-dao-xml')
testImplementation project(':scm-test')
annotationProcessor project(':scm-annotation-processor')
// servlet api
providedCompile libraries.servletApi
testImplementation libraries.servletApi
2020-12-21 07:42:21 +01:00
// security
implementation libraries.shiroWeb
implementation libraries.shiroGuice
2020-12-21 07:42:21 +01:00
// tests
testImplementation libraries.junitPioneer
2020-12-21 07:42:21 +01:00
// jwt
implementation libraries.jjwtApi
implementation libraries.jjwtRuntime
implementation libraries.jjwtJackson
2020-12-21 07:42:21 +01:00
// gpg
implementation libraries.bouncycastlePg
implementation libraries.bouncycastleProv
implementation libraries.bouncycastlePkix
implementation 'org.pgpainless:pgpainless-core:1.5.0'
// json
implementation libraries.jacksonJaxbAnnotations
implementation libraries.jacksonJaxRsBase
implementation libraries.jacksonJaxRsJsonProvider
implementation libraries.jacksonDatatypeJdk8
implementation libraries.jacksonDatatypeJsr310
implementation libraries.jacksonDataFormatYaml
// rest api
implementation libraries.resteasyJaxbProvider
implementation libraries.resteasyJackson2Provider
implementation libraries.resteasyMultiartProvider
implementation libraries.resteasyServletInitializer
implementation libraries.resteasyValidatorProvider
implementation "org.apache.httpcomponents:httpcore:4.4.16"
2020-12-21 07:42:21 +01:00
// openapi
compileOnly libraries.swaggerJaxRs
2020-12-21 07:42:21 +01:00
// logging
implementation libraries.logback
2020-12-21 07:42:21 +01:00
// cron expression
implementation libraries.cronUtils
2020-12-21 07:42:21 +01:00
// templates
implementation libraries.mustache
2020-12-21 07:42:21 +01:00
// static resources
implementation libraries.webResources
2020-12-21 07:42:21 +01:00
// content type detection
implementation libraries.spotter
implementation libraries.tika
2020-12-21 07:42:21 +01:00
// restart on unix
implementation libraries.akuma
2020-12-21 07:42:21 +01:00
// native access
implementation libraries.jna
2020-12-21 07:42:21 +01:00
2021-01-05 16:24:11 +01:00
// util
implementation libraries.commonsCompress
// events
implementation libraries.legmanShiro
implementation libraries.legmanMicrometer
// metrics
implementation libraries.micrometerExtra
implementation libraries.luceneCore
implementation libraries.luceneQueryParser
implementation libraries.luceneHighlighter
implementation libraries.luceneAnalyzersCommon
2020-12-21 07:42:21 +01:00
// lombok
compileOnly libraries.lombok
testCompileOnly libraries.lombok
annotationProcessor libraries.lombok
testAnnotationProcessor libraries.lombok
2020-12-21 07:42:21 +01:00
// dto mapping
annotationProcessor libraries.mapstructProcessor
2020-12-21 07:42:21 +01:00
// testing async code
testImplementation libraries.awaitility
2020-12-21 07:42:21 +01:00
// shiro unit
testImplementation libraries.shiroUnit
// plugin transformer
implementation 'org.eclipse.transformer:org.eclipse.transformer:0.5.0'
implementation 'org.eclipse.transformer:org.eclipse.transformer.jakarta:0.5.0'
2020-12-21 07:42:21 +01:00
}
2020-12-21 15:22:24 +01:00
war {
from 'build/war'
from project.configurations.assets
2021-01-07 10:04:09 +01:00
into('WEB-INF/classes/META-INF/scm') {
from('build/openapi')
}
duplicatesStrategy 'WARN'
2021-01-07 10:04:09 +01:00
dependsOn 'copy-core-plugins', 'resolve'
2020-12-21 15:22:24 +01:00
}
2020-12-22 14:56:01 +01:00
artifacts {
webapp(war)
}
// war without assets for development and livereload
task 'dev-war'(type: War) {
archiveName 'scm-webapp-dev.war'
from 'build/war'
into('WEB-INF/classes') {
from('src/main/conf/config.yml')
}
2021-04-30 16:05:14 +02:00
into('WEB-INF/classes/META-INF/scm') {
from('build/openapi')
}
duplicatesStrategy 'WARN'
2021-04-30 16:05:14 +02:00
dependsOn 'copy-core-plugins', 'resolve'
}
2020-12-23 16:33:35 +01:00
scmServer {
liveReload = true
openBrowser = true
warFile = file('build/libs/scm-webapp-dev.war')
}
run {
dependsOn 'dev-war'
}
2021-01-07 10:04:09 +01:00
resolve {
outputFileName = 'openapi'
outputFormat = 'JSONANDYAML'
prettyPrint = 'TRUE'
classpath = sourceSets.main.runtimeClasspath
resourcePackages = ['sonia.scm.api.v2.resources']
outputDir = file('build/openapi')
openApiFile = file('build/openapi_tmp/openapi.yml')
setBuildClasspath(project.configurations.swaggerCoreDeps)
2021-01-07 10:04:09 +01:00
}
task prepareOpenAPI(type: Copy) {
from 'src/main/doc/openapi.yml'
into 'build/openapi_tmp'
duplicatesStrategy 'WARN'
2021-01-07 10:04:09 +01:00
expand(version: project.version)
}
repositories {
mavenCentral()
}
2021-01-07 10:04:09 +01:00
tasks.getByName("resolve").configure {
dependsOn 'prepareOpenAPI'
}