Skip to content

Instantly share code, notes, and snippets.

@zhanghuabin
Forked from djangofan/build.gradle.java
Created February 15, 2014 18:52
Show Gist options
  • Save zhanghuabin/9023509 to your computer and use it in GitHub Desktop.
Save zhanghuabin/9023509 to your computer and use it in GitHub Desktop.
apply plugin: 'java'
group = 'qa.webdriver'
subprojects {
apply plugin: 'java'
project.ext.sourceCompatibility = 1.6
repositories {
mavenCentral()
maven {
url "http://maven2.javacpp.googlecode.com/git/"
}
maven {
url "http://maven2.javacv.googlecode.com/git/"
}
}
dependencies {
compile group: 'org.sikuli', name: 'sikuli-api', version: '1.0.+'
compile group: 'org.seleniumhq.selenium', name: 'selenium-java', version: '2.+'
compile group: 'junit', name: 'junit', version: '4.+'
compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.+'
compile group: 'ch.qos.logback', name: 'logback-core', version: '1.0.+'
compile group: 'ch.qos.logback', name: 'logback-classic', version: '1.0.+'
}
test {
testLogging {
exceptionFormat "full"
events "started", "passed", "skipped", "failed", "standardOut", "standardError"
}
}
// move this task to the sub project build file because of the Main-Class value
task testJar(type: Jar) {
classifier = 'tests'
from sourceSets.test.output.classesDir
manifest { attributes 'Main-Class': 'qa.webdriver.tests.GoogleTest' }
}
}
subprojects.each { subproject -> evaluationDependsOn( subproject.path ) }
task uberJar(type: Jar, dependsOn: subprojects.tasks['testClasses'] ) {
baseName = 'uberJar'
subprojects.each { subproject ->
from subproject.configurations.archives.allArtifacts.files.collect {
zipTree(it)
}
from files(subproject.tasks["test"].testClassesDir)
from configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
}
}
artifacts {
archives uberJar
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment