Compile and test scm-webapp

This commit is contained in:
Sebastian Sdorra
2020-12-21 07:42:21 +01:00
committed by René Pfeuffer
parent 290e7decd8
commit 7e6257ec48
6 changed files with 386 additions and 0 deletions

View File

@@ -0,0 +1,109 @@
/*
* 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.
*/
package sonia.scm;
//~--- non-JDK imports --------------------------------------------------------
import java.io.File;
import java.nio.file.Path;
/**
*
* @author Sebastian Sdorra
*/
public class TempSCMContextProvider implements SCMContextProvider
{
/**
* Method description
*
*
* @return
*/
@Override
public File getBaseDirectory()
{
return baseDirectory;
}
/**
* Method description
*
*
* @return
*/
@Override
public Stage getStage()
{
return Stage.DEVELOPMENT;
}
/**
* Method description
*
*
* @return
*/
@Override
public Throwable getStartupError()
{
return null;
}
/**
* Method description
*
*
* @return
*/
@Override
public String getVersion()
{
return "900.0.1-SNAPSHOT";
}
//~--- set methods ----------------------------------------------------------
/**
* Method description
*
*
* @param baseDirectory
*/
public void setBaseDirectory(File baseDirectory)
{
this.baseDirectory = baseDirectory;
}
@Override
public Path resolve(Path path) {
return baseDirectory.toPath().resolve(path);
}
//~--- fields ---------------------------------------------------------------
/** Field description */
private File baseDirectory;
}

View File

@@ -0,0 +1 @@
sonia.scm.TempSCMContextProvider

66
scm-ui/build.gradle Normal file
View File

@@ -0,0 +1,66 @@
/*
* 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 'com.github.node-gradle.node' version '2.2.4'
}
node {
download = true
version = '14.15.1'
yarnVersion = '1.22.5'
nodeModulesDir = file("${project.rootProject.projectDir}")
}
// TODO define inputs and outputs
task typecheck(type: YarnTask) {
args = ['run', 'typecheck']
dependsOn('yarn_install')
}
task test(type: YarnTask) {
args = ['run', 'test']
dependsOn('yarn_install')
}
task check(type: YarnTask) {
dependsOn('typecheck', 'test')
}
task build(type: YarnTask) {
args = ['run', 'build']
dependsOn('yarn_install')
}
task deploy(type: YarnTask) {
args = ['run', 'deploy', project.version]
dependsOn('yarn_install')
}
task setVersion(type: YarnTask) {
args = ['run', 'set-version', project.version]
dependsOn('yarn_install')
}

206
scm-webapp/build.gradle Normal file
View File

@@ -0,0 +1,206 @@
/*
* 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 'io.swagger.core.v3.swagger-gradle-plugin' version '2.1.6'
}
dependencies {
implementation platform(project(':'))
implementation project(':scm-core')
implementation project(':scm-dao-xml')
testImplementation project(':scm-test')
annotationProcessor project(':scm-annotation-processor')
// servlet api TODO version
providedCompile 'javax.servlet:javax.servlet-api:3.0.1'
testImplementation 'javax.servlet:javax.servlet-api'
// security
implementation 'org.apache.shiro:shiro-web:1.7.0' // TODO
implementation 'org.apache.shiro:shiro-guice:1.7.0' // TODO
// jwt
implementation 'io.jsonwebtoken:jjwt-api:0.11.2'
implementation 'io.jsonwebtoken:jjwt-impl:0.11.2'
implementation 'io.jsonwebtoken:jjwt-jackson:0.11.2'
// gpg
implementation 'org.bouncycastle:bcpg-jdk15on:1.67'
implementation 'org.bouncycastle:bcprov-jdk15on:1.67'
implementation 'org.bouncycastle:bcpkix-jdk15on:1.67'
// json TODO versions
implementation 'com.fasterxml.jackson.module:jackson-module-jaxb-annotations:2.11.3'
implementation 'com.fasterxml.jackson.jaxrs:jackson-jaxrs-base:2.11.3'
implementation 'com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:2.11.3'
implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.11.3'
implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.11.3'
// rest api TODO versions
implementation 'org.jboss.resteasy:resteasy-jaxb-provider:4.5.8.Final'
implementation 'org.jboss.resteasy:resteasy-jackson2-provider:4.5.8.Final'
implementation 'org.jboss.resteasy:resteasy-multipart-provider:4.5.8.Final'
implementation 'org.jboss.resteasy:resteasy-guice:4.5.8.Final'
implementation 'org.jboss.resteasy:resteasy-servlet-initializer:4.5.8.Final'
implementation 'org.jboss.resteasy:resteasy-validator-provider:4.5.8.Final'
// openapi
compileOnly 'io.swagger.core.v3:swagger-jaxrs2:2.1.6'
// validation
implementation 'org.hibernate.validator:hibernate-validator:6.1.6.Final'
implementation 'javax.el:javax.el-api:3.0.0'
implementation 'org.glassfish:javax.el:3.0.1-b11'
// logging
implementation 'ch.qos.logback:logback-classic'
// api 'org.slf4j:jcl-over-slf4j' from core, but why?
implementation 'org.slf4j:log4j-over-slf4j:1.7.30'
// utils
implementation 'com.google.guava:guava'
// cron expression
implementation 'com.cronutils:cron-utils:9.1.3'
// templates
implementation 'com.github.spullara.mustache.java:compiler:0.9.7'
// static resources
implementation 'com.github.sdorra:web-resources:1.1.1'
// content type detection
implementation 'com.github.sdorra:spotter-core:3.0.1'
implementation 'org.apache.tika:tika-core:1.25'
// restart on unix
implementation 'org.kohsuke:akuma:1.10'
// native access
implementation 'net.java.dev.jna:jna:5.6.0'
// lombok
compileOnly 'org.projectlombok:lombok'
testCompileOnly 'org.projectlombok:lombok'
// TODO version from parent
annotationProcessor 'org.projectlombok:lombok:1.18.10'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.10'
// dto mapping
annotationProcessor 'org.mapstruct:mapstruct-processor'
// selenium TODO do we need this?
// testImplementation 'org.seleniumhq.selenium:selenium-java:2.53.1'
// testImplementation 'org.seleniumhq.selenium:selenium-firefox-driver:2.53.1'
// testImplementation 'org.seleniumhq.selenium:htmlunit-driver:2.21'
// rest api client TODO do we need this?
testImplementation 'com.sun.jersey:jersey-client:1.19.4'
testImplementation 'com.sun.jersey.contribs:jersey-apache-client:1.19.4'
// async
testImplementation 'org.awaitility:awaitility:4.0.2'
// shiro unit
testImplementation 'com.github.sdorra:shiro-unit:1.0.1'
}
/**
WTF???
<!-- fix javadoc -->
<dependency>
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
<version>1.1</version>
<scope>provided</scope>
</dependency>
<!--
fix java.lang.NoClassDefFoundError org/w3c/dom/ElementTraversal
-->
<dependency>
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
<version>1.4.01</version>
</dependency>
<!-- core plugins -->
<dependency>
<groupId>sonia.scm.plugins</groupId>
<artifactId>scm-git-plugin</artifactId>
<version>2.13.0-SNAPSHOT</version>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>sonia.scm.plugins</groupId>
<artifactId>scm-git-plugin</artifactId>
<version>2.13.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>sonia.scm.plugins</groupId>
<artifactId>scm-hg-plugin</artifactId>
<version>2.13.0-SNAPSHOT</version>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>sonia.scm.plugins</groupId>
<artifactId>scm-hg-plugin</artifactId>
<version>2.13.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>sonia.scm.plugins</groupId>
<artifactId>scm-svn-plugin</artifactId>
<version>2.13.0-SNAPSHOT</version>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>sonia.scm.plugins</groupId>
<artifactId>scm-svn-plugin</artifactId>
<version>2.13.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
**/
test {
useJUnitPlatform()
// TODO integration tests
exclude '**/*ITCase.class'
}

View File

@@ -90,6 +90,9 @@ import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import sonia.scm.TempSCMContextProvider;
//~--- JDK imports ------------------------------------------------------------
/**

View File

@@ -31,3 +31,4 @@ include('scm-test')
// include('scm-ui')
// include('scm-plugins')
include('scm-dao-xml')
include('scm-webapp')