| 
									
										
										
										
											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' | 
					
						
							| 
									
										
										
										
											2021-01-06 11:41:13 +01:00
										 |  |  |   id 'org.scm-manager.java' | 
					
						
							| 
									
										
										
										
											2021-01-11 16:28:17 +01:00
										 |  |  |   id 'org.scm-manager.run' | 
					
						
							| 
									
										
										
										
											2021-01-06 11:41:13 +01:00
										 |  |  |   id 'org.scm-manager.core-plugins' | 
					
						
							| 
									
										
										
										
											2023-11-29 18:14:03 +01:00
										 |  |  |   id 'io.swagger.core.v3.swagger-gradle-plugin' version '2.2.19' | 
					
						
							| 
									
										
										
										
											2020-12-21 07:42:21 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-12-21 16:19:56 +01:00
										 |  |  | configurations { | 
					
						
							|  |  |  |   assets | 
					
						
							| 
									
										
										
										
											2020-12-22 14:56:01 +01:00
										 |  |  |   webapp { | 
					
						
							|  |  |  |     canBeConsumed = true | 
					
						
							|  |  |  |     canBeResolved = false | 
					
						
							| 
									
										
										
										
											2023-11-29 18:14:03 +01:00
										 |  |  |     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 16:19:56 +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') | 
					
						
							| 
									
										
										
										
											2020-12-21 16:19:56 +01:00
										 |  |  |   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') | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-01-06 15:13:55 +01:00
										 |  |  |   // servlet api
 | 
					
						
							| 
									
										
										
										
											2021-01-04 15:07:20 +01:00
										 |  |  |   providedCompile libraries.servletApi | 
					
						
							|  |  |  |   testImplementation libraries.servletApi | 
					
						
							| 
									
										
										
										
											2020-12-21 07:42:21 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |   // security
 | 
					
						
							| 
									
										
										
										
											2021-01-04 15:07:20 +01:00
										 |  |  |   implementation libraries.shiroWeb | 
					
						
							|  |  |  |   implementation libraries.shiroGuice | 
					
						
							| 
									
										
										
										
											2020-12-21 07:42:21 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-05-20 10:58:21 +02:00
										 |  |  |   // tests
 | 
					
						
							|  |  |  |   testImplementation libraries.junitPioneer | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-12-21 07:42:21 +01:00
										 |  |  |   // jwt
 | 
					
						
							| 
									
										
										
										
											2021-01-04 15:07:20 +01:00
										 |  |  |   implementation libraries.jjwtApi | 
					
						
							|  |  |  |   implementation libraries.jjwtRuntime | 
					
						
							|  |  |  |   implementation libraries.jjwtJackson | 
					
						
							| 
									
										
										
										
											2020-12-21 07:42:21 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |   // gpg
 | 
					
						
							| 
									
										
										
										
											2021-01-04 15:07:20 +01:00
										 |  |  |   implementation libraries.bouncycastlePg | 
					
						
							|  |  |  |   implementation libraries.bouncycastleProv | 
					
						
							|  |  |  |   implementation libraries.bouncycastlePkix | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-05-08 15:28:53 +02:00
										 |  |  |   implementation 'org.pgpainless:pgpainless-core:1.5.0' | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-01-04 15:07:20 +01:00
										 |  |  |   // json
 | 
					
						
							|  |  |  |   implementation libraries.jacksonJaxbAnnotations | 
					
						
							|  |  |  |   implementation libraries.jacksonJaxRsBase | 
					
						
							|  |  |  |   implementation libraries.jacksonJaxRsJsonProvider | 
					
						
							|  |  |  |   implementation libraries.jacksonDatatypeJdk8 | 
					
						
							|  |  |  |   implementation libraries.jacksonDatatypeJsr310 | 
					
						
							| 
									
										
										
										
											2023-11-29 18:14:03 +01:00
										 |  |  |   implementation libraries.jacksonDataFormatYaml | 
					
						
							| 
									
										
										
										
											2021-01-04 15:07:20 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |   // rest api
 | 
					
						
							|  |  |  |   implementation libraries.resteasyJaxbProvider | 
					
						
							|  |  |  |   implementation libraries.resteasyJackson2Provider | 
					
						
							|  |  |  |   implementation libraries.resteasyMultiartProvider | 
					
						
							|  |  |  |   implementation libraries.resteasyServletInitializer | 
					
						
							|  |  |  |   implementation libraries.resteasyValidatorProvider | 
					
						
							| 
									
										
										
										
											2023-11-29 18:14:03 +01:00
										 |  |  |   implementation "org.apache.httpcomponents:httpcore:4.4.16" | 
					
						
							| 
									
										
										
										
											2020-12-21 07:42:21 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |   // openapi
 | 
					
						
							| 
									
										
										
										
											2021-01-04 15:07:20 +01:00
										 |  |  |   compileOnly libraries.swaggerJaxRs | 
					
						
							| 
									
										
										
										
											2020-12-21 07:42:21 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |   // logging
 | 
					
						
							| 
									
										
										
										
											2021-01-04 15:07:20 +01:00
										 |  |  |   implementation libraries.logback | 
					
						
							| 
									
										
										
										
											2020-12-21 07:42:21 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |   // cron expression
 | 
					
						
							| 
									
										
										
										
											2021-01-04 15:07:20 +01:00
										 |  |  |   implementation libraries.cronUtils | 
					
						
							| 
									
										
										
										
											2020-12-21 07:42:21 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |   // templates
 | 
					
						
							| 
									
										
										
										
											2021-01-04 15:07:20 +01:00
										 |  |  |   implementation libraries.mustache | 
					
						
							| 
									
										
										
										
											2020-12-21 07:42:21 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |   // static resources
 | 
					
						
							| 
									
										
										
										
											2021-01-04 15:07:20 +01:00
										 |  |  |   implementation libraries.webResources | 
					
						
							| 
									
										
										
										
											2020-12-21 07:42:21 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |   // content type detection
 | 
					
						
							| 
									
										
										
										
											2021-01-04 15:07:20 +01:00
										 |  |  |   implementation libraries.spotter | 
					
						
							|  |  |  |   implementation libraries.tika | 
					
						
							| 
									
										
										
										
											2020-12-21 07:42:21 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |   // restart on unix
 | 
					
						
							| 
									
										
										
										
											2021-01-04 15:07:20 +01:00
										 |  |  |   implementation libraries.akuma | 
					
						
							| 
									
										
										
										
											2020-12-21 07:42:21 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |   // native access
 | 
					
						
							| 
									
										
										
										
											2021-01-04 15:07:20 +01:00
										 |  |  |   implementation libraries.jna | 
					
						
							| 
									
										
										
										
											2020-12-21 07:42:21 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-01-05 16:24:11 +01:00
										 |  |  |   // util
 | 
					
						
							|  |  |  |   implementation libraries.commonsCompress | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-03-24 15:54:29 +01:00
										 |  |  |   // events
 | 
					
						
							|  |  |  |   implementation libraries.legmanShiro | 
					
						
							|  |  |  |   implementation libraries.legmanMicrometer | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-03-26 09:28:01 +01:00
										 |  |  |   // metrics
 | 
					
						
							|  |  |  |   implementation libraries.micrometerExtra | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-07-14 11:49:38 +02:00
										 |  |  |   implementation libraries.luceneCore | 
					
						
							|  |  |  |   implementation libraries.luceneQueryParser | 
					
						
							|  |  |  |   implementation libraries.luceneHighlighter | 
					
						
							|  |  |  |   implementation libraries.luceneAnalyzersCommon | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-12-21 07:42:21 +01:00
										 |  |  |   // lombok
 | 
					
						
							| 
									
										
										
										
											2021-01-04 15:07:20 +01:00
										 |  |  |   compileOnly libraries.lombok | 
					
						
							|  |  |  |   testCompileOnly libraries.lombok | 
					
						
							|  |  |  |   annotationProcessor libraries.lombok | 
					
						
							|  |  |  |   testAnnotationProcessor libraries.lombok | 
					
						
							| 
									
										
										
										
											2020-12-21 07:42:21 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |   // dto mapping
 | 
					
						
							| 
									
										
										
										
											2021-01-04 15:07:20 +01:00
										 |  |  |   annotationProcessor libraries.mapstructProcessor | 
					
						
							| 
									
										
										
										
											2020-12-21 07:42:21 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-01-04 15:07:20 +01:00
										 |  |  |   // testing async code
 | 
					
						
							|  |  |  |   testImplementation libraries.awaitility | 
					
						
							| 
									
										
										
										
											2020-12-21 07:42:21 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |   // shiro unit
 | 
					
						
							| 
									
										
										
										
											2021-01-04 15:07:20 +01:00
										 |  |  |   testImplementation libraries.shiroUnit | 
					
						
							| 
									
										
										
										
											2023-11-29 18:14:03 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |   // 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' | 
					
						
							| 
									
										
										
										
											2020-12-21 16:19:56 +01:00
										 |  |  |   from project.configurations.assets | 
					
						
							| 
									
										
										
										
											2021-01-07 10:04:09 +01:00
										 |  |  |   into('WEB-INF/classes/META-INF/scm') { | 
					
						
							|  |  |  |     from('build/openapi') | 
					
						
							|  |  |  |   } | 
					
						
							| 
									
										
										
										
											2021-11-29 09:05:24 +01:00
										 |  |  |   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 09:26:20 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-12-22 14:56:01 +01:00
										 |  |  | artifacts { | 
					
						
							|  |  |  |   webapp(war) | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-12-22 09:26:20 +01:00
										 |  |  | // war without assets for development and livereload
 | 
					
						
							| 
									
										
										
										
											2023-11-29 18:14:03 +01:00
										 |  |  | task 'dev-war'(type: War) { | 
					
						
							| 
									
										
										
										
											2020-12-22 09:26:20 +01:00
										 |  |  |   archiveName 'scm-webapp-dev.war' | 
					
						
							|  |  |  |   from 'build/war' | 
					
						
							| 
									
										
										
										
											2023-11-29 18:14:03 +01:00
										 |  |  |   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') | 
					
						
							|  |  |  |   } | 
					
						
							| 
									
										
										
										
											2021-11-29 09:05:24 +01:00
										 |  |  |   duplicatesStrategy 'WARN' | 
					
						
							| 
									
										
										
										
											2021-04-30 16:05:14 +02:00
										 |  |  |   dependsOn 'copy-core-plugins', 'resolve' | 
					
						
							| 
									
										
										
										
											2020-12-22 09:26:20 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-12-23 16:33:35 +01:00
										 |  |  | scmServer { | 
					
						
							|  |  |  |   liveReload = true | 
					
						
							|  |  |  |   openBrowser = true | 
					
						
							|  |  |  |   warFile = file('build/libs/scm-webapp-dev.war') | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-01-11 16:28:17 +01:00
										 |  |  | run { | 
					
						
							| 
									
										
										
										
											2020-12-22 09:26:20 +01:00
										 |  |  |   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') | 
					
						
							| 
									
										
										
										
											2021-11-29 09:05:24 +01:00
										 |  |  |   openApiFile = file('build/openapi_tmp/openapi.yml') | 
					
						
							| 
									
										
										
										
											2023-11-29 18:14:03 +01:00
										 |  |  |   setBuildClasspath(project.configurations.swaggerCoreDeps) | 
					
						
							| 
									
										
										
										
											2021-01-07 10:04:09 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | task prepareOpenAPI(type: Copy) { | 
					
						
							|  |  |  |   from 'src/main/doc/openapi.yml' | 
					
						
							| 
									
										
										
										
											2021-11-29 09:05:24 +01:00
										 |  |  |   into 'build/openapi_tmp' | 
					
						
							|  |  |  |   duplicatesStrategy 'WARN' | 
					
						
							| 
									
										
										
										
											2021-01-07 10:04:09 +01:00
										 |  |  |   expand(version: project.version) | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-11-29 18:14:03 +01:00
										 |  |  | repositories { | 
					
						
							|  |  |  |   mavenCentral() | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-01-07 10:04:09 +01:00
										 |  |  | tasks.getByName("resolve").configure { | 
					
						
							|  |  |  |   dependsOn 'prepareOpenAPI' | 
					
						
							|  |  |  | } |