Various cleanups

Changed gradle-all.sh so that Gradle JVM settings are picked up from grade.properties
Added Gradle plugin that verifies that SPRING_DATA_MONGODB_URI is set before running any tests that need MongoDB
This commit is contained in:
Chris Richardson
2015-01-05 15:35:27 -08:00
parent 1084dbe3a8
commit b5a34c6045
9 changed files with 37 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
#! /bin/bash -e
for dir in java-spring scala-spring; do
$dir/gradlew -b $dir/build.gradle $*
(cd $dir ; ./gradlew -b build.gradle $*)
done

View File

@@ -1,3 +1,5 @@
apply plugin: VerifyMongoDBConfigurationPlugin
dependencies {
testCompile project(":commandside-backend-accounts")

View File

@@ -0,0 +1,15 @@
import org.gradle.api.*
class VerifyMongoDBConfigurationPlugin implements Plugin<Project> {
void apply(Project project) {
project.test {
beforeSuite { x ->
if (x.parent == null) {
if (System.getenv("SPRING_DATA_MONGODB_URI") == null)
throw new RuntimeException("Please make sure that the environment variable SPRING_DATA_MONGODB_URI is set, e.g. export SPRING_DATA_MONGODB_URI=mongodb://192.168.59.103/mydb")
}
}
}
}
}

View File

@@ -1,6 +1,5 @@
org.gradle.jvmargs=-XX:MaxPermSize=512m
rxJavaVersion=0.20.4
scalaTestDependency=org.scalatest:scalatest_2.10:2.0

View File

@@ -1,3 +1,5 @@
apply plugin: VerifyMongoDBConfigurationPlugin
apply plugin: 'spring-boot'
dependencies {

View File

@@ -1,4 +1,5 @@
apply plugin: 'scala'
apply plugin: VerifyMongoDBConfigurationPlugin
dependencies {

View File

@@ -0,0 +1,15 @@
import org.gradle.api.*
class VerifyMongoDBConfigurationPlugin implements Plugin<Project> {
void apply(Project project) {
project.test {
beforeSuite { x ->
if (x.parent == null) {
if (System.getenv("SPRING_DATA_MONGODB_URI") == null)
throw new RuntimeException("Please make sure that the environment variable SPRING_DATA_MONGODB_URI is set, e.g. export SPRING_DATA_MONGODB_URI=mongodb://192.168.59.103/mydb")
}
}
}
}
}

View File

@@ -1,6 +1,5 @@
org.gradle.jvmargs=-XX:MaxPermSize=512m
rxJavaVersion=0.20.4
scalaTestDependency=org.scalatest:scalatest_2.10:2.0

View File

@@ -1,5 +1,6 @@
apply plugin: 'scala'
apply plugin: 'spring-boot'
apply plugin: VerifyMongoDBConfigurationPlugin
dependencies {
compile "org.scala-lang:scala-library:2.10.2"