Last active
July 29, 2018 09:29
-
-
Save h1romas4/bd0495aa6cf0270d5a9403db623fcde5 to your computer and use it in GitHub Desktop.
Gradle の Application プラグインで ./gradlew run 実行時に引数を指定する(Gradle 4.9 未満)
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
apply plugin: 'groovy' | |
apply plugin: 'application' | |
mainClassName = 'Hego' | |
/** | |
* 起動オプション | |
* | |
* Gradle 4.9 なら次で OK | |
* ./gradlew run --args 'foo --bar' | |
* | |
* Gradle 4.9 未満はこの設定を追加して次のように実行 | |
* ./gradlew run -PappArgs"['hego1', 'hego2', 'hego3']" | |
**/ | |
run { | |
if(project.hasProperty('appArgs')) { | |
args Eval.me(appArgs) | |
} | |
} | |
dependencies { | |
compile localGroovy() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment