Skip to content

Commit 2820bc3

Browse files
committed
feat: add support for gradle 9.x
1 parent 475cae8 commit 2820bc3

File tree

8 files changed

+32
-19
lines changed

8 files changed

+32
-19
lines changed

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[versions]
2-
allay-gradle = "0.1.0"
2+
allay-gradle = "0.1.1"
33
gradle-plugin-publish = "2.0.0"
44
kotlin = "1.9.23"
55
kotlinx-serialization = "1.5.0"

gradle/wrapper/gradle-wrapper.jar

-19.7 KB
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-all.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

gradlew

Lines changed: 5 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gradlew.bat

Lines changed: 12 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

plugin/src/main/kotlin/org/allaymc/gradle/plugin/AllayExtension.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import javax.inject.Inject
1111
@Suppress("MemberVisibilityCanBePrivate", "unused")
1212
@ExtensionMarker
1313
abstract class AllayExtension @Inject constructor(objects: ObjectFactory) {
14-
val api: Property<String?> = objects.property(String::class.java)
14+
val api: Property<String> = objects.property(String::class.java)
1515
val server: Property<String> = objects.property(String::class.java).convention("+")
1616
val apiOnly: Property<Boolean> = objects.property(Boolean::class.java).convention(true)
1717

@@ -26,7 +26,7 @@ abstract class AllayExtension @Inject constructor(objects: ObjectFactory) {
2626
abstract class Config(objects: ObjectFactory) {
2727
val extra = objects.mapProperty<String, Any>()
2828

29-
operator fun <K : Any, V> MapProperty<K, V>.set(key: K, value: V?) {
29+
operator fun <K : Any, V : Any> MapProperty<K, V>.set(key: K, value: V?) {
3030
@Suppress("NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS")
3131
if (value != null) put(key, value)
3232
}
@@ -54,7 +54,7 @@ abstract class AllayExtension @Inject constructor(objects: ObjectFactory) {
5454

5555
val website: Property<String> = objects.property(String::class.java)
5656

57-
operator fun <T> ListProperty<T>.plusAssign(item: T) = addAll(item)
57+
operator fun <T : Any> ListProperty<T>.plusAssign(item: T) = addAll(item)
5858
}
5959

6060
abstract class Extension @Inject constructor(objects: ObjectFactory) : Config(objects)

plugin/src/main/kotlin/org/allaymc/gradle/plugin/AllayPlugin.kt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,15 @@ class AllayPlugin : Plugin<Project> {
1616
maven("https://www.jetbrains.com/intellij-repository/releases/")
1717
maven("https://repo.opencollab.dev/maven-releases/")
1818
maven("https://repo.opencollab.dev/maven-snapshots/")
19-
maven("https://storehouse.okaeri.eu/repository/maven-public/")
19+
maven("https://storehouse.okaeri.eu/repository/maven-public/") {
20+
content {
21+
// Storehouse's repository returns http status code 500 instead of 404 for non-existent
22+
// dependencies, which will cause the build to fail when using a dynamic version. To solve
23+
// this problem, we explicitly indicate that there is no allay-api in this repository as
24+
// well as allay-server
25+
excludeGroup("org.allaymc.allay")
26+
}
27+
}
2028
}
2129

2230
project.afterEvaluate { afterEvaluate(project, extension) }

plugin/src/main/kotlin/org/allaymc/gradle/plugin/descriptor/DescriptorInjector.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,5 +84,5 @@ private fun String?.ensureVersion(project: Project, property: Property<String>)
8484
private fun String?.template(property: Property<String>) =
8585
this?.replace("\${it}", property.orNull ?: "") ?: property.orNull
8686

87-
private operator fun <T> List<T>?.plus(property: ListProperty<T>) =
87+
private operator fun <T : Any> List<T>?.plus(property: ListProperty<T>) =
8888
(this ?: emptyList()) + property.get()

0 commit comments

Comments
 (0)