2018年12月6日木曜日

CenOS7 gradleインストール

Gradle v4.10.3 2018.12.5
ここからダウンロード
https://gradle.org/releases/

# mv gradle-4.10.3-all.zip /opt
# cd /opt
# unzip gradle-4.10.3-all.zip
# rm gradle-4.10.3-all.zip
# ln -s gradle-4.10.3 gradle
# vi /etc/profile
export GRADLE_HOME=/opt/gradle
export PATH=$GRADLE_HOME/bin:$PATH
$ source /etc/profile
$ gradle -version
Welcome to Gradle 4.10.3!
Here are the highlights of this release:
- Incremental Java compilation by default
- Periodic Gradle caches cleanup
- Gradle Kotlin DSL 1.0-RC6
- Nested included builds
- SNAPSHOT plugin versions in the `plugins {}` block
For more details see https://docs.gradle.org/4.10.3/release-notes.html
------------------------------------------------------------
Gradle 4.10.3
------------------------------------------------------------
Build time: 2018-12-05 00:50:54 UTC
Revision: e76905e3a1034e6f724566aeb985621347ff43bc
Kotlin DSL: 1.0-rc-6
Kotlin: 1.2.61
Groovy: 2.4.15
Ant: Apache Ant(TM) version 1.9.11 compiled on March 23 2018
JVM: 1.8.0_191 (Oracle Corporation 25.191-b12)
OS: Linux 3.10.0-957.1.3.el7.x86_64 amd64


■使ってみる
$ cd Make/sample
$ mkdir src
$ mkdir src/main
$ mkdir src/main/java
$ mkdir src/main/java/sample
$ mkdir src/main/jdava/sample/gradle
$ vi src/main/sample/gradle/GradleMain.javapackage sample.gradle;
public class GradleMain {
public static void main(String[] args) {
System.out.println("Hello Gradle!!");
}
}
$ vi build.gradle
apply plugin: 'java'
$ gradle compileJava
$ java -cp build/classes/java/main sample.gradle.GradleMain
Hello Gradle!!
$ find * -print
build
build/classes
build/classes/java
build/classes/java/main
build/classes/java/main/sample
build/classes/java/main/sample/gradle
build/classes/java/main/sample/gradle/GradleMain.class
build/tmp
build/tmp/compileJava
build.gradle
src
src/main
src/main/java
src/main/java/sample
src/main/java/sample/gradle
src/main/java/sample/gradle/GradleMain.java
$ gradle clean
$ find * -print
build.gradle
src
src/main
src/main/java
src/main/java/sample
src/main/java/sample/gradle
src/main/java/sample/gradle/GradleMain.java
$

■使ってみる(java project)
$ gradle init --type java-library
Starting a Gradle Daemon (subsequent builds will be faster)

BUILD SUCCESSFUL in 3s
2 actionable tasks: 2 executed
$ find . -print
.
./src
./src/test
./src/test/java
./src/test/java/LibraryTest.java
./src/main
./src/main/java
./src/main/java/Library.java
./.gradle
./.gradle/buildOutputCleanup
./.gradle/buildOutputCleanup/cache.properties
./.gradle/buildOutputCleanup/buildOutputCleanup.lock
./.gradle/buildOutputCleanup/outputFiles.bin
./.gradle/4.10.3
./.gradle/4.10.3/fileChanges
./.gradle/4.10.3/fileChanges/last-build.bin
./.gradle/4.10.3/fileHashes
./.gradle/4.10.3/fileHashes/fileHashes.lock
./.gradle/4.10.3/fileHashes/fileHashes.bin
./.gradle/4.10.3/taskHistory
./.gradle/4.10.3/taskHistory/taskHistory.bin
./.gradle/4.10.3/taskHistory/taskHistory.lock
./.gradle/4.10.3/gc.properties
./settings.gradle
./build.gradle
./gradlew
./gradlew.bat
./gradle
./gradle/wrapper
./gradle/wrapper/gradle-wrapper.properties
./gradle/wrapper/gradle-wrapper.jar

$ vi build.gradle <<__EOF__
O
##########以下を修正############
id 'java-library'の下に
id 'eclipse'を追加

id 'eclipse'
################################
←ESCコード(cntl+v esc)
ZZ
__EOF__
$ vi build.gradle
$ gradle eclipse
$ ls -la
合計 56
drwxrwxr-x. 6 takahab takahab 4096 12月 10 14:14 .
drwxrwxr-x. 3 takahab takahab 4096 12月 10 13:52 ..
-rw-rw-r--. 1 takahab takahab 4308 12月 10 14:05 .classpath
drwxrwxr-x. 5 takahab takahab 4096 12月 10 14:04 .gradle
-rw-rw-r--. 1 takahab takahab  391 12月 10 14:05 .project
drwxrwxr-x. 2 takahab takahab 4096 12月 10 14:05 .settings
-rw-rw-r--. 1 takahab takahab 1051 12月 10 14:05 build.gradle
drwxrwxr-x. 3 takahab takahab 4096 12月 10 13:53 gradle
-rwxrwxr-x. 1 takahab takahab 5296 12月 10 13:53 gradlew
-rw-rw-r--. 1 takahab takahab 2260 12月 10 13:53 gradlew.bat
-rw-rw-r--. 1 takahab takahab  367 12月 10 13:53 settings.gradle
drwxrwxr-x. 4 takahab takahab 4096 12月 10 13:53 src

eclipseを起動してインポート




0 件のコメント:

コメントを投稿

zabbix7 amazon linux2023 インストール postgres15

【postgres】 dnf -y install postgresql15-server postgresql15-server-devel postgresql-setup initdb passwd postgres vi `find / -name pg_hba.con...