diff --git a/native/templates/js-template-default/cocos-project-template.json b/native/templates/js-template-default/cocos-project-template.json index c2a11dc87c..5c06dcdb33 100755 --- a/native/templates/js-template-default/cocos-project-template.json +++ b/native/templates/js-template-default/cocos-project-template.json @@ -46,6 +46,7 @@ "frameworks/runtime-src/proj.android/build.xml", "frameworks/runtime-src/proj.android/res/values/strings.xml", "frameworks/runtime-src/proj.android-studio/settings.gradle", + "frameworks/runtime-src/proj.android-studio/app/res/values/strings.xml", "frameworks/runtime-src/proj.ios_mac/ios/main.m", "frameworks/runtime-src/proj.ios_mac/ios/Prefix.pch", "frameworks/runtime-src/proj.ios_mac/PROJECT_NAME.xcodeproj/project.pbxproj", diff --git a/native/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/AndroidManifest.xml b/native/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/AndroidManifest.xml index 59cb2ffb84..447d63d2f3 100755 --- a/native/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/AndroidManifest.xml +++ b/native/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/AndroidManifest.xml @@ -10,9 +10,9 @@ android:icon="@mipmap/ic_launcher"> - - + + - - + + - + \ No newline at end of file diff --git a/native/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/jni/Android.mk b/native/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/jni/Android.mk index 26a744cd2c..d53d0b7fdb 100755 --- a/native/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/jni/Android.mk +++ b/native/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/jni/Android.mk @@ -6,10 +6,12 @@ LOCAL_MODULE := cocos2djs_shared LOCAL_MODULE_FILENAME := libcocos2djs +ifeq ($(USE_ARM_MODE),1) +LOCAL_ARM_MODE := arm +endif + LOCAL_SRC_FILES := hellojavascript/main.cpp \ - ../../../Classes/AppDelegate.cpp \ - ../../../Classes/CCScale9Sprite.cpp \ - ../../../Classes/jsb/jsb_creator_auto.cpp + ../../../Classes/AppDelegate.cpp LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../../Classes diff --git a/native/templates/js-template-default/frameworks/runtime-src/proj.android-studio/build.gradle b/native/templates/js-template-default/frameworks/runtime-src/proj.android-studio/build.gradle index 9405f3fd18..1b7886d148 100755 --- a/native/templates/js-template-default/frameworks/runtime-src/proj.android-studio/build.gradle +++ b/native/templates/js-template-default/frameworks/runtime-src/proj.android-studio/build.gradle @@ -5,7 +5,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:1.2.3' + classpath 'com.android.tools.build:gradle:1.3.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/native/templates/js-template-default/frameworks/runtime-src/proj.android-studio/gradle/wrapper/gradle-wrapper.properties b/native/templates/js-template-default/frameworks/runtime-src/proj.android-studio/gradle/wrapper/gradle-wrapper.properties index 0c71e760dc..e7faee01a4 100755 --- a/native/templates/js-template-default/frameworks/runtime-src/proj.android-studio/gradle/wrapper/gradle-wrapper.properties +++ b/native/templates/js-template-default/frameworks/runtime-src/proj.android-studio/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip diff --git a/native/templates/js-template-link/cocos-project-template.json b/native/templates/js-template-link/cocos-project-template.json index 6b6b7fc694..def50e1629 100755 --- a/native/templates/js-template-link/cocos-project-template.json +++ b/native/templates/js-template-link/cocos-project-template.json @@ -51,6 +51,7 @@ "frameworks/runtime-src/proj.android/build.xml", "frameworks/runtime-src/proj.android/res/values/strings.xml", "frameworks/runtime-src/proj.android-studio/settings.gradle", + "frameworks/runtime-src/proj.android-studio/app/res/values/strings.xml", "frameworks/runtime-src/proj.ios_mac/ios/main.m", "frameworks/runtime-src/proj.ios_mac/ios/Prefix.pch", "frameworks/runtime-src/proj.ios_mac/PROJECT_NAME.xcodeproj/project.pbxproj", diff --git a/native/templates/js-template-link/frameworks/runtime-src/proj.android-studio/app/AndroidManifest.xml b/native/templates/js-template-link/frameworks/runtime-src/proj.android-studio/app/AndroidManifest.xml index 59cb2ffb84..447d63d2f3 100755 --- a/native/templates/js-template-link/frameworks/runtime-src/proj.android-studio/app/AndroidManifest.xml +++ b/native/templates/js-template-link/frameworks/runtime-src/proj.android-studio/app/AndroidManifest.xml @@ -10,9 +10,9 @@ android:icon="@mipmap/ic_launcher"> - - + + - - + + - + \ No newline at end of file diff --git a/native/templates/js-template-link/frameworks/runtime-src/proj.android-studio/app/jni/Android.mk b/native/templates/js-template-link/frameworks/runtime-src/proj.android-studio/app/jni/Android.mk index 26a744cd2c..d53d0b7fdb 100755 --- a/native/templates/js-template-link/frameworks/runtime-src/proj.android-studio/app/jni/Android.mk +++ b/native/templates/js-template-link/frameworks/runtime-src/proj.android-studio/app/jni/Android.mk @@ -6,10 +6,12 @@ LOCAL_MODULE := cocos2djs_shared LOCAL_MODULE_FILENAME := libcocos2djs +ifeq ($(USE_ARM_MODE),1) +LOCAL_ARM_MODE := arm +endif + LOCAL_SRC_FILES := hellojavascript/main.cpp \ - ../../../Classes/AppDelegate.cpp \ - ../../../Classes/CCScale9Sprite.cpp \ - ../../../Classes/jsb/jsb_creator_auto.cpp + ../../../Classes/AppDelegate.cpp LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../../Classes diff --git a/native/templates/js-template-link/frameworks/runtime-src/proj.android-studio/build-cfg.json b/native/templates/js-template-link/frameworks/runtime-src/proj.android-studio/build-cfg.json index d427ea47b6..5a884a4368 100755 --- a/native/templates/js-template-link/frameworks/runtime-src/proj.android-studio/build-cfg.json +++ b/native/templates/js-template-link/frameworks/runtime-src/proj.android-studio/build-cfg.json @@ -1,8 +1,10 @@ { "ndk_module_path" :[ - "../../cocos2d-x", - "../../cocos2d-x/cocos", - "../../cocos2d-x/external" + "${COCOS_X_ROOT}", + "${COCOS_X_ROOT}/cocos", + "${COCOS_X_ROOT}/external", + "${COCOS_X_ROOT}/external/android/include", + "${COCOS_X_ROOT}/external/android/spidermonkey" ], "copy_resources": [ { @@ -18,12 +20,12 @@ "to": "" }, { - "from": "../../../project.json", - "to": "" + "from": "${COCOS_X_ROOT}/cocos/scripting/js-bindings/script", + "to": "script" }, { - "from": "../../cocos2d-x/cocos/scripting/js-bindings/script", - "to": "script" + "from": "../../../project.json", + "to": "" } ] } diff --git a/native/templates/js-template-link/frameworks/runtime-src/proj.android-studio/build.gradle b/native/templates/js-template-link/frameworks/runtime-src/proj.android-studio/build.gradle index 9405f3fd18..1b7886d148 100755 --- a/native/templates/js-template-link/frameworks/runtime-src/proj.android-studio/build.gradle +++ b/native/templates/js-template-link/frameworks/runtime-src/proj.android-studio/build.gradle @@ -5,7 +5,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:1.2.3' + classpath 'com.android.tools.build:gradle:1.3.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/native/templates/js-template-link/frameworks/runtime-src/proj.android-studio/gradle/wrapper/gradle-wrapper.properties b/native/templates/js-template-link/frameworks/runtime-src/proj.android-studio/gradle/wrapper/gradle-wrapper.properties index 0c71e760dc..e7faee01a4 100755 --- a/native/templates/js-template-link/frameworks/runtime-src/proj.android-studio/gradle/wrapper/gradle-wrapper.properties +++ b/native/templates/js-template-link/frameworks/runtime-src/proj.android-studio/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip diff --git a/native/templates/js-template-link/frameworks/runtime-src/proj.android-studio/settings.gradle b/native/templates/js-template-link/frameworks/runtime-src/proj.android-studio/settings.gradle index 133ec2d702..52bd19dfee 100755 --- a/native/templates/js-template-link/frameworks/runtime-src/proj.android-studio/settings.gradle +++ b/native/templates/js-template-link/frameworks/runtime-src/proj.android-studio/settings.gradle @@ -1,4 +1,4 @@ include ':libcocos2dx' -project(':libcocos2dx').projectDir = new File(settingsDir, '../../cocos2d-x/cocos/platform/android/libcocos2dx') +project(':libcocos2dx').projectDir = new File('${COCOS_X_ROOT}/cocos/platform/android/libcocos2dx') include ':HelloJavascript' project(':HelloJavascript').projectDir = new File(settingsDir, 'app')