Commit ea759f66 by Jonathan Thomas

Updating build.sh to allow for ONLY_VERSION and DRY_RUN - so we can build…

Updating build.sh to allow for ONLY_VERSION and DRY_RUN - so we can build specific builds, or print out version info for specific builds.
parent ed0ec403
Pipeline #13944 passed with stages
in 2 minutes 6 seconds
# CreatureChat Agent Instructions
See **build.sh** for commands and supported Minecraft/Fabric versions.
## To Build
Run this to build **all versions**:
```bash
./build.sh
````
Build a **specific version** only:
```bash
ONLY_VERSION=1.20.1 ./build.sh
```
Preview the build steps without making changes:
```bash
DRY_RUN=1 ./build.sh
```
Or for a specific version:
```bash
ONLY_VERSION=1.20.1 DRY_RUN=1 ./build.sh
```
## Notes
* This script modifies `gradle.properties` and `fabric.mod.json`
* Run only when you're ready to test builds
...@@ -10,10 +10,28 @@ for i in "${!versions[@]}"; do ...@@ -10,10 +10,28 @@ for i in "${!versions[@]}"; do
yarn_mappings="${mappings[$i]}" yarn_mappings="${mappings[$i]}"
fabric_version="${fabric_versions[$i]}" fabric_version="${fabric_versions[$i]}"
if [[ -n "$ONLY_VERSION" && "$minecraft_version" != "$ONLY_VERSION" ]]; then
continue
fi
echo "****" echo "****"
echo "Building for Minecraft Version $minecraft_version with Fabric $fabric_version" echo "Preparing build for Minecraft $minecraft_version with Fabric $fabric_version"
echo "****" echo "****"
if [[ "$DRY_RUN" == "1" ]]; then
echo "[DRY RUN] Would update gradle.properties:"
echo " minecraft_version=$minecraft_version"
echo " yarn_mappings=$yarn_mappings"
echo " loader_version=0.15.11"
echo " fabric_version=$fabric_version"
echo "[DRY RUN] Would edit fabric.mod.json: \"minecraft\": \"~$minecraft_version\""
echo "[DRY RUN] Would run: ./gradlew build -x test"
echo "[DRY RUN] Would fetch: https://github.com/FabricMC/fabric/releases/download/${fabric_version//+/%2B}/fabric-api-${fabric_version}.jar"
echo ""
continue
fi
# Modify configs
sed -i "s/^minecraft_version=.*/minecraft_version=$minecraft_version/" gradle.properties sed -i "s/^minecraft_version=.*/minecraft_version=$minecraft_version/" gradle.properties
sed -i "s/^yarn_mappings=.*/yarn_mappings=$yarn_mappings/" gradle.properties sed -i "s/^yarn_mappings=.*/yarn_mappings=$yarn_mappings/" gradle.properties
sed -i "s/^loader_version=.*/loader_version=0.15.11/" gradle.properties sed -i "s/^loader_version=.*/loader_version=0.15.11/" gradle.properties
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment