You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by ha...@apache.org on 2018/11/13 07:09:11 UTC

[incubator-weex] branch rc-0.20.0 updated: [build] Updated the Apache release scripts. (#1741)

This is an automated email from the ASF dual-hosted git repository.

hanks pushed a commit to branch rc-0.20.0
in repository https://gitbox.apache.org/repos/asf/incubator-weex.git


The following commit(s) were added to refs/heads/rc-0.20.0 by this push:
     new 3436364  [build] Updated the Apache release scripts. (#1741)
3436364 is described below

commit 3436364b27a0e490aa2d2d77559dd61d879cfada
Author: Jonathan Dong <jo...@apache.org>
AuthorDate: Tue Nov 13 15:09:05 2018 +0800

    [build] Updated the Apache release scripts. (#1741)
    
    Added 'npm run build:rax' to generate Rax precompiled js files, and
    updated the build command and generated project for iOS.
---
 scripts/build_from_source.sh       | 12 ++++++++----
 scripts/generate_apache_release.sh |  5 +++--
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/scripts/build_from_source.sh b/scripts/build_from_source.sh
index 0757d9e..da38028 100755
--- a/scripts/build_from_source.sh
+++ b/scripts/build_from_source.sh
@@ -18,20 +18,22 @@
 
 set -e
 if [ ! -f scripts/build_from_source.sh ];then
-    echo "This script must execute in project root"
+    echo "This script must be executed from project root."
     exit 1
 fi
 
-echo "Build Weex SDK From Source...."
+echo "Build Weex SDK from source...."
 
 npm install
 npm run build:jsfm
 npm run build:polyfill
+npm run build:rax
 
 echo "Weex JS Framework build completed."
 sleep 2
 
-mkdir pre-build
+# Copy built JS resources to their destination.
+[ -d pre-build ] || mkdir pre-build
 cp dist/weex-js-framework.min.js pre-build/native-bundle-main.js
 cp dist/weex-js-framework.min.js android_sdk/assets/native-bundle-main.js
 cp dist/weex-js-framework.min.js pre-build/weex-main-jsfm.js
@@ -40,10 +42,12 @@ cp dist/weex-polyfill.min.js pre-build/weex-polyfill.js
 cp dist/weex-rax.min.js pre-build/weex-rax-api.js
 cp dist/weex-rax.min.js android_sdk/assets/weex-rax-api.js
 
+# Build android_sdk
 gradle wrapper --gradle-version 4.4
 echo 'include ":android_sdk"'>settings.gradle
 ./gradlew :android_sdk:assemble -PasfRelease
 
-xcodebuild -project ios_sdk/WeexSDK.xcodeproj -target WeexSDK_MTL
+# Build iOS sdk
+xcodebuild -project ios_sdk/WeexSDK.xcodeproj -scheme WeexSDK_MTL
 
 echo "Weex SDK Build completed."
diff --git a/scripts/generate_apache_release.sh b/scripts/generate_apache_release.sh
index 9076513..d339337 100755
--- a/scripts/generate_apache_release.sh
+++ b/scripts/generate_apache_release.sh
@@ -32,9 +32,10 @@ rm -rf $dest/android/sdk/src/test/java/com
 
 mv $dest/ios/sdk $dest/ios_sdk
 mv $dest/android/sdk $dest/android_sdk
-$SED_CMD -i '' 's/\.\.\/\.\.\/weex_core/\.\.\/weex_core/g' $dest/android_sdk/build.gradle
+$SED_CMD -i '' 's/\.\.\/\.\.\/weex_core/\.\.\/weex_core/g' $dest/android_sdk/build.gradle $dest/ios_sdk/WeexSDK.xcodeproj/project.pbxproj
 $SED_CMD -i '' 's/\.\.\/\.\.\/pre-build/\.\.\/pre-build/g' $dest/android_sdk/build.gradle $dest/ios_sdk/WeexSDK.xcodeproj/project.pbxproj
+[ -d "$dest/ios_sdk/build" ] && rm -rf "$dest/ios_sdk/build"
 mv $dest/android/build.gradle $dest/build.gradle
 rm -rf $dest/android $dest/ios
 
-rm -rf $dest/android_sdk/gradle
\ No newline at end of file
+rm -rf $dest/android_sdk/gradle