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

Commit

Permalink
Update scripts for apache release.
Browse files Browse the repository at this point in the history
  • Loading branch information
YorkShen committed Oct 10, 2019
1 parent 542b319 commit 01adab8
Show file tree
Hide file tree
Showing 14 changed files with 121 additions and 210 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ android/sdk/.externalNativeBuild/ndkBuild/
android/HeronAndroid/.externalNativeBuild/

# release
apache-weex-incubating-*
apache_release_temp
RELEASE_NOTE.md
RELEASE_AUDIT.LOG
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
### Android
* Upgrade targetsdk & compilesdk to 28
* Change Android package name from `com.taobao.weex` to `org.apache.weex`. Ref [link](https://github.com/apache/incubator-weex/tree/master/android) for detail.
* Switch to BSD-Licensed [android-jsc](https://www.npmjs.com/package/jsc-android) as the default JavaScript Interpreter.

## Main Bugfix
79 changes: 34 additions & 45 deletions HOW-TO-BUILD.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Weex Apache Source Release
Weex produce SDKs to integrate with 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.
Weex produce SDKs to integrate with iOS/Android/Mobile web applications. This file will cover how to build Weex from command line. You can either use the script we provided or manually build from source step by step.
See `README.md` for further information about the Weex Framework.

Weex SDK includes 3 different SDKs to use in corresponding system/browser:
Expand All @@ -9,32 +9,36 @@ Weex SDK includes 3 different SDKs to use in corresponding system/browser:

See our [guide in our website](http://weex.apache.org/guide/integrate-to-your-app.html) to learn more about how to integrate Weex SDK into your app.

## Build Environment
The environment required to build weex is:
* Android SDK:
* NodeJS 4.0+
* JDK 1.6+
* Android SDK(`$ANDROID_HOME` must be set properly)
* Gradle 2.0+
* NDK r18 and ndk 13 (**Both of them are needed**)
* [Ninja 1.8.2+](https://ninja-build.org/)
* CMake 3.9.0+
* iOS SDK:
* NodeJS 4.0+
* XCode & Command Tools 8.0+
* Mobile web SDK:
* NodeJS 4.0+
# Build Environment
The environment required to build weex is categorized by platforms.

## Android
* JDK `1.8+`
* Android SDK Platform 28
* `$ANDROID_HOME` must be configured by using `export ANDROID_HOME=/path_to_ndk`
* Normally, you should install [Android Studio](https://developer.android.com/studio) to get Android SDK Platform 28 installed.
* Gradle 4.10+
* NDK `r18`
* `ANDROID_NDK_HOME` must be configured by using `export ANDROID_NDK_HOME=/path_to_ndk`
* Higher version of NDK than `r18` isn't not tested yet.
* CMake 3.4.1+

## iOS
* Install [iOS Environment](https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/AppStoreDistributionTutorial/Setup/Setup.html)
* Install [CocoaPods](https://guides.cocoapods.org/using/getting-started.html)
* XCode Command Tools 8.0+

## Mobile
* NodeJS 4.0+

This article was tested in MacOSX system.

# Build All by Script

This script will build Android and iOS SDKs:
> `$ bash scripts/build_from_source.sh $NDK13_dir $NDK_16dir`
> `$ bash scripts/build_from_source.sh `
The `$NDK18_dir` should be the directory of NDK 18, otherwise the Android build would failed.

This may take a while. After that, you can look in `dist/`, `android/sdk/build/output/` and `ios/sdk/Products` for Web/Android/iOS SDK artifacts.
This may take a while. After that, you can look in `dist/`, `android/sdk/build/outputs/aar` and `ios/sdk/Products` for Web / Android / iOS SDK artifacts.

# Build for Platforms

Expand All @@ -53,37 +57,22 @@ Build the javascript libraries:
### Before build Native SDK
Move `min` version to Native SDK folder, which will be used by native SDK build.
> `cp packages/weex-js-framework/index.min.js ios_sdk/WeexSDK/Resources/main.js`
> `cp packages/weex-js-framework/index.min.js android_sdk/assets/main.js`
> `cp packages/weex-js-framework/index.min.js ios/sdk/WeexSDK/Resources/main.js`
> `cp packages/weex-js-framework/index.min.js android/sdk/assets/main.js`
## Build Android SDK
1. Install the [Android environment](#android).
2. Execute the following command

check env

- you have gradle installed, see more details about 'how to install gradle' on the [gradle website](https://gradle.org/install).
- [NDK r18](https://developer.android.com/ndk/downloads/older_releases.html)
- edit local.propteries (in `Android` dir)

```
ndk.dir=/Users/{user}/Library/Android/sdk/ndk-bundle-r18
sdk.dir=/Users/{user}/Library/Android/sdk
```

then do buid

> cd Android/sdk
> ../gradlew clean assemble

artifacts path:

` android/sdk/build/outputs/aar`
```
cd android
./gradlew :weex_sdk:clean :weex_sdk:assembleRelease
```

You can now import the aar file to your android project.
3. Output can be found at `android/sdk/build/outputs/aar`

## 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 find the iOS library(Framework file) under `ios_sdk/Products`.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ This product bundles vuejs v1.0.12, which is available under a


This product bundles Guava v20.0, which is available under a "Apache" license. For details, see https://github.com/google/guava/blob/v20.0/COPYING and following files:
android_sdk/src/main/java/org/apache/taobao/weex/utils/WXDataStructureUtil.java
android/sdk/src/main/java/org/apache/weex/utils/WXDataStructureUtil.java

This product bundles json11 v1.0.0, which is available under a "MIT" license. For details, see https://github.com/dropbox/json11/tree/v1.0.0 and following files:
weex_core/Source/third_party/json11/CMakeLists.txt
Expand Down
51 changes: 21 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,41 +32,29 @@ Please ***INSTALL [Git for Windows](https://git-scm.com/download/win)*** and run
* [Documents](http://weex.apache.org/references)

### Android
**You should install [android environment](./HOW-TO-BUILD.md#android) before building.**

* Prerequisites
* Install [Node.js](http://nodejs.org/) 8.0+
* Under project root
* `npm install`, install project
* `./start`
* Install [Android Environment](http://developer.android.com/training/basics/firstapp/index.html)
* Install [NDK](https://developer.android.com/ndk/) r18
* Install [Cmake](https://cmake.org/download/) 3.9.0+
* Run playground, In Android Studio
* Open `android/playground`
* In `app/java/com.alibaba.weex/IndexActivity`, modify `CURRENT_IP` to your local IP
* Click <img src="http://gtms04.alicdn.com/tps/i4/TB1wCcqMpXXXXakXpXX3G7tGXXX-34-44.png" height="16" > (`Run` button)
* [Add an example](./examples/README.md#add-an-example)
You can either build Weex from IDE (*Android Studio*) or command line.

#### Runtime
#### Build From Android Studio
1. Open `android` directory in Android Studio.
2. Run `git submodule update --init --remote` in `android` directory if this is the first time you try to run Weex.

On Android Platform , Weex code is executed in [weex_js_engine](https://github.com/alibaba/weex_js_engine/tree/bridge_branch_mergeTimer) which is based on JavaScriptCore engine.
#### Build From Command Line
Please read [How To Build](./HOW-TO-BUILD.md) for detail.

### iOS
* run playground
* Prerequisites
* Install [Node.js](http://nodejs.org/) 8.0+
* Under project root
* `npm install`, install project
* `./start`
* Install [iOS Environment](https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/AppStoreDistributionTutorial/Setup/Setup.html)
* Install [CocoaPods](https://guides.cocoapods.org/using/getting-started.html)
* Run playground
* `cd ios/playground`
* `pod install`
* Open `WeexDemo.xcworkspace` in Xcode
* Click <img src="http://img1.tbcdn.cn/L1/461/1/5470b677a2f2eaaecf412cc55eeae062dbc275f9" height="16" > (`Run` button) or use default shortcut `cmd + r` in Xcode
* If you want to run the demo on your device, don't need to modify `CURRENT_IP` manually. ~~In `DemoDefine.h`(you can search this file by Xcode default shortcut `cmd + shift + o`), modify `CURRENT_IP` to your local IP~~
* [Add an example](./examples/README.md#add-an-example)
**You should install [iOS environment](./HOW-TO-BUILD.md#ios) before building.**

You can either build Weex from IDE (*XCode*) or command line.

#### Build From XCode
* Run playground
* `cd ios/playground`
* `pod install`
* Open `WeexDemo.xcworkspace` in Xcode
* Click <img src="http://img1.tbcdn.cn/L1/461/1/5470b677a2f2eaaecf412cc55eeae062dbc275f9" height="16" > (`Run` button) or use default shortcut `cmd + r` in Xcode
* If you want to run the demo on your device, don't need to modify `CURRENT_IP` manually. ~~In `DemoDefine.h`(you can search this file by Xcode default shortcut `cmd + shift + o`), modify `CURRENT_IP` to your local IP~~
* integrate to your application

- **[CocoaPods](https://cocoapods.org)**
Expand All @@ -85,6 +73,9 @@ On Android Platform , Weex code is executed in [weex_js_engine](https://github.c
```
Run `carthage update`, and you should now have the latest version of `WeexSDK` in your `Carthage` folder.

#### Build From Command Line
Please read [How To Build](./HOW-TO-BUILD.md) for detail.

### Mobile Web

see [weex-vue-render](https://github.com/weexteam/weex-vue-render).
Expand Down
2 changes: 1 addition & 1 deletion android/sdk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ license {
header = file('../license/LICENSE')
mapping('cpp', 'JAVADOC_STYLE')
mapping('h', 'JAVADOC_STYLE')
excludes(['com/taobao/weex/utils/WXDataStructureUtil.java'])
excludes(['org/apache/weex/utils/WXDataStructureUtil.java'])
}

task weex_core_license(type: com.hierynomus.gradle.license.tasks.LicenseFormat) {
Expand Down
6 changes: 3 additions & 3 deletions android/sdk/buildSrc/unstripped.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,17 @@ def processNativeLibs = { unstripped, stripped ->
}

afterEvaluate { project ->
transformNativeLibsWithStripDebugSymbolForRelease << {
transformNativeLibsWithStripDebugSymbolForRelease.doLast {
processNativeLibs transformNativeLibsWithMergeJniLibsForRelease,
transformNativeLibsWithStripDebugSymbolForRelease
}

transformNativeLibsWithStripDebugSymbolForApacheRelease << {
transformNativeLibsWithStripDebugSymbolForApacheRelease.doLast {
processNativeLibs transformNativeLibsWithMergeJniLibsForApacheRelease,
transformNativeLibsWithStripDebugSymbolForApacheRelease
}

transformNativeLibsWithStripDebugSymbolForLegacyRelease << {
transformNativeLibsWithStripDebugSymbolForLegacyRelease.doLast {
processNativeLibs transformNativeLibsWithMergeJniLibsForLegacyRelease,
transformNativeLibsWithStripDebugSymbolForLegacyRelease
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
/*
* Copyright (C) 2007 The Guava Authors
*
* http://www.apache.org/licenses/LICENSE-2.0
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.weex.utils;

Expand Down
1 change: 1 addition & 0 deletions dangerfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ const ignoreCopyrightVerifyPath = [
'test/js\-framework/case',
'android/playground/app/src/main/assets',
'android/sdk/assets',
'android/sdk/src/main/java/org/apache/weex/utils/WXDataStructureUtil.java',
'ios/playground/bundlejs',
'ios/sdk/WeexSDK/Resources',
'ios/sdk/WeexSDK/Sources/Layout',
Expand Down
13 changes: 7 additions & 6 deletions ios/sdk/WeexSDK.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2997,8 +2997,7 @@
};
77D160FC1C02DBE70010B15B = {
CreatedOnToolsVersion = 7.1.1;
DevelopmentTeam = 5783442933;
ProvisioningStyle = Automatic;
ProvisioningStyle = Manual;
};
DCA445241EFA555400D0CFA8 = {
CreatedOnToolsVersion = 8.3.3;
Expand Down Expand Up @@ -3743,10 +3742,10 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = NO;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
CODE_SIGN_STYLE = Automatic;
CODE_SIGN_STYLE = Manual;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 5783442933;
DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
Expand Down Expand Up @@ -3785,6 +3784,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.taobao.WeexSDK;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]" = "";
SKIP_INSTALL = YES;
VALID_ARCHS = "arm64 armv7 x86_64 i386";
WARNING_CFLAGS = "";
Expand All @@ -3802,9 +3802,9 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = NO;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
CODE_SIGN_STYLE = Automatic;
CODE_SIGN_STYLE = Manual;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 5783442933;
DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
Expand Down Expand Up @@ -3843,6 +3843,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.taobao.WeexSDK;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]" = "";
SKIP_INSTALL = YES;
VALID_ARCHS = "arm64 armv7 x86_64 i386";
WARNING_CFLAGS = "";
Expand Down
38 changes: 18 additions & 20 deletions ios/sdk/WeexSDK/Sources/Utility/WXVersion.m
Original file line number Diff line number Diff line change
@@ -1,29 +1,27 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

#import "WXVersion.h"
#import "WXDefine.h"


static const char* WeexSDKBuildTime = "2019-08-26 08:28:24 UTC";
static const unsigned long WeexSDKBuildTimestamp = 1566808104;

static const char* WeexSDKBuildTime = "2019-10-09 13:07:35 UTC";
static const unsigned long WeexSDKBuildTimestamp = 1570626455;

NSString* GetWeexSDKVersion(void)
{
Expand Down
Loading

0 comments on commit 01adab8

Please sign in to comment.