From bfc3512408109ae137a285ff65c64fcf8b85da1d Mon Sep 17 00:00:00 2001 From: Tobias de Bruijn Date: Sat, 4 Dec 2021 14:56:40 +0100 Subject: [PATCH] Fixed bugs - #21 - #20: aarch64 and armhf are now compiled with ubuntu xenial rather than ubuntu focal - An issue mentioned in Discord. x86_64 is now compiled with centos 7 rather than ubuntu xenial --- Makefile | 21 +++++++++++-------- gradle.properties | 2 +- lib/Cargo.toml | 6 +++++- .../commands/subcommands/GetCommand.java | 3 ++- 4 files changed, 20 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index 90a194c..02faee6 100644 --- a/Makefile +++ b/Makefile @@ -6,17 +6,17 @@ RUST_SOURCE_FILES := $(shell find lib/src -type f) # Release - Linux x86_64 Xenial lib/target/x86_64-unknown-linux-gnu/release/libskinfixer.so: ${RUST_SOURCE_FILES} mkdir -p lib/target/x86_64-unknown-linux-gnu/release - docker run -v "${CURDIR}/lib/:/code/" docker-registry.k8s.array21.dev/rust-amd64-xenial-builder release + docker run -v "${CURDIR}/lib/:/code/" docker-registry.k8s.array21.dev/rust-amd64-centos7 release # Release - Linux aarch64 lib/target/aarch64-unknown-linux-gnu/release/libskinfixer.so: ${RUST_SOURCE_FILES} mkdir -p lib/target/aarch64-unknown-linux-gnu/release - docker run -v "${CURDIR}/lib/:/code/" docker-registry.k8s.array21.dev/rust-aarch64-focal-builder release + docker run -v "${CURDIR}/lib/:/code/" docker-registry.k8s.array21.dev/rust-aarch64-xenial release # Release - Linux armhf lib/target/arm-unknown-linux-gnueabihf/release/libskinfixer.so: ${RUST_SOURCE_FILES} mkdir -p lib/target/arm-unknown-linux-gnueabihf/release - docker run -v "${CURDIR}/lib/:/code/" docker-registry.k8s.array21.dev/rust-armhf-focal-builder release + docker run -v "${CURDIR}/lib/:/code/" docker-registry.k8s.array21.dev/rust-armhf-xenial release # Release - Windows x86_64 lib/target/x86_64-pc-windows-gnu/release/libskinfixer.dll: ${RUST_SOURCE_FILES} @@ -30,19 +30,19 @@ lib/target/x86_64-pc-windows-gnu/release/libskinfixer.dll: ${RUST_SOURCE_FILES} # Release - Darwin x86_64 lib/target/x86_64-apple-darwin/release/libskinfixer.dylib: ${RUST_SOURCE_FILES} mkdir -p lib/target/x86_64-apple-darwin/release - docker run -v "${CURDIR}/lib/:/code/" docker-registry.k8s.array21.dev/rust-amd64-darwin-builder release + docker run -v "${CURDIR}/lib/:/code/" docker-registry.k8s.array21.dev/rust-amd64-darwin release # Debug - Linux x86_64 lib/target/x86_64-unknown-linux-gnu/debug/libskinfixer.so: ${RUST_SOURCE_FILES} - docker run -v "${CURDIR}/lib/:/code/" docker-registry.k8s.array21.dev/rust-amd64-focal-builder + docker run -v "${CURDIR}/lib/:/code/" docker-registry.k8s.array21.dev/rust-amd64-centos7 # Debug - Linux aarch64 lib/target/aarch64-unknown-linux-gnu/debug/libskinfixer.so: ${RUST_SOURCE_FILES} - docker run -v "${CURDIR}/lib/:/code/" docker-registry.k8s.array21.dev/rust-aarch64-focal-builder + docker run -v "${CURDIR}/lib/:/code/" docker-registry.k8s.array21.dev/rust-aarch64-xenial # Debug - Linux armhf lib/target/arm-unknown-linux-gnueabihf/debug/libskinfixer.so: ${RUST_SOURCE_FILES} - docker run -v "${CURDIR}/lib/:/code/" docker-registry.k8s.array21.dev/rust-armhf-focal-builder + docker run -v "${CURDIR}/lib/:/code/" docker-registry.k8s.array21.dev/rust-armhf-xenial # Debug - Windows x86_64 lib/target/x86_64-pc-windows-gnu/debug/libskinfixer.dll: ${RUST_SOURCE_FILES} @@ -53,14 +53,17 @@ lib/target/x86_64-pc-windows-gnu/debug/libskinfixer.dll: ${RUST_SOURCE_FILES} # Debug - Darwin x86_64 lib/target/x86_64-apple-darwin/debug/libskinfixer.dylib: ${RUST_SOURCE_FILES} - docker run -v "${CURDIR}/lib/:/code/" docker-registry.k8s.array21.dev/rust-amd64-darwin-builder + docker run -v "${CURDIR}/lib/:/code/" docker-registry.k8s.array21.dev/rust-amd64-darwin testjar: lib/target/x86_64-unknown-linux-gnu/debug/libskinfixer.so lib/target/aarch64-unknown-linux-gnu/debug/libskinfixer.so lib/target/arm-unknown-linux-gnueabihf/debug/libskinfixer.so lib/target/x86_64-pc-windows-gnu/debug/libskinfixer.dll lib/target/x86_64-apple-darwin/debug/libskinfixer.dylib chmod +x gradlew; rm -rf ./build/resources ./gradlew testjar -releasejar: lib/target/x86_64-unknown-linux-gnu/release/libskinfixer-focal.so lib/target/x86_64-unknown-linux-gnu/release/libskinfixer-bionic.so lib/target/x86_64-unknown-linux-gnu/release/libskinfixer-xenial.so lib/target/aarch64-unknown-linux-gnu/release/libskinfixer.so lib/target/arm-unknown-linux-gnueabihf/release/libskinfixer.so lib/target/x86_64-pc-windows-gnu/release/libskinfixer.dll lib/target/x86_64-apple-darwin/release/libskinfixer.dylib +releasejar: lib/target/x86_64-unknown-linux-gnu/release/libskinfixer.so lib/target/aarch64-unknown-linux-gnu/release/libskinfixer.so lib/target/arm-unknown-linux-gnueabihf/release/libskinfixer.so lib/target/x86_64-pc-windows-gnu/release/libskinfixer.dll lib/target/x86_64-apple-darwin/release/libskinfixer.dylib chmod +x gradlew rm -rf ./build/resources ./gradlew releasejar + +clean: + sudo rm -rf build lib/target \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 1d8c8ea..e03d3c1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1 +1 @@ -pluginVersion = 1.7.2 \ No newline at end of file +pluginVersion = 1.7.3 \ No newline at end of file diff --git a/lib/Cargo.toml b/lib/Cargo.toml index 9ba124e..009bc56 100755 --- a/lib/Cargo.toml +++ b/lib/Cargo.toml @@ -32,4 +32,8 @@ version = "21.0.2" default-features = false [patch.crates-io.mysql] -git = "https://github.com/TheDutchMC/rust-mysql-simple" \ No newline at end of file +git = "https://github.com/TheDutchMC/rust-mysql-simple" + +[profile.release] +lto = true +panic = "abort" \ No newline at end of file diff --git a/src/main/java/dev/array21/skinfixer/commands/subcommands/GetCommand.java b/src/main/java/dev/array21/skinfixer/commands/subcommands/GetCommand.java index b08e87b..1e7ab52 100644 --- a/src/main/java/dev/array21/skinfixer/commands/subcommands/GetCommand.java +++ b/src/main/java/dev/array21/skinfixer/commands/subcommands/GetCommand.java @@ -27,7 +27,8 @@ public void onSubcommand(SkinFixer plugin, CommandSender sender, String[] args) } if(args[0].contains("https://") || args[0].contains("http://")) { - String url = args[0].substring(0, args[0].indexOf('?')); + int indexOfQuery = args[0].indexOf('?'); + String url = args[0].substring(0, indexOfQuery > 0 ? indexOfQuery : args[0].length()); int code = new AddNewSkin(plugin).addByUrl(url); sender.sendMessage(ChatColor.GOLD + LangHandler.model.getCodeSkinAdded.replaceAll("%CODE%", ChatColor.RED + String.valueOf(code) + ChatColor.GOLD));