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:
@@ -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
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
apply plugin: VerifyMongoDBConfigurationPlugin
|
||||
|
||||
dependencies {
|
||||
|
||||
testCompile project(":commandside-backend-accounts")
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
|
||||
org.gradle.jvmargs=-XX:MaxPermSize=512m
|
||||
rxJavaVersion=0.20.4
|
||||
|
||||
scalaTestDependency=org.scalatest:scalatest_2.10:2.0
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
apply plugin: VerifyMongoDBConfigurationPlugin
|
||||
|
||||
apply plugin: 'spring-boot'
|
||||
|
||||
dependencies {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
apply plugin: 'scala'
|
||||
apply plugin: VerifyMongoDBConfigurationPlugin
|
||||
|
||||
dependencies {
|
||||
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
|
||||
org.gradle.jvmargs=-XX:MaxPermSize=512m
|
||||
rxJavaVersion=0.20.4
|
||||
|
||||
scalaTestDependency=org.scalatest:scalatest_2.10:2.0
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
apply plugin: 'scala'
|
||||
apply plugin: 'spring-boot'
|
||||
apply plugin: VerifyMongoDBConfigurationPlugin
|
||||
|
||||
dependencies {
|
||||
compile "org.scala-lang:scala-library:2.10.2"
|
||||
|
||||
Reference in New Issue
Block a user