mirror of https://github.com/axmolengine/axmol.git
issue #2103: add lua files for lua multi-template project
This commit is contained in:
parent
4edd35e2b1
commit
0e66dc8712
|
@ -65,6 +65,18 @@ if [ -f "$file" ]; then
|
|||
fi
|
||||
done
|
||||
|
||||
# copy common luaScript
|
||||
for file in "$APP_ROOT"/../../scripting/lua/script/*
|
||||
do
|
||||
if [ -d "$file" ]; then
|
||||
cp -rf "$file" "$APP_ANDROID_ROOT"/assets
|
||||
fi
|
||||
|
||||
if [ -f "$file" ]; then
|
||||
cp "$file" "$APP_ANDROID_ROOT"/assets
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ "$buildexternalsfromsource" ]]; then
|
||||
echo "Building external dependencies from source"
|
||||
"$NDK_ROOT"/ndk-build -C "$APP_ANDROID_ROOT" $* \
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
APP_STL := gnustl_static
|
||||
APP_CPPFLAGS := -frtti -DCOCOS2D_DEBUG=1
|
||||
APP_CPPFLAGS := -frtti -DCOCOS2D_DEBUG=1 -DCC_ENABLE_CHIPMUNK_INTEGRATION=1
|
||||
APP_CPPFLAGS += -fexceptions
|
||||
|
|
|
@ -1 +1 @@
|
|||
efa24299f7d76b23ad5728ff9161fcdb67ff1af5
|
||||
1f1bfaa9b10bfeb0e02d367aa94e5bad6be3adc6
|
|
@ -15,6 +15,7 @@ include $(COCOS_ROOT)/cocos2dx/proj.linux/cocos2dx.mk
|
|||
|
||||
$(TARGET): $(OBJECTS) $(STATICLIBS) $(COCOS_LIBS) $(CORE_MAKEFILE_LIST)
|
||||
@mkdir -p $(@D)
|
||||
cp -n ../../../scripting/lua/script/* ../../../../samples/Lua/TestLua/Resources
|
||||
$(LOG_LINK)$(CXX) $(CXXFLAGS) $(OBJECTS) -o $@ $(SHAREDLIBS) $(STATICLIBS) $(LIBS)
|
||||
|
||||
$(OBJ_DIR)/%.o: ../%.cpp $(CORE_MAKEFILE_LIST)
|
||||
|
|
|
@ -42,3 +42,4 @@ files
|
|||
AppDelegate.cpp
|
||||
}
|
||||
|
||||
postbuild "cccopy.py -s ../../../scripting/lua/script/ -d ../Resources/
|
||||
|
|
|
@ -0,0 +1,46 @@
|
|||
import os
|
||||
import shutil
|
||||
from optparse import OptionParser
|
||||
|
||||
def cccopy(sourcePath, destPath):
|
||||
for root, dirs, files in os.walk(sourcePath):
|
||||
#figure out where we're going
|
||||
dest = destPath + root.replace(sourcePath, '')
|
||||
destAbsPath = os.path.abspath(destPath)
|
||||
#if we're in a directory that doesn't exist in the destination folder then create a new folder
|
||||
if not os.path.isdir(dest):
|
||||
os.mkdir(dest)
|
||||
print os.path.abspath(dest).replace(destAbsPath, '')[1:] + ' directory created.'
|
||||
|
||||
#loop through all files in the directory
|
||||
for f in files:
|
||||
#compute current (old) & new file locations
|
||||
oldLoc = root + "/" + f
|
||||
newLoc = dest + "/" + f
|
||||
|
||||
if not os.path.isfile(newLoc):
|
||||
try:
|
||||
shutil.copy2(oldLoc, newLoc)
|
||||
print os.path.abspath(newLoc).replace(destAbsPath,'')[1:] + ' copied.'
|
||||
except IOError:
|
||||
print os.path.abspath(newLoc).replace(destAbsPath,'')[1:] + ' already exists.'
|
||||
|
||||
|
||||
|
||||
# main
|
||||
def main():
|
||||
# parse options
|
||||
parser = OptionParser(usage="%prog [options]")
|
||||
parser.add_option("-s", "--sourcePath", action="store", help="Source path", dest="sourcePath")
|
||||
parser.add_option("-d", "--destPath", action="store", help="Destination path", dest="destPath")
|
||||
|
||||
(options, args) = parser.parse_args()
|
||||
|
||||
if options.sourcePath and options.destPath:
|
||||
cccopy(options.sourcePath, options.destPath)
|
||||
else:
|
||||
parser.error("")
|
||||
|
||||
## entry
|
||||
if __name__ == "__main__":
|
||||
main()
|
Loading…
Reference in New Issue