From aa0c85a5282e08c4836389142e2d63803973c39f Mon Sep 17 00:00:00 2001 From: Dominic Date: Mon, 25 Nov 2024 18:13:24 +0100 Subject: [PATCH 1/3] attempt to patch for 1.9.20 fails to find the subproject, whatever gradle is doing, I have no idea --- 0001-enable-application-plugin.patch | 18 +++++++++--------- 0002-embed-plugin-dependencies.patch | 11 ++++++----- 0003-disable-gradle-enterprise.patch | 28 ++++++++++++---------------- PKGBUILD | 18 +++++++++--------- 4 files changed, 36 insertions(+), 39 deletions(-) diff --git a/0001-enable-application-plugin.patch b/0001-enable-application-plugin.patch index bfceb14..8ae59fb 100644 --- a/0001-enable-application-plugin.patch +++ b/0001-enable-application-plugin.patch @@ -1,14 +1,14 @@ ---- runners/cli/build.gradle.kts 2022-08-21 15:44:14.274863135 +0200 -+++ runners/cli/build.gradle.kts 2022-08-21 15:44:53.244731374 +0200 -@@ -3,6 +3,11 @@ - - plugins { - id("com.github.johnrengelman.shadow") -+ id("application") +--- dokka-runners/runner-cli/build.gradle.kts.bak 2024-11-25 18:02:19.205828622 +0100 ++++ dokka-runners/runner-cli/build.gradle.kts 2024-11-25 18:02:49.315906342 +0100 +@@ -8,6 +8,11 @@ + id("dokkabuild.kotlin-jvm") + id("dokkabuild.publish-shadow") + alias(libs.plugins.kotlinx.binaryCompatibilityValidator) ++ id("application") +} + +application { -+ mainClass.set("org.jetbrains.dokka.MainKt") ++ mainClass.set("org.jetbrains.dokka.MainKt") } - dependencies { + overridePublicationArtifactId("dokka-cli") diff --git a/0002-embed-plugin-dependencies.patch b/0002-embed-plugin-dependencies.patch index 0eee86c..d80fc62 100644 --- a/0002-embed-plugin-dependencies.patch +++ b/0002-embed-plugin-dependencies.patch @@ -1,10 +1,11 @@ ---- runners/cli/build.gradle.kts.bak 2023-11-22 17:57:41.923139585 +0100 -+++ runners/cli/build.gradle.kts 2023-11-22 18:04:46.718648023 +0100 -@@ -18,7 +18,9 @@ +--- dokka-runners/runner-cli/build.gradle.kts.bak 2024-11-25 18:04:03.479431056 +0100 ++++ dokka-runners/runner-cli/build.gradle.kts 2024-11-25 18:06:05.606385737 +0100 +@@ -18,8 +18,10 @@ + overridePublicationArtifactId("dokka-cli") dependencies { - implementation(projects.core) -+ implementation(projects.subprojects.analysisKotlinApi) + implementation("org.jetbrains.dokka:dokka-core") ++ implementation("org.jetbrains.dokka:analysis-kotlin-api") implementation(libs.kotlinx.cli) + implementation(libs.kotlinx.html) diff --git a/0003-disable-gradle-enterprise.patch b/0003-disable-gradle-enterprise.patch index 8a5267d..9e7ec5d 100644 --- a/0003-disable-gradle-enterprise.patch +++ b/0003-disable-gradle-enterprise.patch @@ -1,24 +1,19 @@ ---- settings.gradle.kts.bak 2023-11-22 18:20:42.369002363 +0100 -+++ settings.gradle.kts 2023-11-22 18:21:00.853981373 +0100 -@@ -54,10 +54,6 @@ - } +--- settings.gradle.kts.bak 2024-11-25 18:06:58.849846016 +0100 ++++ settings.gradle.kts 2024-11-25 18:07:14.506550205 +0100 +@@ -55,7 +55,6 @@ } --plugins { + plugins { - `gradle-enterprise` --} -- - include( - ":core", - ":core:test-api", -@@ -101,17 +97,4 @@ - ":docs-developer", + id("org.gradle.toolchains.foojay-resolver-convention") version "0.7.0" + } + +@@ -94,16 +93,6 @@ + ":dokka-subprojects:plugin-versioning", ) -val isCiBuild = System.getenv("GITHUB_ACTIONS") != null || System.getenv("TEAMCITY_VERSION") != null - -- -- -gradleEnterprise { - buildScan { - termsOfServiceUrl = "https://gradle.com/terms-of-service" @@ -27,5 +22,6 @@ - } -} - -- - enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") + // This hack is required for included build support. + // The name of the published artifact is `dokka-core`, but the module is named `core`. + // For some reason, dependency substitution doesn't work in this case. Maybe we fall under one of the unsupported diff --git a/PKGBUILD b/PKGBUILD index 23efb08..10c1bae 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -2,7 +2,7 @@ # Maintainer: Dominic Meiser [git at msrd0 dot de] pkgname='dokka' -pkgver=1.9.10 +pkgver=1.9.20 pkgrel=1 pkgdesc='Documentation Engine for Kotlin' url="https://kotlin.github.io/dokka/$pkgver/" @@ -10,17 +10,17 @@ license=('Apache') arch=('any') depends=('freemarker' 'java-environment') -makedepends=('gradle' 'jdk8-openjdk' 'npm') +makedepends=('gradle' 'jdk11-openjdk' 'npm') source=("https://github.com/Kotlin/dokka/archive/refs/tags/v$pkgver.tar.gz" '0001-enable-application-plugin.patch' '0002-embed-plugin-dependencies.patch' '0003-disable-gradle-enterprise.patch' 'dokka') -sha256sums=('6ff50037806e140cff4a12b98c8e6631c2aedbd867b04dcc40ade9880c75d0fc' - '78d2f4fd30508c9b634e22655da275b0db4c5317d71bb3cd746f851702a31d93' - 'bef57356bd152795195100874c918fa27c35407507aa13f08267dce0b0dcc1de' - '2bac7e5f944f4f2342eaabff4b60666f3681dd945ff96e8bb56491c6dda4deb8' +sha256sums=('c1d2e9b0547c9a8023f0fb81e8d7ceabc25a11a1de20e387010217a79ade4ac2' + '022deed27194a1cca2b981b1cd941828a4f1446c91af1f8339a4adfb983667b3' + 'e4a33df4d96234ef7be45811b6422c6adbd8749d0ffb505631912f6fe7e12d34' + 'a833d13aad3b30d5718cc952dcdbf26dfb023ebb3282d20f14bb9889f195561f' '9c7aa9721fe0b2c3cf3831a4d0b1720f13b070734d7be2702f820267ca11e277') prepare() { @@ -36,14 +36,14 @@ prepare() { build() { cd "$srcdir/dokka-$pkgver" - JAVA_HOME=/usr/lib/jvm/java-8-openjdk gradle :runners:cli:distTar - JAVA_HOME=/usr/lib/jvm/java-8-openjdk gradle :plugins:base:jar + JAVA_HOME=/usr/lib/jvm/java-11-openjdk gradle :dokka-runners:runner-cli:distTar + JAVA_HOME=/usr/lib/jvm/java-11-openjdk gradle :plugins:base:jar } package() { cd "$srcdir/dokka-$pkgver" mkdir -p "$pkgdir/usr/lib/dokka" - tar xf "runners/cli/build/distributions/cli-$pkgver.tar" --strip-components=1 -C "$pkgdir/usr/lib/dokka/" + tar xf "dokka-runners/runner-cli/build/distributions/cli-$pkgver.tar" --strip-components=1 -C "$pkgdir/usr/lib/dokka/" rm "$pkgdir/usr/lib/dokka/bin/cli.bat" install -Dm644 "plugins/base/build/libs/base-$pkgver.jar" "$pkgdir/usr/lib/dokka/plugins/base.jar" install -Dm755 ../dokka -t "$pkgdir/usr/bin/" From f42a8b5a77cb376fb6f760f0328bcd9fb608e945 Mon Sep 17 00:00:00 2001 From: Dominic Date: Mon, 25 Nov 2024 18:19:53 +0100 Subject: [PATCH 2/3] patch away appendReproducibleNewLine it worked locally for me before, but CI complained --- .SRCINFO | 4 +++- ...-reference-appendReproducibleNewLine.patch | 24 +++++++++++++++++++ PKGBUILD | 5 +++- 3 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 0004-fix-unresolved-reference-appendReproducibleNewLine.patch diff --git a/.SRCINFO b/.SRCINFO index 9cd9e98..1c92080 100644 --- a/.SRCINFO +++ b/.SRCINFO @@ -6,7 +6,7 @@ pkgbase = dokka arch = any license = Apache makedepends = gradle - makedepends = jre8-openjdk-headless + makedepends = jdk8-openjdk makedepends = npm depends = freemarker depends = java-environment @@ -14,11 +14,13 @@ pkgbase = dokka source = 0001-enable-application-plugin.patch source = 0002-embed-plugin-dependencies.patch source = 0003-disable-gradle-enterprise.patch + source = 0004-fix-unresolved-reference-appendReproducibleNewLine.patch source = dokka sha256sums = 6ff50037806e140cff4a12b98c8e6631c2aedbd867b04dcc40ade9880c75d0fc sha256sums = 78d2f4fd30508c9b634e22655da275b0db4c5317d71bb3cd746f851702a31d93 sha256sums = bef57356bd152795195100874c918fa27c35407507aa13f08267dce0b0dcc1de sha256sums = 2bac7e5f944f4f2342eaabff4b60666f3681dd945ff96e8bb56491c6dda4deb8 + sha256sums = 53723fe300fad66e174f582e08040406978c064beb1e3925be04deea7bbff206 sha256sums = 9c7aa9721fe0b2c3cf3831a4d0b1720f13b070734d7be2702f820267ca11e277 pkgname = dokka diff --git a/0004-fix-unresolved-reference-appendReproducibleNewLine.patch b/0004-fix-unresolved-reference-appendReproducibleNewLine.patch new file mode 100644 index 0000000..be6783c --- /dev/null +++ b/0004-fix-unresolved-reference-appendReproducibleNewLine.patch @@ -0,0 +1,24 @@ +--- runners/maven-plugin/build.gradle.kts.bak 2024-11-25 18:17:09.331346014 +0100 ++++ runners/maven-plugin/build.gradle.kts 2024-11-25 18:18:00.384807178 +0100 +@@ -2,7 +2,6 @@ + * Copyright 2014-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. + */ + +-import org.gradle.kotlin.dsl.support.appendReproducibleNewLine + import org.jetbrains.registerDokkaArtifactPublication + + plugins { +@@ -78,11 +77,11 @@ + buildString { + val lines = pluginHelpProperties.readText().lines().iterator() + // the first line is a descriptive comment +- appendReproducibleNewLine(lines.next()) ++ append(lines.next()).append("\n") + // the second line is the timestamp, which should be ignored + lines.next() + // the remaining lines are properties +- lines.forEach { appendReproducibleNewLine(it) } ++ lines.forEach { append(it).append("\n") } + } + ) + } diff --git a/PKGBUILD b/PKGBUILD index 23efb08..965197f 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -16,11 +16,13 @@ source=("https://github.com/Kotlin/dokka/archive/refs/tags/v$pkgver.tar.gz" '0001-enable-application-plugin.patch' '0002-embed-plugin-dependencies.patch' '0003-disable-gradle-enterprise.patch' + '0004-fix-unresolved-reference-appendReproducibleNewLine.patch' 'dokka') sha256sums=('6ff50037806e140cff4a12b98c8e6631c2aedbd867b04dcc40ade9880c75d0fc' '78d2f4fd30508c9b634e22655da275b0db4c5317d71bb3cd746f851702a31d93' 'bef57356bd152795195100874c918fa27c35407507aa13f08267dce0b0dcc1de' '2bac7e5f944f4f2342eaabff4b60666f3681dd945ff96e8bb56491c6dda4deb8' + '53723fe300fad66e174f582e08040406978c064beb1e3925be04deea7bbff206' '9c7aa9721fe0b2c3cf3831a4d0b1720f13b070734d7be2702f820267ca11e277') prepare() { @@ -28,7 +30,8 @@ prepare() { for patch in \ '0001-enable-application-plugin.patch' \ '0002-embed-plugin-dependencies.patch' \ - '0003-disable-gradle-enterprise.patch' + '0003-disable-gradle-enterprise.patch' \ + '0004-fix-unresolved-reference-appendReproducibleNewLine.patch' do patch -N -p0 -i "../$patch" done From e24e929535d68da68e85ecbbb1d6563779fb4c9b Mon Sep 17 00:00:00 2001 From: Dominic Date: Mon, 25 Nov 2024 18:21:07 +0100 Subject: [PATCH 3/3] CI: only push on main branch --- {.gitea => .forgejo}/workflows/mirror.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) rename {.gitea => .forgejo}/workflows/mirror.yml (88%) diff --git a/.gitea/workflows/mirror.yml b/.forgejo/workflows/mirror.yml similarity index 88% rename from .gitea/workflows/mirror.yml rename to .forgejo/workflows/mirror.yml index c7de72c..d39e9a9 100644 --- a/.gitea/workflows/mirror.yml +++ b/.forgejo/workflows/mirror.yml @@ -1,5 +1,7 @@ name: Mirror -on: [push] +on: + push: + branches: [main] jobs: mirror: