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

Commit

Permalink
Merge branch 'master' into jsfm-feature-sandbox
Browse files Browse the repository at this point in the history
  • Loading branch information
Hanks10100 committed Dec 29, 2017
2 parents 3d589d4 + 11a1f3e commit 33ff3f0
Show file tree
Hide file tree
Showing 409 changed files with 417 additions and 51,477 deletions.
40 changes: 0 additions & 40 deletions .wwprc

This file was deleted.

31 changes: 15 additions & 16 deletions HOW-TO-BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,49 +2,48 @@
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.

Weex SDK produce 3 different SDKs to use in corresponding system/browser:
Weex SDK includes 3 different SDKs to use in corresponding system/browser:
* Android SDK
* iOS SDK
* Mobile Web SDK
* [Mobile Web SDK](https://github.com/weexteam/weex-vue-render)

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 to your app.

## Build Environment
The environment required to build weex as follow:
* Android SDK:
The environment required to build weex as follow:
* Android SDK:
* NodeJS 4.0+
* JDK 1.6+
* Android SDK(`$ANDROID_HOME` must be set properly)
* Gradle 2.0+
* iOS SDK:
* iOS SDK:
* NodeJS 4.0+
* XCode & Command Tools 8.0+
* XCode & Command Tools 8.0+
* Mobile web SDK:
* NodeJS 4.0+

This article was tested in MacOSX system.

# Build All by Script

This script will build all 3 SDKs:
This script will build Android and iOS SDKs:
> `$ 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.


# Build for Platforms

You can build all SDKs by one script as described above, or just build for a single platform you want step by step.

## Build Javascript Framework and Html5 SDK
Javascript Framework is required by native SDKs. **So this must be built first.**
Install npm dependencies(You must have node&npm installed):
## Build Javascript Framework
Javascript Framework is required by native SDKs. **So this must be built first.**
Install npm dependencies(You must have node&npm installed):
> `$ npm install --production`
Install build tools:
Install build tools:
> `$ npm run install:buildtools`
Build the javascript libraries:
Build the javascript libraries:
> `$ npm run build:source`
### Before build Native SDK
Expand All @@ -60,14 +59,14 @@ execute root folder of project
Create a Gradle setting file
> `$ echo 'include ":android_sdk"'>settings.gradle`
Build the SDK
Build the SDK
> `$ ./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:
Execute command below to compile iOS SDK:
> `$ xcodebuild -project ios_sdk/WeexSDK.xcodeproj -target WeexSDK_MTL`
Then you'll found iOS library(Framework file) under `ios_sdk/Products`.
28 changes: 3 additions & 25 deletions POSSIBLE-NOTICES-FOR-BIN-DIST
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,6 @@ by Tom Preston-Werner , licensed under the Creative Commons - CC BY 3.0 License.
This product contains software core-js(https://github.com/zloirock/core-js) developed
by Denis Pushkarev , licensed under the MIT License.

This product contains software animaitonjs(https://github.com/MrRaindrop/animationjs) developed
by mr.raindrop , licensed under the MIT License.

This product contains software cubicbezier(https://github.com/MrRaindrop/cubicbezier) developed
by mr.raindrop , licensed under the MIT License.

This product contains software envd(https://github.com/MrRaindrop/envd) developed
by mr.raindrop , licensed under the MIT License.

This product contains software httpurl(https://github.com/MrRaindrop/httpurl) developed
by mr.raindrop , licensed under the MIT License.

This product contains software lazyimg(https://github.com/MrRaindrop/lazyimg) developed
by mr.raindrop , licensed under the MIT License.

This product contains software modals(https://github.com/MrRaindrop/modals) developed
by mr.raindrop , licensed under the MIT License.

This product contains software autoprefixer(https://github.com/postcss/autoprefixer) developed
by postcss , licensed under the MIT License.

Expand All @@ -43,19 +25,15 @@ by yuanyan , licensed under the BSD-3-Clause License.
This product contains software weex-vue-framework(https://github.com/vuejs/vue) developed
by fkysly , licensed under the MIT License.

This product contains software weex-vue-render(https://github.com/vuejs/vue) developed
by MrRaindrop , licensed under the Apache 2.0 License.

This product contains software weex-styler(https://github.com/weexteam/weex-styler) developed
by songsiqi , licensed under the MIT License.

This product contains software vuejs(https://github.com/vuejs/vue) developed
by Yuxi Evan You , licensed under the MIT License.

This product contains software scroll-to (https://github.com/component/scroll-to) developed
by TooTallNate , licensed under the MIT License.

This product contains software inline-style-prefixer
(https://github.com/rofrischmann/inline-style-prefixer) developed by
rofrischmann , licensed under the MIT License.

This product contains software fastjson(https://github.com/alibaba/fastjson) developed
by alibaba inc. , licensed under the Apache 2.0 License.

Expand Down
62 changes: 33 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@

A framework for building Mobile cross-platform UI.

Android[![Download](https://api.bintray.com/packages/alibabaweex/maven/weex_sdk/images/download.svg)](https://bintray.com/alibabaweex/maven/weex_sdk/_latestVersion)
iOS[![Pod version](https://badge.fury.io/co/WeexSDK.svg)](https://cocoapods.org/pods/WeexSDK) [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
HTML5[![npm version](https://badge.fury.io/js/weex-html5.svg)](https://www.npmjs.com/package/weex-html5)

[![CircleCI](https://circleci.com/gh/alibaba/weex/tree/dev.svg?style=svg&circle-token=b83b047a3a01f6ec26458a455530a5ddc261925f)](https://circleci.com/gh/alibaba/weex/tree/dev)

| platform | status |
| -------- | ------ |
| Android | [![Download](https://api.bintray.com/packages/alibabaweex/maven/weex_sdk/images/download.svg)](https://bintray.com/alibabaweex/maven/weex_sdk/_latestVersion) |
| iOS | [![Pod version](https://badge.fury.io/co/WeexSDK.svg)](https://cocoapods.org/pods/WeexSDK) [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) |
| [Mobile Web](https://github.com/weexteam/weex-vue-render) | [![npm version](https://badge.fury.io/js/weex-html5.svg)](https://www.npmjs.com/package/weex-vue-render) |

Support Android 4.1 (API 16), iOS 8.0+ and WebKit 534.30+.

## For Windows
Expand Down Expand Up @@ -47,47 +49,49 @@ On Android Platform , Weex code is executed in [weex_v8core](https://github.com/

### iOS
* run playground
* Prerequisites
* Install [Node.js](http://nodejs.org/) 4.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)
* Prerequisites
* Install [Node.js](http://nodejs.org/) 4.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)
* integrate to your application

- **[CocoaPods](https://cocoapods.org)**

Add the following line to your Podfile:
```
pod 'WeexSDK'
```
```
pod 'WeexSDK'
```
run `pod install`

- **[Carthage](https://github.com/carthage/carthage)**

Add the following line to your Cartfile:
```
github "apache/incubator-weex"
```
Run `carthage update`, and you should now have the latest version of `WeexSDK` in your `Carthage` folder.

Add the following line to your Cartfile:
```
github "apache/incubator-weex"
```
Run `carthage update`, and you should now have the latest version of `WeexSDK` in your `Carthage` folder.

### Mobile Web

see [weex-vue-render](https://github.com/weexteam/weex-vue-render).

## Scripts

See [SCRIPTS.md](./SCRIPTS.md) for more information.

## IDE Plugin & Syntax Highlight & DevTool

Weex team have developed a [DevTool](https://github.com/weexteam/weex-devtool) to help you to improve `we file` debug efficiency.
Weex team have developed a [DevTool](https://github.com/weexteam/weex-devtool) to help you to improve the debugging efficiency.

See more stuff on [this wiki page](https://github.com/alibaba/weex/wiki/Weex-Community)

Expand Down
3 changes: 1 addition & 2 deletions SCRIPTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ There are several scripts for end-user and developer.

**For end users you can only know `npm run build` and `npm run serve` to start and `npm run dev:examples` to write or modify a demo.**

* `npm run build:browser`: build HTML5 renderer to `packages/weex-html5/index.js`.
* `npm run build:native`: build JS framework for native renderer to `packages/weex-js-framework/index.js`.
* `npm run build:examples`: build all js bundles from `examples/` to `examples/build/`.
* `npm run build:test`: build all js bundles from `test/` to `test/build/`.
* `npm run build`: build all above.
* `npm run dev:browser`, `npm run dev:native`, `npm run dev:examples`, `npm run dev:test` are the watcher mode for all build scripts, any file changes will automatically be built.
* `npm run dev:native`, `npm run dev:examples`, `npm run dev:test` are the watcher mode for all build scripts, any file changes will automatically be built.
* `npm run serve`: run a http server so you can access all examples in browser through `http://localhost:12580/`. **note: you must run `npm run build` first to prepare all the built files.**
* `npm run clean:examples`: clean `examples/build/`.
* `npm run clean:test`: clean `test/build/`.
Expand Down
Binary file modified android/sdk/libs/armeabi/libweexjsb.so
100755 → 100644
Binary file not shown.
Binary file modified android/sdk/libs/armeabi/libweexjsc.so
100755 → 100644
Binary file not shown.
Binary file modified android/sdk/libs/armeabi/libweexjss.so
100755 → 100644
Binary file not shown.
7 changes: 6 additions & 1 deletion android/sdk/src/main/java/com/taobao/weex/WXSDKInstance.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import com.taobao.weex.adapter.IWXUserTrackAdapter;
import com.taobao.weex.adapter.URIAdapter;
import com.taobao.weex.appfram.websocket.IWebSocketAdapter;
import com.taobao.weex.bridge.EventResult;
import com.taobao.weex.bridge.NativeInvokeHelper;
import com.taobao.weex.bridge.SimpleJSCallback;
import com.taobao.weex.bridge.WXBridgeManager;
Expand Down Expand Up @@ -1463,7 +1464,11 @@ public void fireGlobalEventCallback(String eventName, Map<String,Object> params)
* @param domChanges
*/
public void fireEvent(String elementRef,final String type, final Map<String, Object> data,final Map<String, Object> domChanges, List<Object> eventArgs){
WXBridgeManager.getInstance().fireEventOnNode(getInstanceId(),elementRef,type,data,domChanges, eventArgs);
fireEvent(elementRef, type, data, domChanges, eventArgs, null);
}

public void fireEvent(String elementRef,final String type, final Map<String, Object> data,final Map<String, Object> domChanges, List<Object> eventArgs, EventResult callback) {
WXBridgeManager.getInstance().fireEventOnNode(getInstanceId(),elementRef,type,data,domChanges, eventArgs, callback);
}
/**
* Fire event callback on a element.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* 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
Expand All @@ -16,17 +16,31 @@
* specific language governing permissions and limitations
* under the License.
*/
import packages from './packer'
package com.taobao.weex.bridge;

// install the apis and components as packages.
export default {
init (Weex) {
if (typeof packages !== 'object') {
return
/**
* Created by furture on 2017/10/17.
*/

public class EventResult {

private Object result;
private boolean success = false;
/**
* onCallback javascript event callback method
* @param result
*/
public void onCallback(Object result){
this.success = true;
this.result = result;
}
for (const k in packages) {
Weex.install(packages[k])

public boolean isSuccess() {
return success;
}
// packages.forEach(pkg => Weex.install(pkg))
}

public Object getResult(){
return result;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/
package com.taobao.weex.bridge;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.taobao.weex.WXSDKManager;
Expand Down Expand Up @@ -74,7 +75,11 @@ private Object[] prepareArguments(Type[] paramClazzs, JSONArray args) throws Exc
value = args.get(i);

if (paramClazz == JSONObject.class) {
params[i] = value;
if(value instanceof JSONObject || value == null) {
params[i] = value;
}else if (value instanceof String){
params[i] = JSON.parseObject(value.toString());
}
} else if(JSCallback.class == paramClazz){
if(value instanceof String){
params[i] = new SimpleJSCallback(mInstanceId,(String)value);
Expand Down
Loading

0 comments on commit 33ff3f0

Please sign in to comment.