I was wondering if this was the best solution:
I keep the plain text .applescript files in Git, and I have a simple Bash script that I run every time I want to make a build of the app, which takes care of compiling the AppleScript. Here's my script:
#!/usr/bin/env bash
APPNAME="My Awesome App"
# make sure we're in the right place
if [ ! -d ".git" ]; then
echo "ERROR: This script must be run from the root of the repository."
exit
fi
# clear out old build
rm -r dist/*
mkdir -p "dist/$APPNAME.app/"
# copy files
cp -r app/* "dist/$APPNAME.app/"
# compile all applescript
cd "dist/$APPNAME.app/Contents/Resources/Scripts/"
for f in *.applescript
do
osacompile -o "`basename -s .applescript "$f"`.scpt" "$f"
rm "$f"
done
This script assumes that you have your entire app (i.e. the Contents/ folder and everything in it) inside the folder app/ in the root of your Git repository. It copies everything over to a new copy of the app in dist/, then compiles all AppleScript files in the Contents/Resources/Scripts/ folder of the new copy.
To use this yourself, I recommend copying my script to bin/build.sh in the root of your repository, running chmod +x bin/build.sh to make it executable, and then just run ./bin/build.sh any time you want a new build of your app.