Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ tasks.register<GenerateDataFromManPages>("generateDataFromManPages") {
systemdSourceCodeRoot = file("./systemd-build/build/")
generatedJsonFileLocation =
file(sourceSets["main"].output.resourcesDir?.getAbsolutePath() + "/net/sjrx/intellij/plugins/systemdunitfiles/semanticdata")
renderedXIncludesDir = project.layout.buildDirectory.dir("tmp/rendered-xincludes").get().asFile
}
/*
* Lexing / Parsing and Grammar Tasks
Expand Down Expand Up @@ -226,6 +227,7 @@ tasks.register("mergePodmanDocumentation") {
val semanticDataDir = file("${sourceSets["main"].output.resourcesDir?.getAbsolutePath()}/net/sjrx/intellij/plugins/systemdunitfiles/semanticdata")
val podmanJsonFile = file("./src/main/resources/net/sjrx/intellij/plugins/systemdunitfiles/semanticdata/podman/podman-sectionToKeywordMapFromDoc.json")
val targetJsonFile = file("${semanticDataDir}/sectionToKeywordMapFromDoc.json")
val undocumentedJsonFile = file("${semanticDataDir}/undocumentedSectionToKeywordMap.json")

inputs.file(podmanJsonFile)

Expand Down Expand Up @@ -261,7 +263,6 @@ tasks.register("mergePodmanDocumentation") {
targetJsonFile.writeText(output)

// Merge undocumented keywords (deprecated/moved options)
val undocumentedJsonFile = file("${semanticDataDir}/undocumentedSectionToKeywordMap.json")
@Suppress("UNCHECKED_CAST")
val undocData = slurper.parse(undocumentedJsonFile) as MutableMap<String, Any>
@Suppress("UNCHECKED_CAST")
Expand Down
9 changes: 8 additions & 1 deletion buildSrc/src/main/groovy/GenerateDataFromManPages.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ class GenerateDataFromManPages extends DefaultTask {
@OutputDirectory
File generatedJsonFileLocation

/**
* Scratch directory for XInclude-rendered XML. Supplied at configuration time so the task
* does not access Task.project at execution time (deprecated and configuration-cache hostile).
*/
@Internal
File renderedXIncludesDir

/**
* Map that stores for each file name, the name of an option attribute
*/
Expand Down Expand Up @@ -455,7 +462,7 @@ class GenerateDataFromManPages extends DefaultTask {
xmlContent = processXIncludesWithRegex(xmlContent, sourceFile.parentFile)


File outputDir = project.layout.buildDirectory.dir("tmp/rendered-xincludes").get().asFile
File outputDir = renderedXIncludesDir
if (!outputDir.exists()) {
outputDir.mkdirs()
}
Expand Down
20 changes: 18 additions & 2 deletions ci/Build-Environment.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,36 @@
FROM ubuntu:22.04
FROM ubuntu:24.04

RUN apt-get update

RUN apt-get install -y git openjdk-21-jdk-headless

WORKDIR /tmp

# Ubuntu 24.04 ships a default 'ubuntu' user occupying UID 1000, which collides with the
# builduser we create below. Remove it so builduser can keep UID 1000 (matching the pod's
# runAsUser: 1000).
RUN userdel -r ubuntu || true

RUN useradd -m builduser -u 1000

# Pin GRADLE_USER_HOME to a path baked into the image rather than letting it default to a
# location under the ephemeral CI workspace. This ensures the dependency cache warmed below
# (including the ~1 GiB IntelliJ Platform SDK) is actually reused at runtime instead of being
# re-downloaded on every build. It stays hermetic: each pod gets its own copy-on-write view
# of this directory from the immutable image, with no shared mutable host state.
ENV GRADLE_USER_HOME=/home/builduser/.gradle

USER 1000

ARG BRANCH=242.x

# Warm the dependency cache. 'dependencies' resolves every configuration and 'compileKotlin'
# pulls the IntelliJ Platform SDK onto the compile classpath, so the ~1 GiB SDK gets baked in.
# Do NOT add compileTestKotlin here: it drags the docker-compose metadata task (composeBuild)
# into the graph, which needs a Docker daemon that isn't available during the image build.
RUN git clone --depth 1 -b ${BRANCH} https://github.com/SJrX/systemdUnitFilePlugin.git && \
cd /tmp/systemdUnitFilePlugin && \
/tmp/systemdUnitFilePlugin/gradlew --no-daemon --build-cache dependencies compileKotlin && \
rm -rf /tmp/systemdUnitFilePlugin/

WORKDIR /
WORKDIR /