Created
December 19, 2016 00:34
-
-
Save christherama/e45b666b2a8637bf07ee0d0a5f4ad24c to your computer and use it in GitHub Desktop.
Gradle build file including the passing of command line args to application's main method
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
group 'com.example' | |
version '1.0-SNAPSHOT' | |
apply plugin: 'java' | |
apply plugin: 'application' | |
sourceCompatibility = 1.8 | |
repositories { | |
mavenCentral() | |
} | |
dependencies { | |
testCompile "org.junit.jupiter:junit-jupiter-api:5.0.0-M3" | |
} | |
run { | |
mainClassName = "com.example.Main" | |
if(project.hasProperty('file')) { | |
args(file.split(',')[0]) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment