Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: zml2008/gradle-plugins
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 6.1.0
Choose a base ref
...
head repository: zml2008/gradle-plugins
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 6.2.0
Choose a head ref
  • 8 commits
  • 12 files changed
  • 2 contributors

Commits on Sep 9, 2023

  1. Copy the full SHA
    0f3722c View commit details

Commits on Jan 3, 2025

  1. Fix localization plugin configuration cache incompatibility

    jpenilla committed Jan 3, 2025
    Copy the full SHA
    1c86b66 View commit details

Commits on Jan 4, 2025

  1. chore: fix spotless violations

    zml2008 committed Jan 4, 2025
    Copy the full SHA
    f7dfce2 View commit details
  2. Merge branch 'trunk' into fix-config-cache

    zml2008 authored Jan 4, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    0623001 View commit details
  3. Merge pull request #4 from jpenilla/fix-config-cache

    Fix localization plugin configuration cache incompatibility
    zml2008 authored Jan 4, 2025
    Copy the full SHA
    cdd08a7 View commit details
  4. Update Gradle wrapper to 8.12, build with embedded Kotlin version, ad…

    …d Gradle API version attribute to require minimum 8.12 runtime (#5)
    
    * Update Gradle wrapper to 8.12, build with embedded Kotlin version, add Gradle API version attribute to require minimum 8.12 runtime
    jpenilla authored Jan 4, 2025
    Copy the full SHA
    4334de9 View commit details

Commits on Mar 9, 2025

  1. fix: update repository urls for new system

    zml2008 committed Mar 9, 2025
    Copy the full SHA
    87efee3 View commit details
  2. release: version 6.2.0

    zml2008 committed Mar 9, 2025
    Copy the full SHA
    cd20015 View commit details
33 changes: 21 additions & 12 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import com.diffplug.gradle.spotless.SpotlessExtension
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmProjectExtension

plugins {
alias(libs.plugins.kotlin) apply false
embeddedKotlin("jvm") apply false
alias(libs.plugins.indra) apply false
alias(libs.plugins.indra.licenserSpotless) apply false
alias(libs.plugins.indra.gradlePlugin) apply false
}

group = "ca.stellardrift"
version = "6.1.0"
version = "6.2.0"
description = "A suite of plugins to apply defaults preferred for Stellardrift projects"

subprojects {
@@ -20,18 +21,25 @@ subprojects {
apply(plugin="net.kyori.indra.publishing.gradle-plugin")
apply(plugin="org.jetbrains.kotlin.jvm")

extensions.configure(KotlinJvmProjectExtension::class) {
coreLibrariesVersion = "1.5.31"
target {
compilations.configureEach {
kotlinOptions {
languageVersion = "1.4"
freeCompilerArgs = freeCompilerArgs + listOf("-Xjvm-default=all")
}
configurations.configureEach {
if (isCanBeConsumed) {
val usage = attributes.getAttribute(Usage.USAGE_ATTRIBUTE) ?: return@configureEach
if (usage.name in setOf(Usage.JAVA_RUNTIME, Usage.JAVA_API)) {
attributes.attribute(
GradlePluginApiVersion.GRADLE_PLUGIN_API_VERSION_ATTRIBUTE,
objects.named(GradleVersion.current().version)
)
}
}
}

extensions.configure(KotlinJvmProjectExtension::class) {
compilerOptions {
jvmTarget = JvmTarget.JVM_17
freeCompilerArgs.addAll(listOf("-Xjvm-default=all", "-Xjdk-release=17"))
}
}

dependencies {
"implementation"(gradleKotlinDsl())

@@ -80,6 +88,7 @@ subprojects {
ci(true)
}
apache2License()
javaVersions().target(17)

configurePublications {
pom {
@@ -92,8 +101,8 @@ subprojects {
}
}

publishReleasesTo("stellardrift", "https://repo.stellardrift.ca/repository/releases/")
publishSnapshotsTo("stellardrift", "https://repo.stellardrift.ca/repository/snapshots/")
publishReleasesTo("stellardrift", "https://repo.stellardrift.ca/maven/releases/")
publishSnapshotsTo("stellardrift", "https://repo.stellardrift.ca/maven/snapshots/")
}

extensions.configure(net.kyori.indra.gradle.IndraPluginPublishingExtension::class) {
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2020-2023 zml
* Copyright 2020-2025 zml
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2020-2023 zml
* Copyright 2020-2025 zml
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
8 changes: 3 additions & 5 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -6,12 +6,11 @@ configurate = "4.1.2"
goomph = "3.42.2"
gson = "2.10.1"
immutables = "2.9.3"
indra = "3.1.2"
junit = "5.10.0"
kotlin = "1.9.10"
indra = "3.1.3"
junit = "5.11.4"
ktlint = "0.49.1"
mammoth = "1.3.1"
spotless = "6.21.0"
spotless = "6.25.0"

[libraries]

@@ -44,6 +43,5 @@ zKtlint = { module = "com.pinterest.ktlint:ktlint-core", version.ref = "ktlint"
indra = { id = "net.kyori.indra", version.ref = "indra"}
indra-gradlePlugin = { id = "net.kyori.indra.publishing.gradle-plugin", version.ref = "indra" }
indra-licenserSpotless = { id = "net.kyori.indra.licenser.spotless", version.ref = "indra" }
kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
spotless = { id = "com.diffplug.spotless", version.ref = "spotless"}
eclipseApt = { id = "com.diffplug.eclipse.apt", version.ref = "goomph"}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
20 changes: 11 additions & 9 deletions gradlew
Original file line number Diff line number Diff line change
@@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#

##############################################################################
#
@@ -55,7 +57,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/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/.
@@ -84,7 +86,7 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
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
@@ -145,15 +147,15 @@ 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=SC3045
# 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=SC3045
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
@@ -202,11 +204,11 @@ fi
# 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 $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.
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_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" \
22 changes: 12 additions & 10 deletions gradlew.bat
Original file line number Diff line number Diff line change
@@ -13,6 +13,8 @@
@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 ##########################################################################
@@ -43,11 +45,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 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.
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

goto fail

@@ -57,11 +59,11 @@ 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.
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

goto fail

Original file line number Diff line number Diff line change
@@ -55,8 +55,6 @@ open class LocalizationExtension @Inject constructor(objects: ObjectFactory) {
}

abstract class LocalizationGenerate : DefaultTask() {
private val templateEngine = StreamingTemplateEngine()

@get:Inject
abstract val objectFactory: ObjectFactory

@@ -84,14 +82,14 @@ abstract class LocalizationGenerate : DefaultTask() {

@TaskAction
fun generateSources() {
val template = templateEngine.createTemplate(templateFile.get().asFile)
val template = StreamingTemplateEngine().createTemplate(templateFile.get().asFile)
tree.visit {
if (it.isDirectory) {
return@visit
}
val path = it.relativePath

val packageName = path.parent.segments.joinToString(".").toLowerCase(Locale.ROOT)
val packageName = path.parent.segments.joinToString(".").lowercase(Locale.ROOT)
val className = path.lastName.split('.', limit = 2).first().capitalize()
val destinationPath = path.replaceLastName("$className.${templateType.get().extension}").getFile(generatedSourcesOut.asFile.get())

@@ -104,7 +102,7 @@ abstract class LocalizationGenerate : DefaultTask() {
"bundleName" to "$packageName.${path.lastName.split('.', limit = 2).first()}",
"packageName" to packageName,
"className" to className,
"keys" to propertiesFile.keys
"keys" to propertiesFile.keys,
)

destinationPath.parentFile.mkdirs()
Original file line number Diff line number Diff line change
@@ -104,8 +104,8 @@ class OpinionatedDefaultsPlugin : Plugin<Project> {
it.manifest.attributes(
mapOf(
"Automatic-Module-Name"
to "$group.${name.replace("-", ".").toLowerCase(Locale.ROOT)}"
)
to "$group.${name.replace("-", ".").lowercase(Locale.ROOT)}",
),
)
}
}
6 changes: 3 additions & 3 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
pluginManagement {
repositories {
maven("https://repo.stellardrift.ca/repository/internal/") {
maven("https://repo.stellardrift.ca/maven/internal/") {
name = "stellardriftReleases"
mavenContent { releasesOnly() }
}
maven("https://repo.stellardrift.ca/repository/snapshots/") {
maven("https://repo.stellardrift.ca/maven/snapshots/") {
name = "stellardriftSnapshots"
mavenContent { snapshotsOnly() }
}
}
}

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

dependencyResolutionManagement {
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2022 zml
* Copyright 2022-2025 zml
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,7 +21,7 @@
import org.gradle.api.artifacts.repositories.MavenRepositoryContentDescriptor;

class StellardriftRepositoryExtensionImpl implements StellardriftRepositoryExtension {
private static final String BASE_URL = "https://repo.stellardrift.ca/repository/";
private static final String BASE_URL = "https://repo.stellardrift.ca/maven/";

private static final String RELEASES_URL = BASE_URL + "internal/";
private static final String OWN_RELEASES_URL = BASE_URL + "releases/";