Skip to content

Commit

Permalink
feat: possibility to bundle the jdk when building scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
ennioVisco committed Dec 9, 2023
1 parent bef9084 commit 5f4e7ad
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 14 deletions.
9 changes: 9 additions & 0 deletions build-logic/publish/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// == Plugins for publishing to Maven Central ==
plugins {
`kotlin-dsl` // To compile the plugin code
id("com.vanniktech.maven.publish") version "0.25.3"
}

dependencies {
implementation("com.vanniktech:gradle-maven-publish-plugin:0.25.3")
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
import com.vanniktech.maven.publish.SonatypeHost

plugins {
id("io.github.moonlightsuite.java-library")
`java-library`
// id("io.github.moonlightsuite.java-library")
id("com.vanniktech.maven.publish")
}

// == General Java settings ==
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(21))
}
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
// withJavadocJar()
// withSourcesJar()
}

val projectVersion: String = try {
val ver = providers.gradleProperty("projectVersion").get()
if (ver.contains("-")) {
Expand Down
5 changes: 3 additions & 2 deletions build-logic/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pluginManagement {
}

plugins {
kotlin("jvm") version "1.9.21" apply false // for compiling the docs
// kotlin("jvm") version "1.9.21" apply false // for compiling the docs
id("org.jetbrains.dokka") version "1.9.10" apply false
}
}
Expand All @@ -26,10 +26,11 @@ dependencyResolutionManagement {
plugins {
`kotlin-dsl` apply false

kotlin("jvm") version "1.9.20-RC2" apply false // TODO: remove when 1.9.20 is released
// kotlin("jvm") version "1.9.21" apply false // TODO: remove when 1.9.20 is released
}

// We aggregate all the build logic in a single project
include("java-library")
include("publish")
include("code-info")
include("generate-docs")
2 changes: 1 addition & 1 deletion engine/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id("io.github.moonlightsuite.java-library")
id("io.github.moonlightsuite.generate-docs")
// id("io.github.moonlightsuite.generate-docs")
id("io.github.moonlightsuite.publish")
}

Expand Down
2 changes: 1 addition & 1 deletion engine/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module moonlight.engine {
requires org.jetbrains.annotations;
requires static org.jetbrains.annotations;
requires com.google.gson;
requires org.apache.logging.log4j;
requires org.apache.logging.log4j.core;
Expand Down
26 changes: 17 additions & 9 deletions script/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
plugins {
antlr
id("io.github.moonlightsuite.java-library")
id("io.github.moonlightsuite.generate-docs")
// id("io.github.moonlightsuite.generate-docs")
id("io.github.moonlightsuite.publish")
id("org.beryx.jlink") version "3.0.1"
}

jlink {
launcher {
name = "moonlight"
jvmArgs = listOf("-Dlogback.configurationFile=./logback.xml")
}
}

dependencies {
Expand All @@ -24,11 +32,11 @@ tasks.generateGrammarSource {
tasks.build {
dependsOn(tasks.generateGrammarSource)
}

tasks.kotlinSourcesJar {
dependsOn(tasks.generateGrammarSource)
}

tasks.dokkaHtml {
dependsOn(tasks.generateGrammarSource)
}
//
//tasks.kotlinSourcesJar {
// dependsOn(tasks.generateGrammarSource)
//}
//
//tasks.dokkaHtml {
// dependsOn(tasks.generateGrammarSource)
//}

0 comments on commit 5f4e7ad

Please sign in to comment.