Skip to content

Instantly share code, notes, and snippets.

@dmikurube
Created May 25, 2017 03:01
Show Gist options
  • Save dmikurube/98d895f81c47dfc72b8d7aeeb578f2c5 to your computer and use it in GitHub Desktop.
Save dmikurube/98d895f81c47dfc72b8d7aeeb578f2c5 to your computer and use it in GitHub Desktop.
apply plugin: 'java'
repositories {
mavenCentral()
}
dependencies {
testCompile 'junit:junit:4.+'
}
sourceSets {
main {
java {
srcDir '.'
exclude 'Test*.java'
}
}
test {
java {
srcDir '.'
include 'Test*.java'
}
}
}
test {
testLogging {
events 'passed', 'skipped', 'failed', 'standardOut', 'standardError'
}
}
task run(type:JavaExec) {
main = project.hasProperty('main') ? project.getProperty('main') : 'TryOneJar'
classpath = sourceSets.main.runtimeClasspath
}
public class TryOneJar {
public static void main(String[] args) {
System.out.println("One-JAR");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment