Skip to content

Commit

Permalink
Fix script issues
Browse files Browse the repository at this point in the history
Temporarily explicitly declare Spigot dependencies
I don't have the time to deal with whatever the difference between remote and local bash/maven versions is right now.
  • Loading branch information
Jikoo committed Jun 11, 2021
1 parent 07a8e3b commit ff7243d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 19 deletions.
2 changes: 1 addition & 1 deletion scripts/generate_changelog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function lookup_email_username() {

# Get a pretty list of supported Minecraft versions
function get_minecraft_versions() {
versions=$(. ./scripts/get_spigot_versions.sh)
readarray -t versions <<< "$(. ./scripts/get_spigot_versions.sh)"

for version in "${versions[@]}"; do
# Append comma if variable is set, then append version
Expand Down
23 changes: 8 additions & 15 deletions scripts/get_spigot_versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,21 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#

# Note that this script is designed for use in GitHub Actions, and is not
# particularly robust nor configurable. Run from project parent directory.
# TODO FIGURE OUT AND REMOVE WHEN LESS STRESS
hacky_versions=("1.16.5-R0.1-SNAPSHOT" "1.17-R0.1-SNAPSHOT")
for hacky_version in "${hacky_versions[@]}"; do
echo "$hacky_version"
done

# Use a nameref as a cache - maven evaluation is pretty slow.
# Re-calling the script and relying on it to handle caching is way easier than passing around info.
declare -a spigot_versions
exit 0

# We don't care about concatenation - either it's not null and we return or it's null and we instantiate.
# shellcheck disable=SC2199
if [[ ${spigot_versions[@]} ]]; then
for spigot_version in "${spigot_versions[@]}"; do
echo "$spigot_version"
done
return
fi
# Note that this script is designed for use in GitHub Actions, and is not
# particularly robust nor configurable. Run from project parent directory.

# Pull Spigot dependency information from Maven.
# Since we only care about Spigot versions, only check modules in the folder internal.
readarray -t modules <<< "$(mvn help:evaluate -Dexpression=project.modules -q -DforceStdout -P all | grep -oP '(?<=<string>)(internal/.*)(?=</string>)')"

declare -n versions="spigot_versions"

for module in "${modules[@]}"; do
# Get number of dependencies declared in pom of specified internal module.
max_index=$(mvn help:evaluate -Dexpression=project.dependencies -q -DforceStdout -P all -pl "$module" | grep -c "<dependency>")
Expand Down
4 changes: 2 additions & 2 deletions scripts/install_spigot_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ get_buildtools () {
wget https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar -O $buildtools
}

versions=$(. ./scripts/get_spigot_versions.sh)
echo Found Spigot dependencies: "$versions"
readarray -t versions <<< "$(. ./scripts/get_spigot_versions.sh)"
echo Found Spigot dependencies: "${versions[@]}"

for version in "${versions[@]}"; do
set -e
Expand Down
2 changes: 1 addition & 1 deletion scripts/set_curseforge_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

# Parse Spigot dependency information into major Minecraft versions
function get_curseforge_minecraft_versions() {
versions=$(. ./scripts/get_spigot_versions.sh)
readarray -t versions <<< "$(. ./scripts/get_spigot_versions.sh)"

for version in "${versions[@]}"; do
# Parse Minecraft major version
Expand Down

0 comments on commit ff7243d

Please sign in to comment.