Skip to content

Commit

Permalink
Build updates
Browse files Browse the repository at this point in the history
  • Loading branch information
jpenilla committed Nov 4, 2023
1 parent e8d04b2 commit 2599b74
Show file tree
Hide file tree
Showing 9 changed files with 54 additions and 40 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ dependencies {

// testing dependencies
testImplementation(memoryMeasurer("com.volkhart.memory", "measurer", "0.2-SNAPSHOT"))
devBundle("io.papermc.paper:dev-bundle:1.19.4-R0.1-SNAPSHOT")
devBundle("io.papermc.paper:dev-bundle:1.20.2-R0.1-SNAPSHOT")
}
9 changes: 4 additions & 5 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ repositories {
}

dependencies {
implementation("net.kyori", "indra-common", "3.0.1")
implementation("net.kyori", "indra-licenser-cadix", "3.0.1")
implementation("net.kyori", "indra-publishing-sonatype", "3.0.1")
implementation("gradle.plugin.org.cadixdev.gradle", "licenser", "0.6.1")
implementation("io.papermc.paperweight.userdev", "io.papermc.paperweight.userdev.gradle.plugin", "1.5.5")
implementation("net.kyori", "indra-common", "3.1.3")
implementation("net.kyori", "indra-licenser-spotless", "3.1.3")
implementation("net.kyori", "indra-publishing-sonatype", "3.1.3")
implementation("io.papermc.paperweight.userdev", "io.papermc.paperweight.userdev.gradle.plugin", "1.5.9")
}
10 changes: 5 additions & 5 deletions buildSrc/src/main/kotlin/base-conventions.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins {
`java-library`
id("net.kyori.indra")
id("net.kyori.indra.checkstyle")
id("net.kyori.indra.license-header")
id("net.kyori.indra.licenser.spotless")
}

if (project != rootProject) {
Expand All @@ -19,8 +19,8 @@ indra {
}
}

license {
header.set(resources.text.fromFile(rootProject.file("LICENSE_HEADER")))
indraSpotlessLicenser {
licenseHeaderFile(rootProject.file("LICENSE_HEADER"))
}

tasks {
Expand All @@ -43,8 +43,8 @@ repositories {
}

dependencies {
compileOnlyApi("org.checkerframework", "checker-qual", "3.24.0")
compileOnlyApi("org.checkerframework", "checker-qual", "3.40.0")

testImplementation("org.junit.jupiter", "junit-jupiter-api", "5.9.0")
testImplementation("org.junit.jupiter", "junit-jupiter-api", "5.10.0")
testRuntimeOnly("org.junit.jupiter", "junit-jupiter-engine")
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
29 changes: 17 additions & 12 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,8 @@ done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

# 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 "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down Expand Up @@ -133,26 +131,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=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
Expand Down Expand Up @@ -197,11 +198,15 @@ 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, 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" \
Expand Down
26 changes: 14 additions & 12 deletions test-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
plugins {
`base-conventions`
id("io.papermc.paperweight.userdev")
id("xyz.jpenilla.run-paper") version "2.1.0"
id("net.minecrell.plugin-yml.bukkit") version "0.5.2"
id("com.github.johnrengelman.shadow") version "7.1.2"
id("xyz.jpenilla.run-paper") version "2.2.0"
id("com.github.johnrengelman.shadow") version "8.1.1"
}

indra {
Expand All @@ -13,11 +12,11 @@ indra {
}

dependencies {
paperweight.paperDevBundle("1.19.4-R0.1-SNAPSHOT")
paperweight.paperDevBundle("1.20.2-R0.1-SNAPSHOT")

implementation(projects.reflectionRemapper)

implementation(platform("cloud.commandframework:cloud-bom:1.8.3"))
implementation(platform("cloud.commandframework:cloud-bom:1.8.4"))
implementation("cloud.commandframework", "cloud-paper")
implementation("cloud.commandframework", "cloud-minecraft-extras") {
isTransitive = false // Paper provides adventure
Expand All @@ -34,11 +33,14 @@ tasks {
reloc("cloud.commandframework")
reloc("io.leangen.geantyref")
}
}

bukkit {
name = "ReflectionRemapperTest"
main = "xyz.jpenilla.reflectionremapper.testplugin.TestPlugin"
apiVersion = "1.19"
authors = listOf("jmp")
processResources {
val props = mapOf(
"version" to project.version,
"desc" to project.description,
)
inputs.properties(props)
filesMatching("plugin.yml") {
expand(props)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import net.minecraft.server.level.ServerLevel;
import net.minecraft.server.level.ServerPlayer;
import org.bukkit.command.CommandSender;
import org.bukkit.craftbukkit.v1_19_R3.entity.CraftPlayer;
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftPlayer;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
import org.checkerframework.checker.nullness.qual.NonNull;
Expand Down Expand Up @@ -63,13 +63,13 @@ private void registerCommands(final PaperCommandManager<CommandSender> manager)

private void executeCreateEndPlatform(final CommandContext<CommandSender> ctx) {
final ServerPlayer serverPlayer = ((CraftPlayer) ctx.getSender()).getHandle();
Reflection.SERVER_PLAYER.createEndPlatform(serverPlayer, serverPlayer.getLevel(), serverPlayer.blockPosition());
Reflection.SERVER_PLAYER.createEndPlatform(serverPlayer, (ServerLevel) serverPlayer.level(), serverPlayer.blockPosition());
}

private void executeStrikeLightning(final CommandContext<CommandSender> ctx) {
final ServerPlayer serverPlayer = ((CraftPlayer) ctx.getSender()).getHandle();
final BlockPos lightningTarget = Reflection.SERVER_LEVEL.findLightningTargetAround(serverPlayer.getLevel(), serverPlayer.blockPosition());
((Player) ctx.getSender()).getWorld().strikeLightning(MCUtil.toLocation(serverPlayer.getLevel(), lightningTarget));
final BlockPos lightningTarget = Reflection.SERVER_LEVEL.findLightningTargetAround((ServerLevel) serverPlayer.level(), serverPlayer.blockPosition());
((Player) ctx.getSender()).getWorld().strikeLightning(MCUtil.toLocation(serverPlayer.level(), lightningTarget));
}

public static final class Reflection {
Expand Down
7 changes: 7 additions & 0 deletions test-plugin/src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: ReflectionRemapperTest
version: $version
main: xyz.jpenilla.reflectionremapper.testplugin.TestPlugin
description: $desc
authors:
- jmp
api-version: 1.20

0 comments on commit 2599b74

Please sign in to comment.