#!/bin/sh

if [ ! -d "cocos2d" ]; then
    wget http://cdn.cocos2d-x.org/cocos2d-x-3.15.1.zip
    unzip cocos2d-x-3.15.1.zip
    mv cocos2d-x-3.15.1 cocos2d
    rm cocos2d-x-3.15.1.zip
fi

./cocos2d/tools/cocos2d-console/bin/cocos compile -p android --android-studio

cp ./bin/debug/android/RedCore-debug.apk ./RedCore.apk