From 77cc7fe66960be49ed4810b8f359b8bf02f8171b Mon Sep 17 00:00:00 2001 From: coolGi Date: Mon, 17 Jul 2023 23:33:25 +0930 Subject: [PATCH] Fixed up buildAll scripts --- .gitignore | 2 ++ buildAll | 19 +++++++++++++------ buildAll.bat | 16 +++++++++++++--- 3 files changed, 28 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index b6f0d8f7a..547998298 100644 --- a/.gitignore +++ b/.gitignore @@ -22,6 +22,8 @@ hs_err_pid* **/src/generated/ Merged/ +# Folder created by the buildAll scripts +buildAllJars/ # file from notepad++ *.bak diff --git a/buildAll b/buildAll index fc042cb76..c34616428 100755 --- a/buildAll +++ b/buildAll @@ -1,15 +1,22 @@ #!/bin/sh +echo "==================== Note: All build jars will be in the folder called 'buildAllJars' ====================" +mkdir -p buildAllJars | true + # Loop trough everything in the version properties folder for d in versionProperties/*; do # Get the name of the version that is going to be compiled version=$(echo "$d" | sed "s/versionProperties\///" | sed "s/.properties//") - # Clean out the folders and build it + # Clean out the folders, build it, and merge it # (We could use "./" to run gradlew, but as it is a shell script im going to be running it with the "sh" command) - echo "Cleaning workspace to build $version" - sh gradlew clean -PmcVer=$version --no-daemon | true - echo "Building $version" - sh gradlew build -PmcVer=$version --no-daemon | true - # The "| true" at the end of those 2 are just to make sure the script continues even if a build fails + echo "==================== Cleaning workspace to build $version ====================" + sh gradlew clean -PmcVer=$version --no-daemon || true + echo "====================Building $version ====================" + sh gradlew build -PmcVer=$version --no-daemon || true + echo "==================== Merging $version ====================" + sh gradlew mergeJars -PmcVer=$version --no-daemon || true + echo "==================== Moving jar ====================" + mv Merged/*.jar buildAllJars/ || true + # The "| true" at the end of those are just to make sure the script continues even if a build fails done diff --git a/buildAll.bat b/buildAll.bat index cd0d93415..eb69d5c31 100644 --- a/buildAll.bat +++ b/buildAll.bat @@ -1,15 +1,25 @@ @echo off & setlocal enabledelayedexpansion +@rem Note for devs: If this script doesnt work, please look at the unix buildAll script +@rem This script was originally created on linux, so there may be some problems with this translation + + +echo ==================== Note: All build jars will be in the folder called 'buildAllJars' ==================== +mkdir buildAllJars @rem Loop trough everything in the version properties folder for %%f in (versionProperties\*) do ( @rem Get the name of the version that is going to be compiled set version=%%~nf - @rem Clean out the folders and build it - echo Cleaning workspace to build !version! + @rem Clean out the folders, build it, and merge it + echo ==================== Cleaning workspace to build !version! ==================== call .\gradlew.bat clean -PmcVer="!version!" --no-daemon - echo Building !version! + echo ==================== Building !version! ==================== call .\gradlew.bat build -PmcVer="!version!" --no-daemon + echo ==================== Merging !version! ==================== + call .\gradlew.bat mergeJars -PmcVer="!version!" --no-daemon + echo ==================== Moving jar ==================== + move Merged\*.jar buildAllJars\ ) endlocal