Gradle provides a dev's dreamboat in terms of useful, convention based build/run capabilities. It's as extensible as ant, powerful as maven, yet IMHO: world's better than both.
Ref: https://gradle.org/
apply plugin: 'groovy'
apply plugin: 'application'
sourceCompatibility = 1.5
version = '1.0'
jar {
manifest {
attributes 'Implementation-Title': 'my_sweet_project', 'Implementation-Version': version
}
}
repositories {
mavenCentral()
}
dependencies {
compile 'org.codehaus.groovy:groovy-all:2.3.6'
compile 'org.seleniumhq.selenium:selenium-java:2.45.0'
compile 'org.codehaus.jackson:jackson-mapper-asl:1.9.13'
compile 'ch.qos.logback:logback-classic:1.1.2'
compile 'com.codeborne:phantomjsdriver:1.2.1'
testCompile 'org.testng:testng:6.8.8'
}
task root(type: Copy) {
from 'src/main/root'
into 'build/rootScripts'
}
task phantomjs(type: Copy) {
from 'src/main/phantomjs'
into 'build/phantomjs'
}
applicationDistribution.from(root) {
into ""
}
applicationDistribution.from(phantomjs) {
into "phantomjs"
}
test {
// enable TestNG support (default is JUnit)
useTestNG()
// Propagate all system properties
systemProperties = System.getProperties()
// show standard out and standard error of the test JVM(s) on the console
testLogging.showStandardStreams = true
// listen to events in the test execution lifecycle
beforeTest { descriptor ->
logger.lifecycle("Running test: " + descriptor)
}
}
task performMyPhantomOp (type: JavaExec) {
description 'Login to my site and perform some cool configuration'
main = 'com.isajohnson.appawesome.task.PerformManagementTask'
classpath = sourceSets.main.runtimeClasspath
}
apply plugin: 'java'
apply plugin: 'groovy'
apply plugin: 'application'
sourceCompatibility = 1.5
version = '1.0'
mainClassName = "com.isajohnson.myapp.AwesomeForm"
jar {
manifest {
attributes 'Implementation-Title': 'AwesomeApp', 'Implementation-Version': version
}
}
repositories {
mavenCentral()
}
dependencies {
compile 'org.codehaus.groovy:groovy-all:2.3.6'
compile 'org.seleniumhq.selenium:selenium-java:2.42.2'
compile 'org.codehaus.jackson:jackson-mapper-asl:1.9.13'
compile 'ch.qos.logback:logback-classic:1.1.2'
compile 'com.intellij:forms_rt:7.0.3'
testCompile 'junit:junit:4.11'
}