Skip to content

Commit

Permalink
Fix 'docs' workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
serpro69 committed Mar 10, 2024
1 parent 3bbffba commit 55a678a
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 17 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 15 additions & 0 deletions CONTRIBUTING.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 0 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,12 @@ subprojects {
configure<JavaPluginExtension> {
toolchain {
languageVersion = JavaLanguageVersion.of(8)
vendor.set(JvmVendorSpec.matching("Temurin"))
}
}

configure<KotlinJvmProjectExtension> {
jvmToolchain {
languageVersion.set(JavaLanguageVersion.of(8))
vendor.set(JvmVendorSpec.matching("Temurin"))
}
}

Expand Down
6 changes: 0 additions & 6 deletions docs/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,3 @@ orchid {
System.getenv("GITHUB_TOKEN")
}
}

val compileOrchidKotlin by tasks.getting(KotlinCompile::class) {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
}

0 comments on commit 55a678a

Please sign in to comment.