Skip to content

Commit

Permalink
Update shadowJar, logback, utility plugins. Make Java 11 a default ta…
Browse files Browse the repository at this point in the history
…rget
  • Loading branch information
ileasile committed Mar 29, 2024
1 parent 25fac41 commit b554ce7
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 64 deletions.
4 changes: 2 additions & 2 deletions build-plugin/src/build/util/shadowing.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ import com.github.jengelman.gradle.plugins.shadow.relocation.Relocator
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import com.github.jengelman.gradle.plugins.shadow.transformers.Transformer
import com.github.jengelman.gradle.plugins.shadow.transformers.TransformerContext
import org.apache.tools.zip.ZipEntry
import org.apache.tools.zip.ZipOutputStream
import org.gradle.api.file.FileTreeElement
import org.w3c.dom.Document
import org.w3c.dom.Element
import org.w3c.dom.Node
import org.w3c.dom.NodeList
import shadow.org.apache.tools.zip.ZipEntry
import shadow.org.apache.tools.zip.ZipOutputStream
import java.io.ByteArrayInputStream
import java.io.StringWriter
import java.nio.charset.StandardCharsets
Expand Down
106 changes: 55 additions & 51 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,13 @@ tasks {
classpath = files(shadowJar.get()) + classpath
}

systemProperties = mutableMapOf(
"junit.jupiter.displayname.generator.default" to "org.junit.jupiter.api.DisplayNameGenerator\$ReplaceUnderscores",

"junit.jupiter.execution.parallel.enabled" to doParallelTesting.toString() as Any,
"junit.jupiter.execution.parallel.mode.default" to "concurrent",
"junit.jupiter.execution.parallel.mode.classes.default" to "concurrent",
)
systemProperties =
mutableMapOf(
"junit.jupiter.displayname.generator.default" to "org.junit.jupiter.api.DisplayNameGenerator\$ReplaceUnderscores",
"junit.jupiter.execution.parallel.enabled" to doParallelTesting.toString() as Any,
"junit.jupiter.execution.parallel.mode.default" to "concurrent",
"junit.jupiter.execution.parallel.mode.classes.default" to "concurrent",
)
}

CreateResourcesTask.register(project, "addLibrariesToResources", processResources) {
Expand Down Expand Up @@ -184,57 +184,61 @@ tasks {
}
}

val kernelShadowedJar = tasks.registerShadowJarTasksBy(
kernelShadowed,
withSources = false,
binaryTaskConfigurator = {
mergeServiceFiles()
transform(ComponentsXmlResourceTransformer())
manifest {
attributes["Implementation-Version"] = project.version
}
},
)
val embeddableKernelJar = tasks.registerShadowJarTasksBy(
embeddableKernel,
withSources = false,
binaryTaskConfigurator = {
mergeServiceFiles()
transform(ComponentsXmlResourceTransformer())

transform(
ContentTransformer(
"META-INF/extensions/compiler.xml",
ContentModificationContext::transformPluginXmlContent,
),
)
manifest {
attributes["Implementation-Version"] = project.version
}

relocatePackages {
+"kotlin.script.experimental.dependencies"
+"org.jetbrains.kotlin."
+"org.jetbrains.kotlinx.serialization."
}
},
)
val kernelShadowedJar =
tasks.registerShadowJarTasksBy(
kernelShadowed,
withSources = false,
binaryTaskConfigurator = {
mergeServiceFiles()
transform(ComponentsXmlResourceTransformer())
manifest {
attributes["Implementation-Version"] = project.version
}
},
)
val embeddableKernelJar =
tasks.registerShadowJarTasksBy(
embeddableKernel,
withSources = false,
binaryTaskConfigurator = {
mergeServiceFiles()
transform(ComponentsXmlResourceTransformer())

transform(
ContentTransformer(
"META-INF/extensions/compiler.xml",
ContentModificationContext::transformPluginXmlContent,
),
)
manifest {
attributes["Implementation-Version"] = project.version
}

relocatePackages {
+"kotlin.script.experimental.dependencies"
+"org.jetbrains.kotlin."
+"org.jetbrains.kotlinx.serialization."
}
},
)
val scriptClasspathShadowedJar = tasks.registerShadowJarTasksBy(scriptClasspathShadowed, withSources = true)
val ideScriptClasspathShadowedJar = tasks.registerShadowJarTasksBy(ideScriptClasspathShadowed, withSources = false)

val kernelZip = tasks.register("kernelZip", Zip::class) {
from(deploy)
include("*.jar")
}
val kernelZip =
tasks.register("kernelZip", Zip::class) {
from(deploy)
include("*.jar")
}

changelog {
githubUser = rootSettings.githubRepoUser
githubRepository = rootSettings.githubRepoName
excludeLabels = listOf("wontfix", "duplicate", "no-changelog", "question")
customTagByIssueNumber = mapOf(
20 to "0.10.0.183",
318 to "0.10.0.183",
)
excludeLabels = setOf("wontfix", "duplicate", "no-changelog", "question")
customTagByIssueNumber =
mapOf(
20 to "0.10.0.183",
318 to "0.10.0.183",
)
}

kotlinPublications {
Expand Down
20 changes: 11 additions & 9 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
[versions]
jvmTarget = "1.8"
jvmTarget = "11"

kotlin = "1.9.23"
kotlinDependencies = "1.9.23"
kotlinMavenResolver = "2.0.0-Beta5"
stableKotlin = "1.9.23"
gradleKotlin = "1.9.23"
ksp = "1.9.23-1.0.19"
shadowJar = "7.1.2"
shadowJar = "8.1.1"
ant = "1.10.13"
shadowJarUtil = "0.1.4-4"
changelogPlugin = "1.12.1"
changelogPlugin = "2.2.0"
kotlinxSerialization = "1.6.3"
json5k = "0.3.0"
kotlinxCoroutines = "1.8.0"
Expand All @@ -19,13 +20,12 @@ ktlintGradle = "12.1.0"
ktlint = "0.50.0"
publishPlugin = "1.9.23-dev-44"
pluginPublishPlugin = "1.2.1"
versionsPlugin = "0.44.0"
versionsPlugin = "0.51.0"

slf4j = "2.0.12"
# Beware, newer versions of logback (starting from 1.4.*) are compiled for Java 11 only
logback = "1.3.6"
logback = "1.5.3"
http4k = "5.14.4.0"
jupyterApi = "0.12.0-157"
jupyterApi = "0.12.0-163"
jetbrainsAnnotations = "24.1.0"

junit = "5.10.2"
Expand Down Expand Up @@ -135,7 +135,8 @@ plugin-serialization = { module = "org.jetbrains.kotlin:kotlin-serialization", v
plugin-kotlinJupyterApi = { module = "org.jetbrains.kotlin:kotlin-jupyter-api-gradle-plugin", version.ref = "jupyterApi" }

# id("com.github.johnrengelman.shadow")
plugin-shadowJar = { module = "gradle.plugin.com.github.johnrengelman:shadow", version.ref = "shadowJar" }
plugin-shadowJar = { module = "com.github.johnrengelman:shadow", version.ref = "shadowJar" }
plugin-ant = { module = "org.apache.ant:ant", version.ref = "ant" }

plugin-shadowJar-util = { module = "org.jetbrains.gradle:shadow-jar-util", version.ref = "shadowJarUtil" }

Expand All @@ -146,7 +147,7 @@ plugin-ktlint = { module = "org.jlleitschuh.gradle:ktlint-gradle", version.ref =
plugin-publisher = { module = "org.jetbrains.kotlin:kotlin-libs-publisher", version.ref = "publishPlugin" }

# id("org.hildan.github.changelog")
plugin-changelog = { module = "gradle.plugin.org.hildan.gradle:gradle-github-changelog", version.ref = "changelogPlugin" }
plugin-changelog = { module = "org.hildan.gradle:gradle-github-changelog", version.ref = "changelogPlugin" }

# id("com.github.ben-manes.versions")
plugin-versionsUpdater = { module = "com.github.ben-manes:gradle-versions-plugin", version.ref = "versionsPlugin" }
Expand All @@ -166,6 +167,7 @@ allGradlePlugins = [
"plugin-serialization",
"plugin-kotlinJupyterApi",
"plugin-shadowJar",
"plugin-ant",
"plugin-ktlint",
"plugin-publisher",
"plugin-changelog",
Expand Down
8 changes: 6 additions & 2 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pluginManagement {
}

plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version("0.5.0")
id("org.gradle.toolchains.foojay-resolver-convention") version ("0.5.0")
}

enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
Expand All @@ -29,9 +29,13 @@ libSubproject("test-kit")
exampleSubproject("getting-started")

fun libSubproject(name: String) = subproject(name, "jupyter-lib/")

fun exampleSubproject(name: String) = subproject(name, "api-examples/")

fun subproject(name: String, parentPath: String) {
fun subproject(
name: String,
parentPath: String,
) {
include(name)
project(":$name").projectDir = file("$parentPath$name")
}

0 comments on commit b554ce7

Please sign in to comment.