Update create_release.sh script to create Mac releases too

This commit is contained in:
David Capello 2014-06-06 08:51:11 -03:00
parent f2d3bcac29
commit 1ffccada68
2 changed files with 88 additions and 56 deletions

View File

@ -9,8 +9,19 @@ read version
echo -n "What kind of distribution (e.g. production, trial) ? "
read distribution
echo -n "What platform (e.g. win, mac) ? "
read platform
destdir=$(pwd)/aseprite-release-$version
if [ "$platform" == "win" ]; then
exefile=aseprite.exe
generator=ninja
elif [ "$platform" == "mac" ]; then
exefile=aseprite
generator=make
fi
# --------------------------
# Clone the local repository
# --------------------------
@ -24,7 +35,7 @@ fi
# --------------
cd "$destdir/scripts"
sh update_version.sh $version
sh $srcdir/scripts/update_version.sh $version
# ----------------------------------------------
# Make a build/ directory and compile with cmake
@ -33,6 +44,8 @@ sh update_version.sh $version
if [ ! -d "$destdir/build" ] ; then
mkdir "$destdir/build"
cd "$destdir/build"
if [ "$platform" == "win" ]; then
if [ "$distribution" == "production" ]; then
cmake \
-D "CMAKE_BUILD_TYPE:STRING=RelWithDebInfo" \
@ -51,19 +64,33 @@ if [ ! -d "$destdir/build" ] ; then
-G "Ninja" \
..
fi
elif [ "$platform" == "mac" ]; then
if [ "$distribution" == "production" ]; then
cmake \
-D "CMAKE_BUILD_TYPE:STRING=RelWithDebInfo" \
-G "Unix Makefiles" \
..
elif [ "$distribution" == "trial" ]; then
cmake \
-D "CMAKE_BUILD_TYPE:STRING=RelWithDebInfo" \
-D "ENABLE_TRIAL_MODE:BOOL=ON" \
-G "Unix Makefiles" \
..
fi
fi
fi
# -------
# Compile
# -------
if [ ! -f "$destdir/aseprite.exe" ] ; then
if [ ! -f "$destdir/$exefile" ] ; then
cd "$destdir/build"
ninja aseprite
$generator aseprite
cd "$destdir/build/src"
signexe aseprite.exe
cp aseprite.exe "$destdir"
signexe $exefile
cp $exefile "$destdir"
fi
# ---------------
@ -71,4 +98,8 @@ fi
# ---------------
cd "$destdir/scripts"
if [ "$platform" == "win" ]; then
sh create_packages.sh
elif [ "$platform" == "mac" ]; then
sh create_dmg.sh
fi

View File

@ -25,7 +25,8 @@ mv tmp ../src/config.h
sed -e "s/gui version=\".*/gui version=\"$version\">/" < ../data/gui.xml > tmp
mv tmp ../data/gui.xml
sed -e "s/FILEVERSION .*/FILEVERSION $version_win32/" < ../src/main/resources_win32.rc \
cat ../src/main/resources_win32.rc \
| sed -e "s/FILEVERSION .*/FILEVERSION $version_win32/" \
| sed -e "s/PRODUCTVERSION .*/PRODUCTVERSION $version_win32/" \
| sed -e "s/FileVersion\",.*/FileVersion\", \"$version_win32\"/" \
| sed -e "s/ProductVersion\",.*/ProductVersion\", \"$version_win32\"/" \