diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 015d0284f..e0b18b72f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,7 +22,9 @@ jobs: with: fetch-depth: 0 - - name: Set up JDK 8 and 17 # we need both because graal plugin in cli-bot requires jdk version >= 11 + # we need both because graal plugin in cli-bot requires jdk version >= 11 + # more details in CONTRIBUTING + - name: Set up JDK 8 and 17 uses: actions/setup-java@v4 with: java-version: | diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 993e25735..d539623d0 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -43,12 +43,13 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Set up JDK 8 and 17 # we need both because graal plugin in cli-bot requires jdk version >= 11 + # we need jdk >= 11 to be able to configure cli-bot module due to graal plugin requirements + # at the same time using jdk 17 fails with 'module java.base does not "opens java.lang" to unnamed module' error + # more details in CONTRIBUTING + - name: Set up JDK 11 uses: actions/setup-java@v4 with: - java-version: | - 8 - 17 + java-version: 11 distribution: 'temurin' - name: Deploy Docs run: make deploy-docs diff --git a/CONTRIBUTING.adoc b/CONTRIBUTING.adoc index 4897282ca..4b5f2750e 100644 --- a/CONTRIBUTING.adoc +++ b/CONTRIBUTING.adoc @@ -63,6 +63,21 @@ We try to be as helpful to newcomers as possible, and you don't have to be afrai _If this is your first pull request - please add yourself to the "contributors section" in https://github.com/serpro69/kotlin-faker/blob/master/docs/src/orchid/resources/data.yml[data.yml] file so that you get proper credit in the project's https://serpro69.github.io/kotlin-faker/about/[About page]._ +== Prerequisites + +* JDK 8 (temurin or any other distribution; mandatory) +* JDK 11 (temurin or any other distribution; mandatory) +* JDK 17 (GraalVM CE distribution; optional) + +Some details for the above requirements are as follows: + +* To build any module of kotlin-faker, jdk version 11 or higher has to be used to run gradle processes due to link:https://graalvm.github.io/native-build-tools/latest/gradle-plugin.html[`org.graalvm.buildtools.native`] plugin requirements that is used in the link:cli-bot/build.gradle.kts[`cli-bot`] build file. +** link:core[`core`] faker, and all additional link:faker[`faker`] implementations will look up jdk 8 via link:https://docs.gradle.org/current/userguide/toolchains.html[gradle jvm toolchains] to make sure the libraries are built with java 8 compatibility. +** GraalVM CE is needed to build the native image of the link:cli-bot[`cli-bot`] application. But since it's a module in the project and therefore is part of the project's build configuration process, it introduces a hard dependency on jdk version 11 or higher +*** GraalVM CE jdk distribution can be omitted if one does not want to build the native image of the `cli-bot` application, but any other jdk with version >= 11 is still mandatory to build the rest of the project as mentioned above. +*** GraalVM CE jdk can be installed with e.g. sdkman, or can be downloaded and installed directly from the link:https://github.com/graalvm/graalvm-ce-builds/releases[graalvm-ce-builds releases] +** To build link:docs[`docs`] module, only jdk 11 works currently. This is again due to the fact that gradle configuration stage for `cli-bot` module will simply fail with a lower version, but at the same time jdk 17 also doesn't work for `docs` module itself due to `module java.base does not "opens java.lang" to unnamed module` error... + == Code Structure This repository consists of the following modules: diff --git a/README.md b/README.md index 8682c21ed..df47aeae7 100644 --- a/README.md +++ b/README.md @@ -21,10 +21,7 @@ Port of a popular ruby [faker](https://github.com/stympy/faker) gem written in k ## Prerequisites - Faker libraries depend on java 8 and kotlin 1.9.x for runtime -- Building faker from source requires both jdk 8 (temurin is recommended, but any vendor should work) and jdk 17 (graalvm-ce). The latter is needed to build the [cli-bot](cli-bot) application, but since it's a module in the project and therefore is part of the project's build process, the dependency on graalvm-ce jdk is only partially optional: - - To build faker, jdk version 11 or higher has to be used with gradle due to [`org.graalvm.buildtools.native`](https://graalvm.github.io/native-build-tools/latest/gradle-plugin.html) plugin requirements that is used in the [`cli-bot`](cli-bot/build.gradle.kts) build file. - - GraalVM CE jdk distribution can be omitted if one does not want to build the native image of the `cli-bot` application, but any other jdk with version >= 11 is still mandatory to build the rest of the project as mentioned above. - - GraalVM CE jdk can be installed with e.g. sdkman, or can be downloaded and installed directly from the [graalvm-ce-builds releases](https://github.com/graalvm/graalvm-ce-builds/releases) +- Building faker from source requires 3 jdk distributions: jdk 8 (temurin is recommended, but any vendor should work), jdk 11 (for [`docs`](docs) module) and jdk 17 (graalvm-ce distribution, for [`cli-bot`](cli-bot) module). See [CONTRIBUTING](CONTRIBUTING.adoc) for more details. ## Usage diff --git a/build.gradle.kts b/build.gradle.kts index 29d6cc53a..261144503 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -73,14 +73,12 @@ subprojects { configure { toolchain { languageVersion = JavaLanguageVersion.of(8) - vendor.set(JvmVendorSpec.matching("Temurin")) } } configure { jvmToolchain { languageVersion.set(JavaLanguageVersion.of(8)) - vendor.set(JvmVendorSpec.matching("Temurin")) } } diff --git a/docs/build.gradle.kts b/docs/build.gradle.kts index 6f9c21467..2252a56b9 100644 --- a/docs/build.gradle.kts +++ b/docs/build.gradle.kts @@ -49,9 +49,3 @@ orchid { System.getenv("GITHUB_TOKEN") } } - -val compileOrchidKotlin by tasks.getting(KotlinCompile::class) { - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8.toString() - } -}