| ページ一覧 | ブログ | twitter |  書式 | 書式(表) |

MyMemoWiki

差分

ナビゲーションに移動 検索に移動
71 バイト追加 、 2020年2月15日 (土) 08:02
編集の要約なし
==Gradle==
[[Groovy]]
{{amazon|4798136433}}
==ビルドスクリプト==
}
> > gradle hello
Starting a Gradle Daemon (subsequent builds will be faster)
:hello
*タスクの一覧を確認
*プラグインを追加するとタスクも追加される
> > gradle tasks
*暗黙的なものも含めプロパティの一覧を表示
> > gradle properties
===主要なコマンドラインオプション===
==プロジェクト自動生成とビルド==
===initタスク===
> > cd .\sample_java_project\ > > gradle init --type java-library
:wrapper
:init
Total time: 6.175 secs
> > tree
フォルダー パスの一覧: ボリューム ACER
ボリューム シリアル番号は 00000005 C68A:087D です
*gradle tasks
*javaプラグインを適用したことで、多くのタスクが追加された
> > gradle tasks
Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reused, use --status for details
:tasks
Rules
-----
Pattern: clean<&lt;TaskName>&gt;: Cleans the output files of a task. Pattern: build<&lt;ConfigurationName>&gt;: Assembles the artifacts of a configuration. Pattern: upload<&lt;ConfigurationName>&gt;: Assembles and uploads the artifacts belonging to a configuration.
To see all tasks and more detail, run gradle tasks --all
To see more detail about a task, run gradle help --task <&lt;task>&gt;
BUILD SUCCESSFUL
*再度実行すると、変更がない部分はスキップされる
*結果を破棄し再実行の場合、build clean
> &gt; gradle build
Starting a Gradle Daemon, 1 stopped Daemon could not be reused, use --status for details
:compileJava
=====ラッパーを適用する=====
*プロジェクトルートで、gradle wrapper
> &gt; gradle wrapper
:wrapper
Total time: 10.205 secs
> &gt; tree
フォルダー パスの一覧: ボリューム ACER
ボリューム シリアル番号は 000000FA C68A:087D です
*gradlew tasks
**自動的にバイナリのダウンロードおよびセットアップが実行
> &gt; .\gradlew.bat tasks
Downloading https://services.gradle.org/distributions/gradle-3.4-bin.zip
Unzipping C:\Users\piroto\.gradle\wrapper\dists\gradle-3.4-bin\aeufj4znodijbvwfbsq3044r0\gradle-3.4-bin.zip to C:\Users\piroto\.g
*スクリプトブロックはクロージャを引数とするメソッド
*クロージャは、何かのオブジェクトに移譲されて実行される。クロージャに記述する内容は処理を移譲するオブジェクトが許容できるものである必要がある
<&lt;blockquote>&gt;スクリプトファイルに記述する定義は、GradleドメインオブジェクトそのものへのAPI呼び出しと同義<&lt;/blockquote>&gt;
====主要なスクリプトブロック====

案内メニュー