davos/build.gradle

136 lines
3.2 KiB
Groovy

import java.util.regex.Matcher;
buildscript {
ext {
springBootVersion = '1.4.2.RELEASE'
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
classpath('io.spring.gradle:dependency-management-plugin:0.6.1.RELEASE')
}
}
plugins {
id "com.github.samueltbrown.cucumber" version "0.9"
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
jar {
baseName = 'davos'
version = file('version.txt').text.trim()
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
mavenCentral()
}
configurations {
all*.exclude module : 'spring-boot-starter-logging'
bddTestCompile
testCompile.extendsFrom bddTestCompile
}
sourceSets {
bbdTest {
java { srcDir 'src/cucumber/java' }
resources { srcDir 'src/cucumber/resources' }
compileClasspath += test.output
}
}
dependencies {
compile 'org.springframework.boot:spring-boot-starter-web'
compile 'org.springframework.boot:spring-boot-starter-thymeleaf'
compile 'org.springframework.boot:spring-boot-starter-data-jpa'
compile 'org.springframework.boot:spring-boot-starter-jdbc'
compile 'org.apache.logging.log4j:log4j-api:2.16.0'
compile 'org.apache.logging.log4j:log4j-core:2.16.0'
compile 'org.apache.logging.log4j:log4j-slf4j-impl:2.16.0'
compile 'com.jcraft:jsch:0.1.50'
compile 'joda-time:joda-time:2.3'
compile 'commons-net:commons-net:3.3'
compile 'commons-io:commons-io:2.4'
compile 'org.apache.commons:commons-lang3:3.4'
compile 'com.amazonaws:aws-java-sdk-sns:1.11.167'
runtime 'com.h2database:h2'
testCompile 'org.springframework.boot:spring-boot-starter-test'
testCompile 'org.assertj:assertj-core:3.2.0'
testCompile 'org.mockito:mockito-all:1.9.5'
testCompile 'junit:junit:4.11'
bddTestCompile 'org.mockftpserver:MockFtpServer:2.6'
bddTestCompile 'org.apache.sshd:sshd-core:1.4.0'
bddTestCompile 'info.cukes:cucumber-java:1.2.4'
cucumberCompile 'info.cukes:cucumber-java:1.2.4'
}
eclipse {
classpath {
containers.remove('org.eclipse.jdt.launching.JRE_CONTAINER')
containers 'org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8'
}
}
task wrapper(type: Wrapper) {
gradleVersion = '2.14'
}
task updateBuildVersion << {
Matcher matcher = file('version.txt').text.trim() =~ /(.+)\.(.+)\.(.+)$/
if (matcher.find()) {
String major = matcher.group(1)
String minor = matcher.group(2)
String patch = matcher.group(3).trim()
int nextBuild = Integer.valueOf(patch) + 1
String updatedVersion = "${major}.${minor}.${nextBuild}"
file('version.txt').text = "${updatedVersion}\n"
}
}
task copyConfig(type: Copy) {
def location = project.hasProperty('env') ? "$env" : 'local'
from "conf/${location}"
into "src/main/resources/"
}
cucumber {
jvmOptions {
maxHeapSize = '512m'
environment 'ENV', 'staging'
}
}
build.dependsOn copyConfig
build.mustRunAfter copyConfig