Eclipse Buildship プラグインでGradleの実行時オプションを指定する方法
Eclipse Buildshipとは
Eclipse Buildship is a collection of Eclipse plug-ins that provide support for building software using Gradle.
https://projects.eclipse.org/projects/tools.buildship
Eclipse Buildship is a collection of Eclipse plug-ins that provide support for building software using Gradle.
https://projects.eclipse.org/projects/tools.buildship
とあるように、GradleをEclipse上で扱うためのプラグインです。
Installの有無は、Eclipse上からは help> About Eclipse IDE から確認できます。
下図は Eclipse Buildship Version 3.1.1 がインストールされている様子です。
やりたいこと
Buildship経由のgradleタスク実行時にオプションを追加したい。CLIでいうとgradle build -x test
ただ、それだけです。ただそれだけがEclipseのBuildshp経由できず、なんだかモヤモヤしつつも諦めてCLIコマンドをいつも叩いていましたが、回避方法がわかったので備忘に残しておきました。
環境
Eclipse: Version: 2018-12 (4.10.0)
Buidship: 3.1.1
実現方法
Gradle Tasks > にタスクを設定します。
次に、Project Settings で、Override project settings
にチェックを入れ、Program Arguments
に-x
, test
という2つの引数を追加します。
これだけです。これだけで gradle build -x test
と同等のビルドが実行できます。
簡単なんですがここまでに中々至らず、諦めてターミナルからいつもコマンドを打っていました。
NGケース1
以下のようにGradle tasksに build -x test
と横着して書いても上手く認識してくれません。
FAILURE: Build failed with an exception.
* What went wrong:
Task 'build -x test' not found in root project 'buildship-example'.
NGケース2
同様に、Program Argumentsに -x test
とワンラインで書いても上手く認識してくれません。
FAILURE: Build failed with an exception.
* What went wrong:
Task ' test' not found in root project 'buildship-example'. Some candidates are: 'test'.
なんとなくワンラインで書きたくなりますが、いい感じに認識はしてくれませんのでご注意ください。
まとめ
- EclipseとBuildshipでGradleビルドしている方がどれほどいらっしゃるかは不明ですが、やむえない理由で同じ用にハマった人の助けになれば幸いです
- Eclipseとかの設定手順を説明するのに、キャプチャをペタペタ貼って手順書を書くのは6,7年ぶりで懐かしい感覚になりました
Author And Source
この問題について(Eclipse Buildship プラグインでGradleの実行時オプションを指定する方法), 我々は、より多くの情報をここで見つけました https://qiita.com/ma91n/items/236721584300873e0132著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .