Skip to content

Instantly share code, notes, and snippets.

@dleppik
Last active July 31, 2017 21:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dleppik/260d978bf4dcb023bb3218c051653a6c to your computer and use it in GitHub Desktop.
Save dleppik/260d978bf4dcb023bb3218c051653a6c to your computer and use it in GitHub Desktop.
Gradle configuration for EgTest
plugins {
id "net.ltgt.apt" version "0.9" // Annotation processing for non-Android projects
}
apply plugin: 'java'
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
apt 'com.vocalabs:egtest-processor:0.3.0' // change apt to annotationProcessor if compiling for Android
compileOnly 'com.vocalabs:egtest-annotations:0.3.0'
testCompile 'junit:junit:4.12'
}
compileJava.options.compilerArgs.add("-Aegtest.targetDirectory=$buildDir/generated/egTest") // Specify output directory
// Uncomment if you want to write your examples in Groovy
// compileJava.options.compilerArgs.add("-Aegtest.targetLanguage=GROOVY")
// Uncomment if your Java compiles alongside Scala. Sadly, this won't let you use EgTest within Scala source code.
// compileScala.options.compilerArgs.add("-Aegtest.targetDirectory=$buildDir/generated/egTest")
sourceSets {
test {
java {
srcDir 'build/generated/egTest' // Generate tests using output directory specified above
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment