You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by GitBox <gi...@apache.org> on 2018/12/10 09:46:39 UTC
[GitHub] wqyfavor closed pull request #1880: Merge rc20
wqyfavor closed pull request #1880: Merge rc20
URL: https://github.com/apache/incubator-weex/pull/1880
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/LICENSE b/LICENSE
index 906f7b570a..931913ffd3 100644
--- a/LICENSE
+++ b/LICENSE
@@ -256,7 +256,8 @@ This product bundles chromium v66.0.3344.2, which is available under a "BSD-styl
weex_core/Source/android/jniprebuild/jniheader/NativeRenderObjectUtils_jni.h
weex_core/Source/android/jniprebuild/jniheader/SystemMessageHandler_jni.h
weex_core/Source/android/jniprebuild/jniheader/WXBridge_jni.h
- weex_core/Source/android/jniprebuild/jniheader/WXJsFunctions_jni.h
+ weex_core/Source/android/jniprebuild/jniheader/WXDebugJsBridge_jni.h
+ weex_core/Source/android/jniprebuild/jniheader/WXParams_jni.h
weex_core/Source/android/jniprebuild/jni_generator.py
This product bundles Android Open Source Project vandroid-4.2.2_r1, which is available under a "BSD" license. For details, see https://android.googlesource.com/platform/bionic/+/android-4.2.2_r1/libc/README and following files:
diff --git a/android/playground/app/build.gradle b/android/playground/app/build.gradle
index 54cb648a5d..2013b36297 100755
--- a/android/playground/app/build.gradle
+++ b/android/playground/app/build.gradle
@@ -13,7 +13,7 @@ android {
minSdkVersion project.minSdkVersion
targetSdkVersion project.targetSdkVersion
versionCode 20
- versionName "0.19.1"
+ versionName "0.20.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
ndk{
diff --git a/android/sdk/build.gradle b/android/sdk/build.gradle
index c696b11d7c..1b1135eb85 100755
--- a/android/sdk/build.gradle
+++ b/android/sdk/build.gradle
@@ -1,3 +1,22 @@
+/*
+ * 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.
+ */
+
buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
@@ -36,7 +55,7 @@ checkstyle {
}
-version = "0.19.0.4"
+version = "0.20.0"
android {
diff --git a/android/sdk/gradle.properties b/android/sdk/gradle.properties
index 08b9d65cdf..c621f8c509 100755
--- a/android/sdk/gradle.properties
+++ b/android/sdk/gradle.properties
@@ -1,3 +1,22 @@
+#
+# 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.
+
+
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
diff --git a/android/sdk/proguard-rules.pro b/android/sdk/proguard-rules.pro
index 73247bc730..957227f8c9 100755
--- a/android/sdk/proguard-rules.pro
+++ b/android/sdk/proguard-rules.pro
@@ -1,3 +1,22 @@
+#
+# 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.
+
+
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /Users/ouy/Library/AndroidStudio/sdk/tools/proguard/proguard-android.txt
@@ -19,4 +38,4 @@
-keep class com.taobao.weex.layout.** { *; }
-keep class com.taobao.weex.WXSDKEngine { *; }
-keep class com.taobao.weex.base.SystemMessageHandler { *; }
--dontwarn com.taobao.weex.bridge.**
\ No newline at end of file
+-dontwarn com.taobao.weex.bridge.**
diff --git a/android/sdk/publish.sh b/android/sdk/publish.sh
index 4d70a7ce00..7700dd320b 100755
--- a/android/sdk/publish.sh
+++ b/android/sdk/publish.sh
@@ -1,2 +1,21 @@
#!/usr/bin/env bash
-./gradlew clean assemble publish
\ No newline at end of file
+
+#
+# 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.
+
+./gradlew clean assemble publish
diff --git a/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.h b/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.h
index e2440c7266..4b883f0405 100644
--- a/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.h
+++ b/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.h
@@ -26,6 +26,14 @@
#ifdef __cplusplus
#include "layout.h"
+typedef WeexCore::WXCoreFlexDirection WXCoreFlexDirection;
+typedef WeexCore::WXCoreFlexWrap WXCoreFlexWrap;
+typedef WeexCore::WXCoreJustifyContent WXCoreJustifyContent;
+typedef WeexCore::WXCoreAlignItems WXCoreAlignItems;
+typedef WeexCore::WXCoreAlignSelf WXCoreAlignSelf;
+typedef WeexCore::WXCorePositionType WXCorePositionType;
+typedef WeexCore::WXCoreDirection WXCoreDirection;
+
extern "C" {
#endif
bool flexIsUndefined(float value);
@@ -33,6 +41,20 @@ extern "C" {
}
#endif
+#ifndef __cplusplus
+// Ensure that .m files can use css style enum definitions.
+#include "flex_enum.h"
+
+typedef enum WXCoreFlexDirection WXCoreFlexDirection;
+typedef enum WXCoreFlexWrap WXCoreFlexWrap;
+typedef enum WXCoreJustifyContent WXCoreJustifyContent;
+typedef enum WXCoreAlignItems WXCoreAlignItems;
+typedef enum WXCoreAlignSelf WXCoreAlignSelf;
+typedef enum WXCorePositionType WXCorePositionType;
+typedef enum WXCoreDirection WXCoreDirection;
+
+#endif
+
@interface WXComponent ()
{
@package
@@ -53,9 +75,64 @@ extern "C" {
* @warning Subclasses must not override this.
*/
#ifdef __cplusplus
-@property(nonatomic, readonly, assign) WeexCore::WXCoreLayoutNode *flexCssNode;
+@property (nonatomic, readonly, assign) WeexCore::WXCoreLayoutNode *flexCssNode;
#endif
+/**
+ * @abstract Get css style value for key. The key should be of CSS standard form.
+ * This method is for convenience use in C/ObjC environment. And if you want to
+ * retrieve all style values or in C++, you could use flexCssNode directly.
+ *
+ * Thread usage:
+ * This method should be invoked in component thread by WXPerformBlockOnComponentThread.
+ * Note that all initWithRef methods of WXComponent and its subclasses are performed in
+ * component thread by default. Therefore you can call this method directly in initWithRef.
+ *
+ * Supported keys:
+ * width, height, min-width, min-height, max-width, max-height,
+ * margin-(left/right/top/bottom)
+ * padding-(left/right/top/bottom)
+ * border-(left/right/top/bottom)-width
+ * left, right, top, bottom
+ * flex-grow
+ */
+- (float)getCssStyleValueForKey:(NSString *)key;
+
+/**
+ * @abstract Get css style flex-direction. Thread usage the same as getCssStyleValueForKey.
+ */
+- (WXCoreFlexDirection)getCssStyleFlexDirection;
+
+/**
+ * @abstract Get css style flex-wrap. Thread usage the same as getCssStyleValueForKey.
+ */
+- (WXCoreFlexWrap)getCssStyleFlexWrap;
+
+/**
+ * @abstract Get css style justify-content. Thread usage the same as getCssStyleValueForKey.
+ */
+- (WXCoreJustifyContent)getCssStyleJustifyContent;
+
+/**
+ * @abstract Get css style align-items. Thread usage the same as getCssStyleValueForKey.
+ */
+- (WXCoreAlignItems)getCssStyleAlignItems;
+
+/**
+ * @abstract Get css style align-self. Thread usage the same as getCssStyleValueForKey.
+ */
+- (WXCoreAlignSelf)getCssStyleAlignSelf;
+
+/**
+ * @abstract Get css style position. Thread usage the same as getCssStyleValueForKey.
+ */
+- (WXCorePositionType)getCssStylePositionType;
+
+/**
+ * @abstract Get css layout direction. Thread usage the same as getCssStyleValueForKey.
+ */
+- (WXCoreDirection)getCssDirection;
+
/**
* @abstract Convert layout dimension value like 'left', 'width' to style value in js considering viewport and scale.
*/
diff --git a/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.mm b/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.mm
index eaf778ce66..ef877caf9f 100644
--- a/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.mm
+++ b/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.mm
@@ -404,6 +404,92 @@ - (CGFloat)judgePropValuePropValue:(id)propValue defaultValue:(CGFloat)defaultVa
return defaultValue;
}
+- (float)getCssStyleValueForKey:(NSString *)key
+{
+ /*
+ * width, height, min-width, min-height, max-width, max-height,
+ * margin-(left/right/top/bottom)
+ * padding-(left/right/top/bottom)
+ * border-(left/right/top/bottom)-width
+ * left, right, top, bottom
+ * flex-grow
+ */
+ WXAssert(_flexCssNode != nullptr, @"Css node is null.");
+ if (_flexCssNode == nullptr) {
+ return NAN;
+ }
+
+ std::string ckey = [key UTF8String];
+ if (ckey == "width") return _flexCssNode->getStyleWidth();
+ if (ckey == "height") return _flexCssNode->getStyleHeight();
+ if (ckey == "min-width") return _flexCssNode->getMinWidth();
+ if (ckey == "min-height") return _flexCssNode->getMinHeight();
+ if (ckey == "max-width") return _flexCssNode->getMaxWidth();
+ if (ckey == "max-height") return _flexCssNode->getMaxHeight();
+ if (ckey == "margin-left") return _flexCssNode->getMarginLeft();
+ if (ckey == "margin-right") return _flexCssNode->getMarginRight();
+ if (ckey == "margin-top") return _flexCssNode->getMarginTop();
+ if (ckey == "margin-bottom") return _flexCssNode->getMarginBottom();
+ if (ckey == "padding-left") return _flexCssNode->getPaddingLeft();
+ if (ckey == "padding-right") return _flexCssNode->getPaddingRight();
+ if (ckey == "padding-top") return _flexCssNode->getPaddingTop();
+ if (ckey == "padding-bottom") return _flexCssNode->getPaddingBottom();
+ if (ckey == "border-left-width") return _flexCssNode->getBorderWidthLeft();
+ if (ckey == "border-right-width") return _flexCssNode->getBorderWidthRight();
+ if (ckey == "border-top-width") return _flexCssNode->getBorderWidthTop();
+ if (ckey == "border-bottom-width") return _flexCssNode->getBorderWidthBottom();
+ if (ckey == "left") return _flexCssNode->getStylePositionLeft();
+ if (ckey == "right") return _flexCssNode->getStylePositionRight();
+ if (ckey == "top") return _flexCssNode->getStylePositionTop();
+ if (ckey == "bottom") return _flexCssNode->getStylePositionBottom();
+ if (ckey == "flex-grow") return _flexCssNode->getFlex();
+
+ WXAssert(NO, @"Invalid css style key %@", key);
+ return NAN;
+}
+
+- (WXCoreFlexDirection)getCssStyleFlexDirection
+{
+ WXAssert(_flexCssNode != nullptr, @"Css node is null.");
+ return _flexCssNode ? _flexCssNode->getFlexDirection() : kFlexDirectionColumn;
+}
+
+- (WXCoreFlexWrap)getCssStyleFlexWrap
+{
+ WXAssert(_flexCssNode != nullptr, @"Css node is null.");
+ return _flexCssNode ? _flexCssNode->getFlexWrap() : kNoWrap;
+}
+
+- (WXCoreJustifyContent)getCssStyleJustifyContent
+{
+ WXAssert(_flexCssNode != nullptr, @"Css node is null.");
+ return _flexCssNode ? _flexCssNode->getJustifyContent() : kJustifyFlexStart;
+}
+
+- (WXCoreAlignItems)getCssStyleAlignItems
+{
+ WXAssert(_flexCssNode != nullptr, @"Css node is null.");
+ return _flexCssNode ? _flexCssNode->getAlignItems() : kAlignItemsStretch;
+}
+
+- (WXCoreAlignSelf)getCssStyleAlignSelf
+{
+ WXAssert(_flexCssNode != nullptr, @"Css node is null.");
+ return _flexCssNode ? _flexCssNode->getAlignSelf() : kAlignSelfAuto;
+}
+
+- (WXCorePositionType)getCssStylePositionType
+{
+ WXAssert(_flexCssNode != nullptr, @"Css node is null.");
+ return _flexCssNode ? _flexCssNode->getStylePositionType() : kRelative;
+}
+
+- (WXCoreDirection)getCssDirection
+{
+ WXAssert(_flexCssNode != nullptr, @"Css node is null.");
+ return _flexCssNode ? _flexCssNode->getDirection() : WEEXCORE_CSS_DEFAULT_DIRECTION;
+}
+
- (NSString*)convertLayoutValueToStyleValue:(NSString*)valueName
{
if (_flexCssNode == nullptr) {
diff --git a/ios/sdk/WeexSDK/Sources/Utility/WXDefine.h b/ios/sdk/WeexSDK/Sources/Utility/WXDefine.h
index d58bb8318d..4dd1ab9ab6 100644
--- a/ios/sdk/WeexSDK/Sources/Utility/WXDefine.h
+++ b/ios/sdk/WeexSDK/Sources/Utility/WXDefine.h
@@ -6,9 +6,9 @@
* 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
@@ -20,7 +20,7 @@
#ifndef __WX_DEFINE_H__
#define __WX_DEFINE_H__
-#define WX_SDK_VERSION @"0.19.0"
+#define WX_SDK_VERSION @"0.20.0"
#if defined(__cplusplus)
#define WX_EXTERN extern "C" __attribute__((visibility("default")))
@@ -125,8 +125,8 @@ parts = [parts subarrayWithRange:(NSRange){0, parts.count - 1}];\
#endif
/**
- * @abstract Compared with system version of current device
- *
+ * @abstract Compared with system version of current device
+ *
* @return YES if greater than or equal to the system verison, otherwise, NO.
*
*/
diff --git a/ios/sdk/WeexSDK/Sources/Utility/WXVersion.m b/ios/sdk/WeexSDK/Sources/Utility/WXVersion.m
index c034b1b9ab..c2a5ce8fbd 100644
--- a/ios/sdk/WeexSDK/Sources/Utility/WXVersion.m
+++ b/ios/sdk/WeexSDK/Sources/Utility/WXVersion.m
@@ -20,8 +20,8 @@
#import "WXVersion.h"
#import "WXDefine.h"
-static const char* WeexSDKBuildTime = "2018-11-06 06:35:19 UTC";
-static const unsigned long WeexSDKBuildTimestamp = 1541486119;
+static const char* WeexSDKBuildTime = "2018-12-10 09:36:44 UTC";
+static const unsigned long WeexSDKBuildTimestamp = 1544434604;
NSString* GetWeexSDKVersion(void)
{
diff --git a/scripts/build_from_source.sh b/scripts/build_from_source.sh
index 0757d9e4ba..da380282c2 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 9076513daf..d339337f20 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
diff --git a/weex_core/CMakeLists.txt b/weex_core/CMakeLists.txt
index 2894e59436..b0dfca0dcf 100644
--- a/weex_core/CMakeLists.txt
+++ b/weex_core/CMakeLists.txt
@@ -1,3 +1,21 @@
+#
+# 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.
+#
cmake_minimum_required(VERSION 3.4.1)
project(WeexCore)
add_subdirectory(Source)
diff --git a/weex_core/Source/CMakeLists.txt b/weex_core/Source/CMakeLists.txt
index 7246b9e7a4..2e5624aa7f 100644
--- a/weex_core/Source/CMakeLists.txt
+++ b/weex_core/Source/CMakeLists.txt
@@ -1,3 +1,21 @@
+#
+# 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.
+#
cmake_minimum_required(VERSION 3.4.1)
set(WEEXCORE_LIBRARY_NAME weexcore)
diff --git a/weex_core/Source/IPC/CMakeLists.txt b/weex_core/Source/IPC/CMakeLists.txt
index f95e0b395e..beb1551f58 100644
--- a/weex_core/Source/IPC/CMakeLists.txt
+++ b/weex_core/Source/IPC/CMakeLists.txt
@@ -1,3 +1,22 @@
+#
+# 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.
+#
+
cmake_minimum_required(VERSION 3.4.1)
set(IPC_LIBRARY_NAME weexipc)
diff --git a/weex_core/Source/android/wrap/native_render_object_utils_impl_android.cpp b/weex_core/Source/android/wrap/native_render_object_utils_impl_android.cpp
index 8b6d9f1f0c..e7794a3160 100644
--- a/weex_core/Source/android/wrap/native_render_object_utils_impl_android.cpp
+++ b/weex_core/Source/android/wrap/native_render_object_utils_impl_android.cpp
@@ -79,7 +79,7 @@ static jlong CopyRenderObject(JNIEnv* env, jclass jcaller, jlong ptr){
static void showRenderObjectLayout(RenderObject *renderObject, int level){
LOGE("RenderObject layout %s %d %p %f %f %f %f ", renderObject->type().c_str(),
- renderObject->getStypePositionType(),
+ renderObject->getStylePositionType(),
renderObject, renderObject->getLayoutHeight(), renderObject->getLayoutWidth(),
renderObject->getLayoutPositionLeft(), renderObject->getLayoutPositionRight());
@@ -174,11 +174,11 @@ static void RenderObjectChildWaste(JNIEnv* env, jclass jcaller,
jboolean waster){
RenderObject* renderObject = convert_long_to_render_object(ptr);
if(waster){
- if(renderObject->getStypePositionType() != WXCorePositionType::kFixed){
+ if(renderObject->getStylePositionType() != WXCorePositionType::kFixed){
renderObject->setStylePositionType(WXCorePositionType::kFixed);
}
}else{
- if(renderObject->getStypePositionType() != WXCorePositionType::kRelative){
+ if(renderObject->getStylePositionType() != WXCorePositionType::kRelative){
renderObject->setStylePositionType(WXCorePositionType::kRelative);
}
}
diff --git a/weex_core/Source/core/data_render/class_factory.cc b/weex_core/Source/core/data_render/class_factory.cc
index 5e4bf0a5a8..68b72af832 100644
--- a/weex_core/Source/core/data_render/class_factory.cc
+++ b/weex_core/Source/core/data_render/class_factory.cc
@@ -1,6 +1,21 @@
-//
-// Created by chad on 2018/7/19.
-//
+/*
+ * 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.
+ */
#include "core/data_render/class_factory.h"
#include "core/data_render/class.h"
@@ -26,7 +41,7 @@ Value ClassFactory::CreateClassDescriptor(ClassDescriptor *p_super) {
stores_.push_back(std::make_pair(reinterpret_cast<GCObject *>(desc), value.type));
return value;
}
-
+
Value ClassFactory::CreateArray() {
Array *array = new Array();
Value value;
@@ -34,7 +49,7 @@ Value ClassFactory::CreateArray() {
stores_.push_back(std::make_pair(reinterpret_cast<GCObject *>(array), value.type));
return value;
}
-
+
Value ClassFactory::CreateTable() {
Table *table = new Table();
Value value;
@@ -42,7 +57,7 @@ Value ClassFactory::CreateTable() {
stores_.push_back(std::make_pair(reinterpret_cast<GCObject *>(table), value.type));
return value;
}
-
+
Value ClassFactory::ClassString() {
ClassDescriptor *desc = NewClassString();
Value value;
@@ -50,7 +65,7 @@ Value ClassFactory::ClassString() {
stores_.push_back(std::make_pair(reinterpret_cast<GCObject *>(desc), value.type));
return value;
}
-
+
Value ClassFactory::ClassJSON() {
ClassDescriptor *desc = NewClassJSON();
Value value;
@@ -58,7 +73,7 @@ Value ClassFactory::ClassJSON() {
stores_.push_back(std::make_pair(reinterpret_cast<GCObject *>(desc), value.type));
return value;
}
-
+
Value ClassFactory::ClassArray() {
ClassDescriptor *desc = NewClassArray();
Value value;
@@ -66,7 +81,7 @@ Value ClassFactory::ClassArray() {
stores_.push_back(std::make_pair(reinterpret_cast<GCObject *>(desc), value.type));
return value;
}
-
+
Value ClassFactory::ClassObject() {
ClassDescriptor *desc = NewClassOject();
Value value;
diff --git a/weex_core/Source/core/data_render/tokenizer.cc b/weex_core/Source/core/data_render/tokenizer.cc
index ddf9070abd..0ffd3eef31 100644
--- a/weex_core/Source/core/data_render/tokenizer.cc
+++ b/weex_core/Source/core/data_render/tokenizer.cc
@@ -1,3 +1,22 @@
+/*
+ * 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.
+ */
+
#include "core/data_render/tokenizer.h"
#include "core/data_render/token.h"
#include "core/data_render/scanner.h"
@@ -16,12 +35,12 @@ namespace data_render {
// TokenizerState implementation
// -------------------------------
-
+
#ifdef __ANDROID__
#undef EOF
static const char EOF = -1;
#endif
-
+
class TokenizerState {
public:
static std::unordered_map<std::string, Token::Type> keywords;
@@ -580,7 +599,7 @@ Token Tokenizer::ParseString(char delim) {
}
Token::Type type = delim == '`' ? Token::TEMPLATE : Token::STRING;
-
+
if (utf8) {
buffer = utf8_decode(buffer);
}
@@ -682,5 +701,5 @@ Token Tokenizer::ParseNumber(char start) {
}
}
-}
+}
diff --git a/weex_core/Source/core/layout/flex_enum.h b/weex_core/Source/core/layout/flex_enum.h
index 6f63e99c39..7013f98f1c 100644
--- a/weex_core/Source/core/layout/flex_enum.h
+++ b/weex_core/Source/core/layout/flex_enum.h
@@ -17,22 +17,24 @@
* under the License.
*/
-#ifdef __cplusplus
-
#ifndef WEEXCORE_FLEXLAYOUT_WXCOREFLEXENUM_H
#define WEEXCORE_FLEXLAYOUT_WXCOREFLEXENUM_H
#define WEEXCORE_CSS_DEFAULT_DIRECTION kDirectionLTR
+/* These enum definitions may also be used by C files. */
+#ifdef __cplusplus
namespace WeexCore {
- /**
- * MainAxis direction
- */
- enum WXCoreDirection {
- kDirectionInherit,
- kDirectionLTR,
- kDirectionRTL
- };
+#endif
+
+ /**
+ * MainAxis direction
+ */
+ enum WXCoreDirection {
+ kDirectionInherit,
+ kDirectionLTR,
+ kDirectionRTL
+ };
/**
* MainAxis direction
*/
@@ -130,6 +132,8 @@ namespace WeexCore {
kLeft,
};
+#ifdef __cplusplus
}
+#endif
+
#endif //WEEXCORE_FLEXLAYOUT_WXCOREFLEXENUM_H
-#endif
\ No newline at end of file
diff --git a/weex_core/Source/core/layout/layout.h b/weex_core/Source/core/layout/layout.h
index bd748e46e1..32010ce5b9 100644
--- a/weex_core/Source/core/layout/layout.h
+++ b/weex_core/Source/core/layout/layout.h
@@ -839,7 +839,7 @@ namespace WeexCore {
}
}
- inline WXCorePositionType getStypePositionType() const {
+ inline WXCorePositionType getStylePositionType() const {
return mCssStyle->mPositionType;
}
diff --git a/weex_core/Source/core/layout/style.h b/weex_core/Source/core/layout/style.h
index 5c9ca89a24..1486aec8fc 100644
--- a/weex_core/Source/core/layout/style.h
+++ b/weex_core/Source/core/layout/style.h
@@ -231,6 +231,8 @@ namespace WeexCore {
WXCorePosition mStylePosition;
constexpr static float kFlexGrowDefault = 0;
+
+ constexpr static WXCoreDirection kDirectionDefault = kDirectionLTR;
constexpr static WXCoreFlexDirection kFlexDirectionDefault= kFlexDirectionColumn;
diff --git a/weex_core/Source/third_party/json11/CMakeLists.txt b/weex_core/Source/third_party/json11/CMakeLists.txt
index 148c31ffed..0296ab309c 100644
--- a/weex_core/Source/third_party/json11/CMakeLists.txt
+++ b/weex_core/Source/third_party/json11/CMakeLists.txt
@@ -1,3 +1,22 @@
+#
+# 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.
+#
+
cmake_minimum_required(VERSION 3.4.1)
set(JSON11_LIBRARY_NAME json11)
diff --git a/weex_core/Source/weexjsc_version_script.txt b/weex_core/Source/weexjsc_version_script.txt
index c34fbfce6c..69a28ec88e 100644
--- a/weex_core/Source/weexjsc_version_script.txt
+++ b/weex_core/Source/weexjsc_version_script.txt
@@ -1,3 +1,21 @@
+#
+# 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.
+#
{
global: *Inject_GCanvasFunc*; Java_com*; JNI_OnLoad; JNI_OnUnload;
local: *;
diff --git a/weex_core/Source/wson/CMakeLists.txt b/weex_core/Source/wson/CMakeLists.txt
index a331a391dd..e42d6c75c7 100644
--- a/weex_core/Source/wson/CMakeLists.txt
+++ b/weex_core/Source/wson/CMakeLists.txt
@@ -1,3 +1,22 @@
+#
+# 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.
+#
+
cmake_minimum_required(VERSION 3.4.1)
set(WSON_LIBRARY_NAME wson)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services