最近の更新

2016年11月16日水曜日

初期化(basic)

【目的】
Gradle3でプロジェクトを初期化します。
※basicで基本的なプロジェクトを作成します。



【準備】
1.『Gradle3.2のダウンロード方法』の手順で『gradle-3.2-bin.zip』をダウンロードしておく。
2.『Gradle3.2のインストール方法』の手順でインストールしておく。



【手順1】
1.『コマンドプロンプトを起動する方法』の手順で、コマンドプロンプトを起動。



【手順2】
1.以下のコマンドで『basic』タイプでプロジェクトを初期化作成します。




【手順3】
1.以下の様な構成でファイルが作成されます。

C:.
│  build.gradle
│  gradlew
│  gradlew.bat
│  settings.gradle
│
├─.gradle
│  └─3.2
│      └─taskArtifacts
│              fileHashes.bin
│              fileSnapshots.bin
│              taskArtifacts.bin
│              taskArtifacts.lock
│
└─gradle
    └─wrapper
            gradle-wrapper.jar
            gradle-wrapper.properties



































【参考1】
1.『build.gradle』は以下の様な中身になっています。
/*
 * This build file was auto generated by running the Gradle 'init' task
 * by 'admin' at '16/11/16 9:22' with Gradle 3.2
 *
 * This generated file contains a commented-out sample Java project to get you started.
 * For more details take a look at the Java Quickstart chapter in the Gradle
 * user guide available at https://docs.gradle.org/3.2/userguide/tutorial_java_projects.html
 */

/*
// Apply the java plugin to add support for Java
apply plugin: 'java'

// In this section you declare where to find the dependencies of your project
repositories {
    // Use 'jcenter' for resolving your dependencies.
    // You can declare any Maven/Ivy/file repository here.
    jcenter()
}

// In this section you declare the dependencies for your production and test code
dependencies {
    // The production code uses the SLF4J logging API at compile time
    compile 'org.slf4j:slf4j-api:1.7.21'

    // Declare the dependency for your favourite test framework you want to use in your tests.
    // TestNG is also supported by the Gradle Test task. Just change the
    // testCompile dependency to testCompile 'org.testng:testng:6.8.1' and add
    // 'test.useTestNG()' to your build script.
    testCompile 'junit:junit:4.12'
}
*/

【参考2】
1.『settings.gradle』は以下の様な中身になっています。

/*
 * This settings file was auto generated by the Gradle buildInit task
 * by 'admin' at '16/11/16 9:22' with Gradle 3.2
 *
 * The settings file is used to specify which projects to include in your build.
 * In a single project build this file can be empty or even removed.
 *
 * Detailed information about configuring a multi-project build in Gradle can be found
 * in the user guide at https://docs.gradle.org/3.2/userguide/multi_project_builds.html
 */

/*
// To declare projects as part of a multi-project build use the 'include' method
include 'shared'
include 'api'
include 'services:webservice'
*/

rootProject.name = '08-初期化(basic)'



以上です。

0 件のコメント:

コメントを投稿

注: コメントを投稿できるのは、このブログのメンバーだけです。

関連記事