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

Commit

Permalink
Revert "+ [android] support the box-shadow attribute on android 4.3 o…
Browse files Browse the repository at this point in the history
…r higher"

This reverts commit b0e072a.
  • Loading branch information
misakuo committed Sep 22, 2017
1 parent b0e072a commit 7b2150a
Show file tree
Hide file tree
Showing 83 changed files with 2,980 additions and 1,822 deletions.
47 changes: 44 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ language: node_js
node_js: 7.6
rvm: 2.0.0
env:
- TEST_SUITE=ios
- TEST_SUITE=danger
- TEST_SUITE=jsfm
- TEST_SUITE=android
- TEST_SUITE=release
matrix:
fast_finish: true
exclude:
Expand All @@ -23,7 +25,15 @@ matrix:
env: TEST_SUITE=ios
- os: linux
env: TEST_SUITE=android
- os: osx
env: TEST_SUITE=release
- os: linux
env: TEST_SUITE=release
include:
- os: osx
env: TEST_SUITE=release
osx_image: xcode8.1
language: objective-c
- os: osx
env: TEST_SUITE=ios
osx_image: xcode8.1
Expand Down Expand Up @@ -53,19 +63,50 @@ before_script:
nvm install 7.0
npm install
fi
- |
if [[ $TEST_SUITE = "ios" ]]; then
brew update
fi
- |
if [[ $TEST_SUITE = "release" ]]; then
brew update
#manual install android sdk
brew cask install android-sdk
brew install gradle
export ANDROID_HOME=/usr/local/share/android-sdk
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/tools/bin:$ANDROID_HOME/platform-tools
echo yes | sdkmanager platform-tools
echo yes | sdkmanager tools #tools
echo yes | sdkmanager "build-tools;25.0.3" #build-tool
echo yes | sdkmanager "platforms;android-25" #compile target
echo yes | sdkmanager "extras;android;m2repository" #support
fi
script:
- |
if [[ $TEST_SUITE = "android" ]]; then
npm run danger -- run --dangerfile ./dangerfile-android.js
cd android
./gradlew clean assembleDebug :weex_sdk:testDebugUnitTest --info -PdisableCov=true -Dorg.gradle.daemon=true -Dorg.gradle.parallel=true -Dorg.gradle.jvmargs="-Xmx512m -XX:+HeapDumpOnOutOfMemoryError" -Dfile.encoding=UTF-8 &&
cd $TRAVIS_BUILD_DIR
fi
- |
if [[ $TEST_SUITE = "ios" ]]; then
xcodebuild -project ios/sdk/WeexSDK.xcodeproj test -scheme WeexSDKTests CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO -destination 'platform=iOS Simulator,name=iPhone 6'
fi
- |
if [[ $TEST_SUITE = "jsfm" ]]; then
npm run danger -- run --dangerfile ./dangerfile-jsfm.js
npm run build &&
npm run test
fi
- |
if [[ $TEST_SUITE = "danger" ]]; then
npm run danger -- run --dangerfile ./dangerfile.js
npm run danger
fi
- |
if [[ $TEST_SUITE = "release" ]]; then
bash scripts/generate_apache_release.sh &&
cd apache_release_temp &&
bash scripts/build_from_source.sh &&
cd $TRAVIS_BUILD_DIR
fi
notifications:
webhooks:
Expand Down
5 changes: 1 addition & 4 deletions POSSIBLE-NOTICES-FOR-BIN-DIST
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,4 @@ This product contains software SDWebImage(https://github.com/rs/SDWebImage) deve
by Olivier Poitrey , licensed under the MIT License.

This product contains software Guava(https://github.com/google/guava) developed
by google , licensed under the Apache License.

This product contains shelljs Guava(https://github.com/shelljs/shelljs) developed
by shelljs , licensed under BSD 3-clause "New" or "Revised" License.
by google , licensed under the Apache License.
2 changes: 2 additions & 0 deletions WeexSDK.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ Pod::Spec.new do |s|
s.xcconfig = { "OTHER_LINK_FLAG" => '$(inherited) -ObjC'}

s.frameworks = 'CoreMedia','MediaPlayer','AVFoundation','AVKit','JavaScriptCore', 'GLKit', 'OpenGLES', 'CoreText', 'QuartzCore', 'CoreGraphics'

s.dependency 'SocketRocket'
s.libraries = "stdc++"

end
13 changes: 5 additions & 8 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.android.tools.build:gradle:2.1.3'
}
}

plugins {
id "de.undercouch.download" version "3.2.0"
// id "com.github.dcendents.android-maven" version "1.5"
}

repositories {
Expand All @@ -30,9 +29,7 @@ subprojects {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.0'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
classpath 'com.android.tools.build:gradle:2.1.3'
}
}
ext {
Expand All @@ -46,6 +43,6 @@ subprojects {
}
}

//task clean(type: Delete) {
// delete rootProject.buildDir
//}
task clean(type: Delete) {
delete rootProject.buildDir
}
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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-3.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ public class BenchmarkTest {
private static List<Long> firstScreenRenderTime = new LinkedList<>();
private static List<Long> flingFrameSeconds = new LinkedList<>();
private static List<Long> scrollFrameSeconds = new LinkedList<>();
private static final String DUMP_START = "QueueBufferDuration,\n";
private static final String DUMP_START = "Flags,IntendedVsync,Vsync,OldestInputEvent,NewestInputEvent,"
+ "HandleInputStart,AnimationStart,PerformTraversalsStart,DrawStart,"
+ "SyncQueued,SyncStart,IssueDrawCommandsStart,SwapBuffers,FrameCompleted,\n";
private static final String DUMP_END = "---PROFILEDATA---";
private static final String DUMP_COMMAND = "dumpsys gfxinfo com.alibaba.weex framestats reset";

Expand Down Expand Up @@ -193,7 +195,7 @@ private List<Long> createList(BufferedReader bufferedReader) throws IOException

private long calcTime() {
BenchmarkActivity benchmarkActivity = mActivityRule.getActivity();
benchmarkActivity.loadWeexPage("http://30.8.53.163:8080/complicated.js");
benchmarkActivity.loadWeexPage();
onView(withClassName(Matchers.is(WXRecyclerView.class.getName()))).perform
(RecyclerViewActions.scrollToPosition(0));
return benchmarkActivity.getWXInstance().getWXPerformance().screenRenderTime;
Expand Down
Binary file modified android/sdk/libs/armeabi/libweexjsc.so
Binary file not shown.
Binary file modified android/sdk/libs/armeabi/libweexjss.so
Binary file not shown.
102 changes: 43 additions & 59 deletions android/sdk/src/main/java/com/taobao/weex/WXSDKInstance.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
*/
package com.taobao.weex;

import static com.taobao.weex.http.WXHttpUtil.KEY_USER_AGENT;

import android.app.AlertDialog;
import android.content.Context;
import android.content.Intent;
Expand All @@ -30,14 +28,13 @@
import android.os.Message;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.annotation.RestrictTo;
import android.support.annotation.RestrictTo.Scope;
import android.text.TextUtils;
import android.util.Log;
import android.view.Menu;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ScrollView;

import com.alibaba.fastjson.JSONObject;
import com.taobao.weex.adapter.IDrawableLoader;
import com.taobao.weex.adapter.IWXHttpAdapter;
Expand Down Expand Up @@ -71,7 +68,6 @@
import com.taobao.weex.ui.component.WXBasicComponentType;
import com.taobao.weex.ui.component.WXComponent;
import com.taobao.weex.ui.component.WXComponentFactory;
import com.taobao.weex.ui.flat.FlatGUIContext;
import com.taobao.weex.ui.view.WXScrollView;
import com.taobao.weex.ui.view.WXScrollView.WXScrollViewListener;
import com.taobao.weex.utils.Trace;
Expand All @@ -80,6 +76,8 @@
import com.taobao.weex.utils.WXLogUtils;
import com.taobao.weex.utils.WXReflectionUtils;
import com.taobao.weex.utils.WXViewUtils;
import com.taobao.weex.WXSDKEngine;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
Expand All @@ -88,6 +86,9 @@
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;

import static com.taobao.weex.http.WXHttpUtil.KEY_USER_AGENT;


/**
* Each instance of WXSDKInstance represents an running weex instance.
* It can be a pure weex view, or mixed with native view
Expand Down Expand Up @@ -119,8 +120,6 @@ public class WXSDKInstance implements IWXActivityStateListener,DomContext, View.
private boolean mNeedReLoad = false;
private static volatile int mViewPortWidth = 750;
private int mInstanceViewPortWidth = 750;
private @NonNull
FlatGUIContext mFlatGUIContext =new FlatGUIContext();

public long mRenderStartNanos;
public int mExecJSTraceId = WXTracing.nextId();
Expand Down Expand Up @@ -201,12 +200,6 @@ public void enableLayerType(boolean enable) {
enableLayerType = enable;
}

@RestrictTo(Scope.LIBRARY)
public @NonNull
FlatGUIContext getFlatUIContext(){
return mFlatGUIContext;
}

public boolean isNeedValidate() {
return mNeedValidate;
}
Expand Down Expand Up @@ -258,7 +251,6 @@ public WXSDKInstance(Context context) {
/**
* For unittest only.
*/
@RestrictTo(Scope.TESTS)
WXSDKInstance(Context context,String id) {
mInstanceId = id;
init(context);
Expand Down Expand Up @@ -614,23 +606,21 @@ private String assembleFilePath(Uri uri) {
return "";
}

public void reloadPage(boolean reloadThis) {

public void reloadPage() {
WXSDKEngine.reload();

if (reloadThis) {
// 可以发送广播吗?
if (mContext != null) {
Intent intent = new Intent();
intent.setAction(IWXDebugProxy.ACTION_INSTANCE_RELOAD);
intent.putExtra("url", mBundleUrl);
mContext.sendBroadcast(intent);
}
// mRendered = false;
// destroy();
// renderInternal(mPackage, mTemplate, mOptions, mJsonInitData, mFlag);
// refreshInstance("{}");
// 可以发送广播吗?
if (mContext != null) {
Intent intent = new Intent();
intent.setAction(IWXDebugProxy.ACTION_INSTANCE_RELOAD);
intent.putExtra("url", mBundleUrl);
mContext.sendBroadcast(intent);
}
// mRendered = false;
// destroy();
// renderInternal(mPackage, mTemplate, mOptions, mJsonInitData, mFlag);
// refreshInstance("{}");

}
/**
* Refresh instance asynchronously.
Expand Down Expand Up @@ -1259,41 +1249,35 @@ private void destroyView(View rootView) {
}

public synchronized void destroy() {
if(!isDestroy()) {
WXSDKManager.getInstance().destroyInstance(mInstanceId);
WXComponentFactory.removeComponentTypesByInstanceId(getInstanceId());
WXSDKManager.getInstance().destroyInstance(mInstanceId);
WXComponentFactory.removeComponentTypesByInstanceId(getInstanceId());

if (mGlobalEventReceiver != null) {
getContext().unregisterReceiver(mGlobalEventReceiver);
mGlobalEventReceiver = null;
}
if (mRootComp != null) {
mRootComp.destroy();
destroyView(mRenderContainer);
mRootComp = null;
}
if(mGlobalEventReceiver!=null){
getContext().unregisterReceiver(mGlobalEventReceiver);
mGlobalEventReceiver=null;
}
if(mRootComp != null ) {
mRootComp.destroy();
destroyView(mRenderContainer);
mRenderContainer = null;
mRootComp = null;
}

if (mGlobalEvents != null) {
mGlobalEvents.clear();
}
if(mGlobalEvents!=null){
mGlobalEvents.clear();
}

if (mComponentObserver != null) {
if(mComponentObserver != null){
mComponentObserver = null;
}

getFlatUIContext().destroy();
mFlatGUIContext = null;

mWXScrollListeners = null;
mRenderContainer = null;
mNestedInstanceInterceptor = null;
mUserTrackAdapter = null;
mScrollView = null;
mContext = null;
mRenderListener = null;
isDestroy = true;
mStatisticsListener = null;
}

mNestedInstanceInterceptor = null;
mUserTrackAdapter = null;
mScrollView = null;
mContext = null;
mRenderListener = null;
isDestroy = true;
mStatisticsListener = null;
}

public boolean isDestroy(){
Expand Down Expand Up @@ -1500,7 +1484,7 @@ public void fireModuleEvent(String eventName, WXModule module,Map<String, Object
* Check whether the current module registered the event
* @param eventName EventName register in weex
* @param module Events occur in this Module
* @return boolean true
* @return register->true
*/
public boolean checkModuleEventRegistered(String eventName,WXModule module) {
if (module != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

/**
* Created by moxun on 17/1/3.
* @see <a href="https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent">CloseEvent</a>
* @link {https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent}
*/

public enum WebSocketCloseCodes {
Expand Down
Loading

0 comments on commit 7b2150a

Please sign in to comment.