diff --git a/.github/workflows/call-detekt-validation.yml b/.github/workflows/call-detekt-validation.yml index 663c30b..58c8797 100644 --- a/.github/workflows/call-detekt-validation.yml +++ b/.github/workflows/call-detekt-validation.yml @@ -1,20 +1,22 @@ -name: "detekt-validation" +name: "Detekt static analysis" on: workflow_call: + jobs: detekt: - name: "Check project by detekt" + name: "Run detekt" runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 - - name: Set up JDK 1.17 - uses: actions/setup-java@v5 + - name: Checkout repository + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Set up JDK 21 + uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5.6.0 with: distribution: 'temurin' - java-version: '17' - - name: Give gradle permission + java-version: '21' + - name: Make gradlew executable run: chmod +x gradlew - - name: detekt - uses: gradle/gradle-build-action@v3 + - name: Run detekt + uses: gradle/gradle-build-action@ac2d340dc04d9e1113182899e983b5400c17cda1 # v3 with: - arguments: :build-logic:detekt \ No newline at end of file + arguments: detekt --stacktrace diff --git a/.github/workflows/call-gradle-wrapper-validation.yml b/.github/workflows/call-gradle-wrapper-validation.yml index 29cb46a..82055c0 100644 --- a/.github/workflows/call-gradle-wrapper-validation.yml +++ b/.github/workflows/call-gradle-wrapper-validation.yml @@ -1,12 +1,13 @@ -name: "gradle-wrapper-validation" +name: "Validate Gradle wrapper" on: workflow_call: jobs: validation: - name: "Gradle Wrapper Validation" + name: "Verify gradle-wrapper.jar checksum" runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 - - name: Validate Gradle Wrapper - uses: gradle/wrapper-validation-action@v3 \ No newline at end of file + - name: Checkout repository + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Verify Gradle wrapper checksum + uses: gradle/wrapper-validation-action@f9c9c575b8b21b6485636a91ffecd10e558c62f6 # v3 diff --git a/.github/workflows/call-publish-validation.yml b/.github/workflows/call-publish-validation.yml index a4616cc..3a6bfa2 100644 --- a/.github/workflows/call-publish-validation.yml +++ b/.github/workflows/call-publish-validation.yml @@ -1,4 +1,4 @@ -name: "Validate local publish" +name: "Validate publication" on: workflow_call: secrets: @@ -18,9 +18,8 @@ jobs: strategy: matrix: target: - - ":build-logic:convention:publishToMavenLocal" - - ":build-logic:property:publishToMavenLocal" - name: "Validate local publish" + - "publishToMavenLocal" + name: "Publish to Maven Local" runs-on: ubuntu-latest env: ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.ORG_GRADLE_PROJECT_MAVENCENTRALUSERNAME }} @@ -29,15 +28,16 @@ jobs: ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEYID }} ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEYPASSWORD }} steps: - - uses: actions/checkout@v6 - - name: Set up JDK 1.17 - uses: actions/setup-java@v5 + - name: Checkout repository + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Set up JDK 21 + uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5.6.0 with: distribution: 'temurin' - java-version: '17' - - name: Give gradle permission + java-version: '21' + - name: Make gradlew executable run: chmod +x gradlew - - name: Run publish - uses: gradle/gradle-build-action@v3 + - name: Publish to Maven Local + uses: gradle/gradle-build-action@ac2d340dc04d9e1113182899e983b5400c17cda1 # v3 with: - arguments: ${{ matrix.target }} --stacktrace \ No newline at end of file + arguments: ${{ matrix.target }} --stacktrace diff --git a/.github/workflows/call-release-mkdocs.yml b/.github/workflows/call-release-mkdocs.yml index ac0c381..89d0896 100644 --- a/.github/workflows/call-release-mkdocs.yml +++ b/.github/workflows/call-release-mkdocs.yml @@ -1,18 +1,21 @@ -name: "Build and deploy material mkdocs to gh-pages" +name: "Deploy MkDocs site to gh-pages" on: workflow_call: jobs: check_docs_files_change: - name: "Check docs files changed" + name: "Detect documentation changes" runs-on: ubuntu-latest + # needs.check_docs_files_change.outputs.DOCS_FILES_CHANGED outputs: DOCS_FILES_CHANGED: ${{ steps.docs_changed.outputs.any_changed }} steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 + - name: Checkout repository + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: submodules: 'recursive' - - name: Check that docs changed + # steps.docs_changed.outputs.any_changed + - name: Check whether docs sources changed id: docs_changed uses: tj-actions/changed-files@9426d40962ed5378910ee2e21d5f8c6fcbf2dd96 # v47.0.6 with: @@ -20,14 +23,20 @@ jobs: docs/** mkdocs.yml deploy: + name: "Build and publish MkDocs site" needs: [ check_docs_files_change ] if: needs.check_docs_files_change.outputs.DOCS_FILES_CHANGED == 'true' runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 - - uses: actions/setup-python@v6 + - name: Checkout repository + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Set up Python 3 + uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 with: python-version: 3.x - - run: pip install mkdocs-material - - run: pip install mkdocs-minify-plugin - - run: mkdocs gh-deploy --force + - name: Install mkdocs-material + run: pip install mkdocs-material + - name: Install mkdocs-minify-plugin + run: pip install mkdocs-minify-plugin + - name: Build and push site to gh-pages + run: mkdocs gh-deploy --force diff --git a/.github/workflows/call-release.yml b/.github/workflows/call-release.yml index bf83f12..134ec73 100644 --- a/.github/workflows/call-release.yml +++ b/.github/workflows/call-release.yml @@ -1,4 +1,4 @@ -name: "Release version" +name: "Publish release" on: workflow_call: secrets: @@ -12,10 +12,13 @@ on: required: true ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEYPASSWORD: required: true + # Optional PAT used to create the GitHub release. Falls back to GITHUB_TOKEN when unset. + ACTIONS_TOKEN: + required: false jobs: publish: - name: "Publish on MavenCentral" + name: "Publish to Maven Central" runs-on: ubuntu-latest env: ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.ORG_GRADLE_PROJECT_MAVENCENTRALUSERNAME }} @@ -24,41 +27,44 @@ jobs: ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEYID }} ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEYPASSWORD }} steps: - - uses: actions/checkout@v6 - - name: Set up JDK 1.17 - uses: actions/setup-java@v5 + - name: Checkout repository + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Set up JDK 21 + uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5.6.0 with: distribution: 'temurin' - java-version: '17' - - name: Give gradle permission + java-version: '21' + - name: Make gradlew executable run: chmod +x gradlew - - name: Run publish - uses: gradle/gradle-build-action@v3 + - name: Publish and release to Maven Central + uses: gradle/gradle-build-action@ac2d340dc04d9e1113182899e983b5400c17cda1 # v3 with: - arguments: :build-logic:convention:publishAllPublicationsToMavenCentralRepository :build-logic:property:publishAllPublicationsToMavenCentralRepository --stacktrace + arguments: publishToMavenCentral --stacktrace release: needs: [ publish ] - name: Create GitHub release + name: "Create GitHub release" runs-on: ubuntu-latest # Only for personal repositories permissions: contents: write steps: - - uses: actions/checkout@v6 - # steps.properties.outputs.project-version-string - # steps.properties.outputs.project-name - - uses: christian-draeger/read-properties@1.1.1 + - name: Checkout repository + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + # steps.properties.outputs.klibs-project-name + # steps.properties.outputs.klibs-project-version-string + - name: Read project name and version from gradle.properties + uses: christian-draeger/read-properties@908f99d3334be3802ec7cb528395a69d19914e7b # 1.1.1 id: properties with: - path: './build-logic/gradle.properties' - properties: 'project.name project.version.string' - - name: Create Release + path: './gradle.properties' + properties: 'klibs.project.name klibs.project.version.string' + - name: Create GitHub release id: create_release - uses: softprops/action-gh-release@v3 + uses: softprops/action-gh-release@3d0d9888cb7fd7b750713d6e236d1fcb99157228 # v3.0.2 env: - GITHUB_TOKEN: ${{ secrets.ACTIONS_TOKEN }} + GITHUB_TOKEN: ${{ secrets.ACTIONS_TOKEN || github.token }} with: - tag_name: ${{ steps.properties.outputs.project-version-string }} - name: ${{ steps.properties.outputs.project-name }} - ${{ steps.properties.outputs.project-version-string }} + tag_name: ${{ steps.properties.outputs.klibs-project-version-string }} + name: ${{ steps.properties.outputs.klibs-project-name }} - ${{ steps.properties.outputs.klibs-project-version-string }} draft: false prerelease: false diff --git a/.github/workflows/call-tests-validation.yml b/.github/workflows/call-tests-validation.yml index 0f65f64..d33977b 100644 --- a/.github/workflows/call-tests-validation.yml +++ b/.github/workflows/call-tests-validation.yml @@ -6,20 +6,22 @@ jobs: tests: strategy: matrix: - target: - - "test" - name: "Run tests" + include: + - platform: "macos-latest" + task: "allTests" + name: "Run multiplatform tests" runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 - - name: Set up JDK 1.17 - uses: actions/setup-java@v5 + - name: Checkout repository + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Set up JDK 21 + uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5.6.0 with: distribution: 'temurin' - java-version: '17' - - name: Give gradle permission + java-version: '21' + - name: Make gradlew executable run: chmod +x gradlew - name: Run tests - uses: gradle/gradle-build-action@v3 + uses: gradle/gradle-build-action@ac2d340dc04d9e1113182899e983b5400c17cda1 # v3 with: - arguments: ${{ matrix.target }} --stacktrace \ No newline at end of file + arguments: ${{ matrix.target }} --stacktrace diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 65b51e4..00ac4aa 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -1,4 +1,4 @@ -name: Pull request +name: Pull request checks on: pull_request: branches: @@ -22,17 +22,18 @@ concurrency: jobs: gradle_validation: - name: Validate gradle wrapper + name: Validate Gradle wrapper uses: ./.github/workflows/call-gradle-wrapper-validation.yml detekt_validation: - name: Check by detekt + name: Detekt static analysis needs: gradle_validation uses: ./.github/workflows/call-detekt-validation.yml -# tests_validation: -# needs: gradle_validation -# uses: ./.github/workflows/call-tests-validation.yml + tests_validation: + name: Tests + needs: gradle_validation + uses: ./.github/workflows/call-tests-validation.yml publish_validation: - name: Check publish + name: Validate publication needs: gradle_validation uses: ./.github/workflows/call-publish-validation.yml secrets: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 90dda52..e57524c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,20 +4,32 @@ on: branches: - master workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.event_name }}-${{github.ref_name}}-${{github.repository}} + cancel-in-progress: false + jobs: gradle_validation: - name: Validate gradle wrapper + name: Validate Gradle wrapper uses: ./.github/workflows/call-gradle-wrapper-validation.yml - mkdocs: - name: Deploy MkDocs - uses: ./.github/workflows/call-release-mkdocs.yml release: - name: Release + name: Publish release needs: gradle_validation uses: ./.github/workflows/call-release.yml secrets: ORG_GRADLE_PROJECT_MAVENCENTRALUSERNAME: ${{ secrets.ORG_GRADLE_PROJECT_MAVENCENTRALUSERNAME }} - ORG_GRADLE_PROJECT_MAVENCENTRALPASSWORD: ${{ secrets.ORG_GRADLE_PROJECT_mavenCentralPassword }} + ORG_GRADLE_PROJECT_MAVENCENTRALPASSWORD: ${{ secrets.ORG_GRADLE_PROJECT_MAVENCENTRALPASSWORD }} ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEY: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEY }} ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEYID: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEYID }} - ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEYPASSWORD: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEYPASSWORD }} \ No newline at end of file + ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEYPASSWORD: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEYPASSWORD }} + ACTIONS_TOKEN: ${{ secrets.ACTIONS_TOKEN }} + documentation: + name: Deploy MkDocs site + needs: release + uses: ./.github/workflows/call-release-mkdocs.yml + permissions: + contents: write diff --git a/README.md b/README.md index 24dfcd1..724604e 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,6 @@ Your root `build.gradle.kts` plugins { // klibs - core alias(libs.plugins.klibs.gradle.detekt) apply false - alias(libs.plugins.klibs.gradle.dokka.module) apply false alias(libs.plugins.klibs.gradle.dokka.root) apply false alias(libs.plugins.klibs.gradle.java.version) apply false alias(libs.plugins.klibs.gradle.java.utf8) apply false diff --git a/build-logic/build.gradle.kts b/build-logic/build.gradle.kts index 2795347..b8fd17f 100644 --- a/build-logic/build.gradle.kts +++ b/build-logic/build.gradle.kts @@ -5,13 +5,13 @@ import org.jetbrains.kotlin.gradle.dsl.KotlinBaseExtension plugins { `kotlin-dsl` alias(libs.plugins.vaniktech) apply false - id("ru.astrainteractive.gradleplugin.detekt") version "2.1.2" apply true + id("ru.astrainteractive.gradleplugin.detekt") version "2.3.0" apply true } private fun requireProperty(key: String): String { - return rootProject.property(key) + return rootProject.findProperty(key) ?.toString() - ?: throw GradleException("Could not find property $key") + ?: throw GradleException("Could not find property $key in gradle.properties") } private fun canSignPublication(): Boolean { @@ -21,20 +21,49 @@ private fun canSignPublication(): Boolean { } data class ProjectConfiguration( - val projectName: String = requireProperty("project.name"), - val projectDescription: String = requireProperty("project.description"), - val projectGroup: String = requireProperty("project.group"), - val projectWeb: String = requireProperty("project.web"), - val projectVersionString: String = requireProperty("project.version.string") + val projectName: String = requireProperty("klibs.project.name"), + val projectDescription: String = requireProperty("klibs.project.description"), + val projectGroup: String = requireProperty("klibs.project.group"), + val projectUrl: String = requireProperty("klibs.project.url"), + val projectVersionString: String = requireProperty("klibs.project.version.string") ) val projectConfiguration = ProjectConfiguration() +/** + * Lifecycle task on the `build-logic` root project which runs [taskName] in every subproject. + * + * Subprojects are resolved by path so that adding a new module does not require touching this file + * or the CI workflows. + */ +private fun registerAggregateTask(taskName: String, taskGroup: String, taskDescription: String) { + tasks.register(taskName) { + group = taskGroup + description = taskDescription + dependsOn(subprojects.map { subproject -> "${subproject.path}:$taskName" }) + } +} + +registerAggregateTask( + taskName = "publishToMavenLocal", + taskGroup = PublishingPlugin.PUBLISH_TASK_GROUP, + taskDescription = "Publishes every build-logic module to the local Maven repository" +) +registerAggregateTask( + taskName = "publishToMavenCentral", + taskGroup = PublishingPlugin.PUBLISH_TASK_GROUP, + taskDescription = "Publishes every build-logic module to Maven Central" +) + +tasks.named("test") { + dependsOn(subprojects.map { subproject -> "${subproject.path}:test" }) +} + allprojects { extensions.add("projectName", projectConfiguration.projectName) extensions.add("projectDescription", projectConfiguration.projectDescription) extensions.add("projectGroup", projectConfiguration.projectGroup) - extensions.add("projectWeb", projectConfiguration.projectWeb) + extensions.add("projectUrl", projectConfiguration.projectUrl) extensions.add("projectVersionString", projectConfiguration.projectVersionString) } @@ -71,13 +100,13 @@ subprojects { pom { name.set(projectConfiguration.projectName) description.set(projectConfiguration.projectDescription) - url.set(projectConfiguration.projectWeb) + url.set(projectConfiguration.projectUrl) licenses { license { name.set("MIT License") distribution.set("repo") - url.set("${projectConfiguration.projectWeb}/blob/master/LICENSE.md") + url.set("${projectConfiguration.projectUrl}/blob/master/LICENSE.md") } } developers { @@ -90,7 +119,7 @@ subprojects { scm { connection.set("scm:git:ssh://github.com/makeevrserg/gradle-plugin.git") developerConnection.set("scm:git:ssh://github.com/makeevrserg/gradle-plugin.git") - url.set(projectConfiguration.projectWeb) + url.set(projectConfiguration.projectUrl) } } if (canSignPublication()) { diff --git a/build-logic/convention/build.gradle.kts b/build-logic/convention/build.gradle.kts index 3531724..918d18e 100755 --- a/build-logic/convention/build.gradle.kts +++ b/build-logic/convention/build.gradle.kts @@ -29,13 +29,12 @@ dependencies { implementation(libs.dokka.gradle) implementation(libs.kobweb.gradle) implementation(libs.vaniktech) - implementation(projects.buildLogic.property) implementation(projects.property) } gradlePlugin { - website.set(projectWeb) - vcsUrl.set(projectWeb) + website.set(projectUrl) + vcsUrl.set(projectUrl) description = projectDescription plugins { create("detekt") { @@ -67,14 +66,6 @@ gradlePlugin { description = "Configures UTF-8 encoding for Java compilation tasks" tags.set(listOf("java", "encoding", "klibs")) } - create("klibs") { - id = "$projectGroup.$name" - implementationClass = "$projectGroup.plugin.KlibsExtensionPlugin" - displayName = "KLibs Properties Extension Plugin" - description = - "Registers a `klibs` project extension exposing gradle.properties values without imports in build.gradle.kts" - tags.set(listOf("configuration", "klibs")) - } create("rootinfo") { id = "$projectGroup.$name" implementationClass = "$projectGroup.plugin.ModuleInfoPlugin" diff --git a/build-logic/convention/src/main/kotlin/ru/astrainteractive/gradleplugin/plugin/ApkNamePlugin.kt b/build-logic/convention/src/main/kotlin/ru/astrainteractive/gradleplugin/plugin/ApkNamePlugin.kt index 4589980..8477f31 100644 --- a/build-logic/convention/src/main/kotlin/ru/astrainteractive/gradleplugin/plugin/ApkNamePlugin.kt +++ b/build-logic/convention/src/main/kotlin/ru/astrainteractive/gradleplugin/plugin/ApkNamePlugin.kt @@ -16,7 +16,7 @@ class ApkNamePlugin : Plugin { if (output is VariantOutputImpl) { val name = projectInfo.name val version = projectInfo.versionString - output.outputFileName.set("${name}-${target.name}-${version}-${variant.name}.apk") + output.outputFileName.set("$name-${target.name}-$version-${variant.name}.apk") } } } diff --git a/build-logic/settings.gradle.kts b/build-logic/settings.gradle.kts index c0ddead..8b75b31 100644 --- a/build-logic/settings.gradle.kts +++ b/build-logic/settings.gradle.kts @@ -1,4 +1,5 @@ enableFeaturePreview("STABLE_CONFIGURATION_CACHE") +enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") pluginManagement { repositories { diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 0000000..0e650e5 --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,45 @@ +/** + * The published artifacts of this repository live in the `build-logic` included build. + * + * The root build itself has no sources; it only forwards the lifecycle tasks used by CI + * (see `.github/workflows`) so that `./gradlew ` works from the repository root. + */ +val buildLogic = gradle.includedBuild("build-logic") + +/** + * Registers [taskName] on the root project, delegating to the task with the same name + * on the root project of the `build-logic` included build. + */ +fun registerDelegatingTask(taskName: String, taskGroup: String, taskDescription: String) { + tasks.register(taskName) { + group = taskGroup + description = taskDescription + dependsOn(buildLogic.task(":$taskName")) + } +} + +registerDelegatingTask( + taskName = "detekt", + taskGroup = LifecycleBasePlugin.VERIFICATION_GROUP, + taskDescription = "Runs detekt static analysis over build-logic" +) +registerDelegatingTask( + taskName = "detektFormat", + taskGroup = LifecycleBasePlugin.VERIFICATION_GROUP, + taskDescription = "Runs detekt with auto correction over build-logic" +) +registerDelegatingTask( + taskName = "test", + taskGroup = LifecycleBasePlugin.VERIFICATION_GROUP, + taskDescription = "Runs the build-logic tests" +) +registerDelegatingTask( + taskName = "publishToMavenLocal", + taskGroup = PublishingPlugin.PUBLISH_TASK_GROUP, + taskDescription = "Publishes every build-logic module to the local Maven repository" +) +registerDelegatingTask( + taskName = "publishToMavenCentral", + taskGroup = PublishingPlugin.PUBLISH_TASK_GROUP, + taskDescription = "Publishes every build-logic module to Maven Central" +) diff --git a/docs/convention.md b/docs/convention.md index d431aab..720556f 100644 --- a/docs/convention.md +++ b/docs/convention.md @@ -115,25 +115,6 @@ plugins { --- -### Dokka Module - -**ID:** `ru.astrainteractive.gradleplugin.dokka.module` - -Configures [Dokka](https://github.com/Kotlin/dokka) documentation generation for individual modules. - -```kotlin -plugins { - alias(libs.plugins.klibs.gradle.dokka.module) -} -``` - -- Applies `org.jetbrains.dokka` plugin -- Sets module name from `project.name` -- JDK version from `klibs.java.target` -- Supports `README.md` as module documentation entry point via `DokkaTaskPartial` - ---- - ### Dokka Root **ID:** `ru.astrainteractive.gradleplugin.dokka.root` diff --git a/gradle.properties b/gradle.properties index e57fe8f..b8520f1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,8 +4,8 @@ klibs.java.source=8 klibs.java.target=17 klibs.java.ktarget=17 # Config -project.name=GradlePlugin -project.description=GradlePlugin for my kotlin projects -project.group=ru.astrainteractive.gradleplugin -project.web=https://github.com/makeevrserg/gradle-plugin -project.version.string=2.3.0 +klibs.project.name=GradlePlugin +klibs.project.description=GradlePlugin for my kotlin projects +klibs.project.group=ru.astrainteractive.gradleplugin +klibs.project.url=https://github.com/makeevrserg/gradle-plugin +klibs.project.version.string=2.4.0 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index e4b8b86..c29dccc 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -4,8 +4,8 @@ detekt = "2.0.0-alpha.5" # https://detekt.dev/docs/gettingstarted/gradle/ dokka = "2.2.0" # https://github.com/kotlin/dokka fabric-loom = "1.16.1" # https://github.com/FabricMC/fabric-loom forge-gradle = "7.0.25" # https://github.com/MinecraftForge/ForgeGradle -kobweb = "0.24.0" # https://github.com/varabyte/kobweb -kotlin = "2.4.0" # https://github.com/jetbrains/kotlin +kobweb = "0.25.0" # https://github.com/varabyte/kobweb +kotlin = "2.4.10" # https://github.com/jetbrains/kotlin neoforge-gradle = "7.1.20" # https://github.com/neoforged/NeoGradle vaniktech = "0.37.0" # https://github.com/vanniktech/gradle-maven-publish-plugin diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 249e583..b1b8ef5 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index a6e933d..53761cb 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.6.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists \ No newline at end of file diff --git a/gradlew b/gradlew index 1b6c787..249efbb 100755 --- a/gradlew +++ b/gradlew @@ -1,7 +1,7 @@ #!/bin/sh # -# Copyright © 2015-2021 the original authors. +# Copyright © 2015 the original authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -15,10 +15,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # -# Gradle start up script for POSIX generated by Gradle. +# gradlew start up script for POSIX generated by Gradle. # # Important for running: # @@ -27,7 +29,7 @@ # bash, then to run this script, type that shell name before the whole # command line, like: # -# ksh Gradle +# ksh gradlew # # Busybox and similar reduced shells will NOT work, because this script # requires all of these POSIX shell features: @@ -55,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/3d91ce3b8caaf77ad09f381f43615b715b53f72c/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -80,13 +82,11 @@ do esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -114,7 +114,6 @@ case "$( uname )" in #( NONSTOP* ) nonstop=true ;; esac -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. @@ -133,22 +132,29 @@ location of your Java installation." fi else JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." + fi fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac case $MAX_FD in #( '' | soft) :;; #( *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -165,7 +171,6 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) JAVACMD=$( cygpath --unix "$JAVACMD" ) @@ -193,18 +198,27 @@ if "$cygwin" || "$msys" ; then done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ + -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ "$@" +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + # Use "xargs" to parse quoted args. # # With -n1 it outputs one arg per line, with the quotes and backslashes removed. diff --git a/gradlew.bat b/gradlew.bat index 107acd3..8508ef6 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -1,89 +1,82 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem gradlew startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables, and ensure extensions are enabled +setlocal EnableExtensions + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +"%COMSPEC%" /c exit 1 + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +"%COMSPEC%" /c exit 1 + +:execute +@rem Setup the command line + + + +@rem Execute gradlew +@rem endlocal doesn't take effect until after the line is parsed and variables are expanded +@rem which allows us to clear the local environment before executing the java command +endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel + +:exitWithErrorLevel +@rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts +"%COMSPEC%" /c exit %ERRORLEVEL%