Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

Commit

Permalink
* [all] changes for release
Browse files Browse the repository at this point in the history
* move android & ios SDK to top level in source release, issue by IPMC
* add a script to generate source release files
* move scripts under bin/ to scripts/
  • Loading branch information
sospartan committed May 24, 2017
1 parent 2211630 commit 7701f17
Show file tree
Hide file tree
Showing 16 changed files with 57 additions and 28 deletions.
1 change: 1 addition & 0 deletions .flowconfig
Expand Up @@ -7,6 +7,7 @@
.*/android/.*
.*/ios/.*
.*/bin/.*
.*/scripts/.*
.*/dist/.*
.*/flow-typed/.*

Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -50,3 +50,6 @@ doc/db.json
doc/node_modules/
doc/public/
doc/.deploy*/

# release
apache_release_temp
25 changes: 15 additions & 10 deletions README_RELEASE.md
Expand Up @@ -2,10 +2,16 @@
Weex produce SDKs to integrate to iOS/Android/Mobile web applications. This file will cover how to build Weex from source. You can either use the script we provided or manually build from source step by step.
See `README.md` for further information about Weex Framework.

## Build Environment
The environment required to build weex as follow:
* NodeJs 4.0+
* Gradle 2.0+
* XCode & Command Tools 8.0+

## Build with Script

Run build script:
> `$ bash script/build_from_source.sh`
> `$ bash scripts/build_from_source.sh`
This's may take a while. After that, you can look into `dist/`, `android/sdk/build/output/` and `ios/sdk/Products` for Web/Android/iOS SDK artifacts.

Expand All @@ -31,29 +37,28 @@ The artifacts are under `dist/`.
### Before build Native SDK
Move `min` version to Native SDK folder, which will be used by native SDK build.
> `cp dist/native.min.js ios/sdk/WeexSDK/Resources/main.js`
> `cp dist/native.min.js android/sdk/assets/main.js`
> `cp dist/native.min.js ios_sdk/WeexSDK/Resources/main.js`
> `cp dist/native.min.js android_sdk/assets/main.js`
### Build Android SDK
Make sure you have install gradle, see more details about 'how to install gradle' in [gradle website](https://gradle.org/install).
Go into the `android` folder then execute
> `$ cd android `
execute root folder of project
> `$ gradle wrapper --gradle-version 2.14.1`
Create a Gradle setting file
> `$ echo 'include ":sdk"'>settings.gradle`
> `$ echo 'include ":android_sdk"'>settings.gradle`
Build the SDK
> `$ ./gradlew :sdk:assemble -PasfRelease`
> `$ ./gradlew :android_sdk:assemble -PasfRelease`
Now, you can see the artifacts under `android/sdk/build/output/`.
Now, you can see the artifacts under `android_sdk/build/output/`.
You can now import the aar file to your android project.

### Build iOS SDK
Execute command below to compile iOS SDK:
> `$ xcodebuild -project ios/sdk/WeexSDK.xcodeproj -target WeexSDK_MTL`
> `$ xcodebuild -project ios_sdk/WeexSDK.xcodeproj -target WeexSDK_MTL`
Then you'll found iOS library(Framework file) under `ios/sdk/Products`.
Then you'll found iOS library(Framework file) under `ios_sdk/Products`.

## Run Apache-Rat

Expand Down
6 changes: 3 additions & 3 deletions package.json
Expand Up @@ -37,7 +37,7 @@
"node": ">=4"
},
"scripts": {
"postinstall": "bash ./bin/install-hooks.sh",
"postinstall": "bash ./scripts/install-hooks.sh",
"build:native": "node build/build.js native",
"build:runtime": "node build/build.js runtime",
"install:buildtools": "npm i rollup rollup-watch rollup-plugin-buble rollup-plugin-json rollup-plugin-eslint rollup-plugin-commonjs rollup-plugin-flow rollup-plugin-flow-no-whitespace rollup-plugin-postcss rollup-plugin-replace rollup-plugin-uglify rollup-plugin-node-resolve wwp flow-bin babel-core babel-eslint babel-istanbul babel-loader babel-plugin-coverage babel-preset-es2015 babel-runtime eslint-plugin-flowtype",
Expand All @@ -53,8 +53,8 @@
"build:ci:native": "webpack --watch --config build/webpack.ci.config.js",
"build:ci": "npm run build:ci:native && npm run build:ci:web",
"build": "npm run build:native && npm run build:browser && npm run build:vue && npm run build:examples && npm run build:test",
"dist:vue": "npm run build:vue && bash ./bin/dist-vue.sh",
"dist:browser": "npm run build:browser && npm run build:browser:common && bash ./bin/dist-browser.sh",
"dist:vue": "npm run build:vue && bash ./scripts/dist-vue.sh",
"dist:browser": "npm run build:browser && npm run build:browser:common && bash ./scripts/dist-browser.sh",
"dist": "npm run dist:browser && npm run dist:vue",
"dev:native": "node build/build.js native --watch",
"dev:runtime": "node build/build.js runtime --watch",
Expand Down
14 changes: 6 additions & 8 deletions scripts/build_from_source.sh
Expand Up @@ -21,7 +21,7 @@ if [ ! -f scripts/build_from_source.sh ];then
echo "This script must execute in project root"
exit 1
fi
PROJECT_DIR=$(pwd)

echo "Build Weex SDK From Source...."

npm install --production
Expand All @@ -31,15 +31,13 @@ npm run build:source
echo "Javascript Framework and HTML5 SDK build completed."
sleep 2

cp dist/native.min.js ios/sdk/WeexSDK/Resources/main.js
cp dist/native.min.js android/sdk/assets/main.js
cp dist/native.min.js ios_sdk/WeexSDK/Resources/main.js
cp dist/native.min.js android_sdk/assets/main.js

cd android
gradle wrapper --gradle-version 2.14.1
echo 'include ":sdk"'>settings.gradle
./gradlew :sdk:assemble -PasfRelease
cd $PROJECT_DIR
echo 'include ":android_sdk"'>settings.gradle
./gradlew :android_sdk:assemble -PasfRelease

xcodebuild -project ios/sdk/WeexSDK.xcodeproj -target WeexSDK_MTL
xcodebuild -project ios_sdk/WeexSDK.xcodeproj -target WeexSDK_MTL

echo "Weex SDK Build completed."
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
19 changes: 19 additions & 0 deletions scripts/generate_apache_release.sh
@@ -0,0 +1,19 @@
#!/bin/bash -eu
if [ ! -f scripts/build_from_source.sh ];then
echo "This script must execute in project root"
exit 1
fi

dest='apache_release_temp'

rm -rf $dest
mkdir $dest
rsync -rvv --include-from=scripts/release_files.rules ./ $dest

mv $dest/ios/sdk $dest/ios_sdk
rm -rf $dest/ios

mv $dest/android/sdk $dest/android_sdk
mv $dest/android/build.gradle $dest/build.gradle
rm -rf $dest/android

6 changes: 3 additions & 3 deletions bin/install-hooks.sh → scripts/install-hooks.sh
Expand Up @@ -17,7 +17,7 @@
# under the License.

if test -e .git/hooks; then
ln -sf ../../bin/pre-commit.sh .git/hooks/pre-commit && chmod +x .git/hooks/pre-commit
ln -sf ../../bin/commit-msg.sh .git/hooks/commit-msg && chmod +x .git/hooks/commit-msg
ln -sf ../../bin/pre-push.sh .git/hooks/pre-push && chmod +x .git/hooks/pre-push
ln -sf ../../scripts/pre-commit.sh .git/hooks/pre-commit && chmod +x .git/hooks/pre-commit
ln -sf ../../scripts/commit-msg.sh .git/hooks/commit-msg && chmod +x .git/hooks/commit-msg
ln -sf ../../scripts/pre-push.sh .git/hooks/pre-push && chmod +x .git/hooks/pre-push
fi
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 5 additions & 2 deletions scripts/release_files.rules
Expand Up @@ -10,6 +10,11 @@
+ /scripts/
+ /scripts/rat-ant-build.xml
+ /scripts/build_from_source.sh
+ /scripts/dist-*.sh
+ /scripts/install-hooks.sh
+ /scripts/pre-commit.sh
+ /scripts/pre-push.sh
+ /scripts/commit-msg.sh
+ /LICENSE
+ /NOTICE
+ /POSSIBLE-NOTICES-FOR-BIN-DIST
Expand All @@ -22,8 +27,6 @@
+ /.eslintrc
+ /.eslintignore
+ /.babelrc
+ /bin
+ /bin/*.sh
+ /src
- /src/h5-render/dist/index.js
- /src/h5-render/node_modules
Expand Down
4 changes: 2 additions & 2 deletions bin/welcome.sh → scripts/welcome.sh
Expand Up @@ -16,8 +16,8 @@
# specific language governing permissions and limitations
# under the License.

if ! test -e ./bin/.welcome; then
touch ./bin/.welcome
if ! test -e ./scripts/.welcome; then
touch ./scripts/.welcome
echo '********************************************************************************'
echo '* *'
echo '* Thanks for contributing Weex! *'
Expand Down

0 comments on commit 7701f17

Please sign in to comment.