From 0687c963406f8988f001578d727d514e138f2792 Mon Sep 17 00:00:00 2001 From: Chao Zhan <chao.zhan@fu-berlin.de> Date: Wed, 21 Jun 2023 23:48:39 +0200 Subject: [PATCH] update slides --- .gitignore | 2 ++ slides/pages/recap.md | 46 ++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 7915a31..095be63 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ +.idea +*.iml node_modules compile_flags.txt diff --git a/slides/pages/recap.md b/slides/pages/recap.md index 34df5da..a540f42 100644 --- a/slides/pages/recap.md +++ b/slides/pages/recap.md @@ -65,10 +65,54 @@ title: Java Dev Environment Setup layout: center --- -### Java Dev Environment Setup +# Java Dev Environment Setup <br/> - Using an IDE is recommended: [IntelliJ IDEA](https://www.jetbrains.com/idea/download/), [Eclipse](https://www.eclipse.org/downloads/) - Install JDK: [Oracle JDK 17](https://docs.oracle.com/en/java/javase/17/install/overview-jdk-installation.html#GUID-8677A77F-231A-40F7-98B9-1FD0B48C346A) (same version on Andorra) - Use [Gradle](https://gradle.org/) for building and running your project, or use the IDE's built-in tools +- Use [Package Search](https://package-search.jetbrains.com/) to find your java libraries + + +--- +title: Gradle I +--- + +# Gradle + +- Gradle is an open-source build automation tool focused on flexibility and performance. +- Gradle build scripts are written using a **Groovy** or **Kotlin** DSL. +- Check out the [Installation Guide](https://docs.gradle.org/current/userguide/installation.html) +- `build.gradle/build.gradle.kts` is the main configuration file for a Gradle project +- `gradlew` is the Gradle wrapper script, which is used to execute Gradle tasks for Linux or MacOS +- `gradlew.bat` is the Gradle wrapper script for Windows + +--- +title: Gradle II +--- + +## Write a Task in Gradle Build Script + +Write a task in gradle build script to run java program. + +```kotlin +tasks.register<JavaExec>("<task-name>") { + // if your program needs input from stdin + standardInput = System.`in` + + // Set the main class to be executed + mainClass.set("<main-class>") + + // Set classpath dependencies if needed + classpath = sourceSets.main.get().runtimeClasspath + + // Set JVM arguments if needed + // jvmArgs = listOf("-Xmx512m") + + // Set program arguments if needed + // args = listOf("arg1", "arg2") +} +``` + +See live demo in the tutorial. -- GitLab