mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-21 09:46:02 +08:00
[unity] Unitypackage automation: added script to automatically create a unitypackage from a prepared unity project.
This commit is contained in:
parent
65b7078ca3
commit
f3a3bbf7f8
2
automation/spine-unity/unitypackage/.gitignore
vendored
Normal file
2
automation/spine-unity/unitypackage/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
*.unitypackage
|
||||||
|
*.log
|
||||||
@ -0,0 +1,62 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
date_string=`date +%Y-%m-%d`
|
||||||
|
package_filename="spine-unity-3_7-${date_string}.unitypackage"
|
||||||
|
export_dir="./packages"
|
||||||
|
unity_binary="/C/Program Files/Unity5.6/Editor/Unity"
|
||||||
|
|
||||||
|
input_args=()
|
||||||
|
while [[ $# -gt 0 ]]
|
||||||
|
do
|
||||||
|
key="$1"
|
||||||
|
|
||||||
|
case $key in
|
||||||
|
-u|--unity)
|
||||||
|
unity_binary="$2"
|
||||||
|
shift # past argument
|
||||||
|
shift # past value
|
||||||
|
;;
|
||||||
|
-f|--filename)
|
||||||
|
package_filename="$2"
|
||||||
|
shift # past argument
|
||||||
|
shift # past value
|
||||||
|
;;
|
||||||
|
-d|--export_dir)
|
||||||
|
export_dir="$2"
|
||||||
|
shift # past argument
|
||||||
|
shift # past value
|
||||||
|
;;
|
||||||
|
*) # unknown option
|
||||||
|
input_args+=("$1") # save it in an array for later
|
||||||
|
shift # past argument
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
set -- "${input_args[@]}" # restore positional parameters
|
||||||
|
if [[ -n $1 ]]; then
|
||||||
|
echo "Last line of file specified as non-opt/last argument:"
|
||||||
|
tail -1 "$1"
|
||||||
|
fi
|
||||||
|
|
||||||
|
logfile_dir="$export_dir/logfiles"
|
||||||
|
|
||||||
|
dir_spine="Assets/Spine"
|
||||||
|
dir_examples="Assets/Spine Examples"
|
||||||
|
|
||||||
|
|
||||||
|
# path initialization
|
||||||
|
prev_workingdir="$(pwd)"
|
||||||
|
script_path=${0%/*}
|
||||||
|
cd ${script_path}
|
||||||
|
absolute_script_path="$(pwd)"
|
||||||
|
|
||||||
|
unityproject_base="${absolute_script_path}/spine-3.7-unity5.6-unitypackage"
|
||||||
|
|
||||||
|
# prepare output dirs and pacakge
|
||||||
|
mkdir -p "$export_dir"
|
||||||
|
mkdir -p "$logfile_dir"
|
||||||
|
|
||||||
|
echo Writing unitypackage to "$export_dir/$package_filename", unity="$unity_binary"
|
||||||
|
"$unity_binary" -batchmode -nographics -logFile "$logfile_dir/${package_filename}.log" -projectPath "$unityproject_base" -exportPackage "$dir_spine" "$dir_examples" "../$export_dir/$package_filename" -quit
|
||||||
|
|
||||||
|
cd ${prev_workingdir}
|
||||||
@ -248,6 +248,11 @@ main() {
|
|||||||
git commit -m "[unity][auto] ${package_filename}: integrated changes of main repository up to commit ${out_commit_hash1}${optional_excluding_whitespace_message}."
|
git commit -m "[unity][auto] ${package_filename}: integrated changes of main repository up to commit ${out_commit_hash1}${optional_excluding_whitespace_message}."
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo ----------------------------------------------------------------------
|
||||||
|
echo Removing Library dir to be on the safe side with a clean start
|
||||||
|
echo ----------------------------------------------------------------------
|
||||||
|
rm -rf "Library"
|
||||||
|
|
||||||
echo ----------------------------------------------------------------------
|
echo ----------------------------------------------------------------------
|
||||||
echo Finished successfully
|
echo Finished successfully
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user