-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
35 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
venv | ||
.nmlcache | ||
ss.grf | ||
ss_community.grf | ||
build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,38 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
# We use --quiet because otherwise nmlc complains about the sprites not being marked as ANIM. | ||
# These warnings can be ignored because nmlc will generate animated sprites regardless of the ANIM/NOANIM flag. | ||
|
||
# Compile a GRF we can upload to BaNaNaS as the community edition | ||
nmlc --quiet -c --grf ss_community.grf sailingships.nml | ||
# Compile a GRF that will overwrite the classic one | ||
sed 's/CMC\\01/JM\\01\\01/' sailingships.nml|nmlc --quiet -c --grf ss.grf /dev/stdin | ||
VERSION=$(grep -oP 'VERSION :\K.*' custom_tags.txt) | ||
|
||
bundle() { | ||
local dst="$1" | ||
local compilecmd="$2" | ||
|
||
rm -rf $dst $dst.tar | ||
mkdir -p $dst | ||
cp license.txt $dst | ||
cp readme.md $dst/readme.txt | ||
grep -oPz '## Changelog(\n|.)*' readme.md > $dst/changelog.txt | ||
eval $compilecmd | ||
tar -cf $dst.tar -C `dirname $dst` `basename $dst` | ||
} | ||
|
||
|
||
bundle_bananas() { | ||
# Compile a GRF we can upload to BaNaNaS as the community edition | ||
local dst=build/Sailing_Ships_community-$VERSION | ||
local cmd="nmlc --quiet -c --grf $dst/ss_community.grf sailingships.nml" | ||
bundle $dst "$cmd" | ||
} | ||
|
||
bundle_compatibility_edition() { | ||
# Compile a GRF that will overwrite the classic one (for existing games, etc) | ||
local dst=build/Sailing_Ships-$VERSION | ||
local cmd="sed 's/CMC\\01/JM\\01\\01/' sailingships.nml|nmlc --quiet -c --grf $dst/ss.grf /dev/stdin" | ||
bundle $dst "$cmd" | ||
} | ||
|
||
bundle_bananas | ||
bundle_compatibility_edition |