You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by so...@apache.org on 2017/03/15 03:23:31 UTC
[1/7] incubator-weex git commit: * [ios] scrollToElement should have
no effect if the scroller itself can not scroll *
demo:http://dotwe.org/vue/b1ca4e9b6caea65106b152048afd3677
Repository: incubator-weex
Updated Branches:
refs/heads/0.12-dev 6057668f8 -> c6349812e
* [ios] scrollToElement should have no effect if the scroller itself can not scroll
* demo:http://dotwe.org/vue/b1ca4e9b6caea65106b152048afd3677
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/27a19d10
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/27a19d10
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/27a19d10
Branch: refs/heads/0.12-dev
Commit: 27a19d1064ce10561a234dcb2c98269266f7311d
Parents: d876e67
Author: \u9690\u98ce <cx...@apache.org>
Authored: Tue Mar 14 16:16:00 2017 +0800
Committer: \u9690\u98ce <cx...@apache.org>
Committed: Tue Mar 14 16:16:00 2017 +0800
----------------------------------------------------------------------
ios/sdk/WeexSDK/Sources/Component/WXListComponent.m | 5 +++++
ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.m | 7 +++++++
2 files changed, 12 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/27a19d10/ios/sdk/WeexSDK/Sources/Component/WXListComponent.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXListComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXListComponent.m
index c9f8a0e..e019eba 100644
--- a/ios/sdk/WeexSDK/Sources/Component/WXListComponent.m
+++ b/ios/sdk/WeexSDK/Sources/Component/WXListComponent.m
@@ -173,6 +173,11 @@
- (void)scrollToComponent:(WXComponent *)component withOffset:(CGFloat)offset animated:(BOOL)animated
{
+ if (_tableView.contentSize.height <= _tableView.frame.size.height) {
+ // can not scroll
+ return;
+ }
+
CGPoint contentOffset = _tableView.contentOffset;
CGFloat contentOffsetY = 0;
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/27a19d10/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.m
index de08173..f931815 100644
--- a/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.m
+++ b/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.m
@@ -318,6 +318,13 @@ WX_EXPORT_METHOD(@selector(resetLoadmore))
- (void)scrollToComponent:(WXComponent *)component withOffset:(CGFloat)offset animated:(BOOL)animated
{
UIScrollView *scrollView = (UIScrollView *)self.view;
+
+ if ((_scrollDirection == WXScrollDirectionHorizontal && scrollView.contentSize.width <= scrollView.frame.size.width)
+ || (_scrollDirection == WXScrollDirectionVertical && scrollView.contentSize.height <= scrollView.frame.size.height)) {
+ // can not scroll
+ return;
+ }
+
CGPoint contentOffset = scrollView.contentOffset;
CGFloat scaleFactor = self.weexInstance.pixelScaleFactor;
[3/7] incubator-weex git commit: Merge branch '0.11-dev' of
https://github.com/cxfeng1/incubator-weex into 0.11-dev
Posted by so...@apache.org.
Merge branch '0.11-dev' of https://github.com/cxfeng1/incubator-weex into 0.11-dev
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/686b8170
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/686b8170
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/686b8170
Branch: refs/heads/0.12-dev
Commit: 686b817023e5fe52e492c0af8befbb03554f8f6a
Parents: 9453a48 e429628
Author: cxfeng <cx...@apache.org>
Authored: Tue Mar 14 17:14:51 2017 +0800
Committer: cxfeng <cx...@apache.org>
Committed: Tue Mar 14 17:14:51 2017 +0800
----------------------------------------------------------------------
ios/sdk/WeexSDK/Sources/Component/WXListComponent.m | 5 +++++
ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.m | 7 +++++++
2 files changed, 12 insertions(+)
----------------------------------------------------------------------
[7/7] incubator-weex git commit: * [test] use danger.js replace
danger ruby
Posted by so...@apache.org.
* [test] use danger.js replace danger ruby
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/c6349812
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/c6349812
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/c6349812
Branch: refs/heads/0.12-dev
Commit: c6349812e13ef8812b4ecc04963b27217846d5bc
Parents: 6057668 5523afc
Author: sospartan <so...@gmail.com>
Authored: Wed Mar 15 11:22:45 2017 +0800
Committer: sospartan <so...@gmail.com>
Committed: Wed Mar 15 11:22:45 2017 +0800
----------------------------------------------------------------------
.travis.yml | 4 +-
Dangerfile | 83 -------------
.../test/java/com/taobao/weex/TestActivity.java | 4 +-
dangerfile.js | 117 +++++++++++++++++++
.../WeexSDK/Sources/Component/WXListComponent.m | 5 +
.../Sources/Component/WXScrollerComponent.m | 7 ++
.../WeexSDK/Sources/Layout/WXComponent+Layout.m | 2 +
package.json | 8 +-
test/ci-funcs.sh | 4 +-
9 files changed, 141 insertions(+), 93 deletions(-)
----------------------------------------------------------------------
[4/7] incubator-weex git commit: * [ios] recalculate border radius if frame is changed * demoļ¼ http://dotwe.org/weex/1dd72e706721b485414bfd0b232cdd63
Posted by so...@apache.org.
* [ios] recalculate border radius if frame is changed
* demo\uff1a http://dotwe.org/weex/1dd72e706721b485414bfd0b232cdd63
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/1b9c86e9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/1b9c86e9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/1b9c86e9
Branch: refs/heads/0.12-dev
Commit: 1b9c86e91c393f7e06dfa6f7a974c637b47960b4
Parents: e429628
Author: \u9690\u98ce <cx...@apache.org>
Authored: Tue Mar 14 18:08:04 2017 +0800
Committer: \u9690\u98ce <cx...@apache.org>
Committed: Tue Mar 14 18:08:04 2017 +0800
----------------------------------------------------------------------
ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.m | 2 ++
1 file changed, 2 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/1b9c86e9/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.m b/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.m
index 5053cd6..ebed910 100644
--- a/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.m
+++ b/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.m
@@ -126,6 +126,8 @@
}
}
+ [self _resetNativeBorderRadius];
+
if (strongSelf->_transform) {
[strongSelf->_transform applyTransformForView:strongSelf.view];
}
[2/7] incubator-weex git commit: Merge remote-tracking branch
'upstream/0.11-dev' into 0.11-dev
Posted by so...@apache.org.
Merge remote-tracking branch 'upstream/0.11-dev' into 0.11-dev
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/e429628e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/e429628e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/e429628e
Branch: refs/heads/0.12-dev
Commit: e429628e600c66b127eade2d7b9f2c6e57aac10a
Parents: 27a19d1 de623be
Author: \u9690\u98ce <cx...@apache.org>
Authored: Tue Mar 14 16:18:58 2017 +0800
Committer: \u9690\u98ce <cx...@apache.org>
Committed: Tue Mar 14 16:18:58 2017 +0800
----------------------------------------------------------------------
Dangerfile | 2 +-
.../com/taobao/weex/common/WXImageStrategy.java | 2 +-
.../main/java/com/taobao/weex/dom/WXStyle.java | 25 ++------
.../taobao/weex/ui/component/WXComponent.java | 10 ++--
.../com/taobao/weex/ui/component/WXImage.java | 61 ++++++++++++++++++--
.../weex/ui/view/border/BorderDrawable.java | 4 +-
.../java/com/taobao/weex/dom/WXStyleTest.java | 23 +-------
.../taobao/weex/utils/FunctionParserTest.java | 11 ++--
package.json | 9 ++-
9 files changed, 84 insertions(+), 63 deletions(-)
----------------------------------------------------------------------
[5/7] incubator-weex git commit: Merge remote-tracking branch
'upstream/0.11-dev' into 0.11-dev
Posted by so...@apache.org.
Merge remote-tracking branch 'upstream/0.11-dev' into 0.11-dev
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/f9b42374
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/f9b42374
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/f9b42374
Branch: refs/heads/0.12-dev
Commit: f9b423743902ffee01969b917f88702cf69ea08d
Parents: 1b9c86e 686b817
Author: \u9690\u98ce <cx...@apache.org>
Authored: Tue Mar 14 18:08:14 2017 +0800
Committer: \u9690\u98ce <cx...@apache.org>
Committed: Tue Mar 14 18:08:14 2017 +0800
----------------------------------------------------------------------
.../java/com/alibaba/weex/WXPageActivity.java | 2 +-
.../extend/module/location/DefaultLocation.java | 110 ++++++++++---------
.../taobao/weex/ui/component/WXComponent.java | 5 +-
.../adapter/WXRecyclerViewOnScrollListener.java | 28 +++--
4 files changed, 84 insertions(+), 61 deletions(-)
----------------------------------------------------------------------
[6/7] incubator-weex git commit: 0.11 dev dangerjs (#4)
Posted by so...@apache.org.
0.11 dev dangerjs (#4)
* [test] use danger.js
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/5523afc4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/5523afc4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/5523afc4
Branch: refs/heads/0.12-dev
Commit: 5523afc4817bd3ca1e9f57da352d67fd6f9d4c8e
Parents: f9b4237
Author: sospartan zheng <so...@apache.org>
Authored: Wed Mar 15 11:21:18 2017 +0800
Committer: GitHub <no...@github.com>
Committed: Wed Mar 15 11:21:18 2017 +0800
----------------------------------------------------------------------
.travis.yml | 4 +-
Dangerfile | 83 -------------
.../test/java/com/taobao/weex/TestActivity.java | 4 +-
dangerfile.js | 117 +++++++++++++++++++
package.json | 8 +-
test/ci-funcs.sh | 4 +-
6 files changed, 127 insertions(+), 93 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/5523afc4/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
index 09416c4..91a1010 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,7 +1,7 @@
os:
- osx
- linux
-language: ruby
+language: nodejs
rvm: 2.0.0
env:
- TEST_SUITE=ios
@@ -13,7 +13,7 @@ matrix:
exclude:
- os: linux
env: TEST_SUITE=ios
- - os: linux
+ - os: osx
env: TEST_SUITE=danger
- os: osx
env: TEST_SUITE=jsfm
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/5523afc4/Dangerfile
----------------------------------------------------------------------
diff --git a/Dangerfile b/Dangerfile
deleted file mode 100644
index 39b4dba..0000000
--- a/Dangerfile
+++ /dev/null
@@ -1,83 +0,0 @@
-# Error or Warn when delete public interface
-metion_break_change = git.commits.any? { |c| c.message =~ /'breack change'/ }
-
-# File name match any of these patterns will be ignored.
-def is_ignored_public_check file
- ignored_break_change_pattern = Array.[](
- /^android\/sdk\/src\/test\/.+/,
- /^android\/playground\/.+/,
- )
- for pattern in ignored_break_change_pattern do
- if file =~ pattern
- return true
- end
- end
- return false
-end
-
-
-for file in git.modified_files do
- if not is_ignored_public_check(file) && file.end_with?("java")
- diff = git.diff_for_file(file)
- if diff && diff.patch =~ /^-\s*?public\s+[\s\S]+$/
- if metion_break_change
- warn("Potential BREAK CHANGE. Modify public in #{file}")
- else
- warn("Potential BREAK CHANGE. Modify public in #{file} without metion it in commit message. You'd better add 'break change' in your commit log. ")
- end
- end
- end
-end
-
-# Warn when there is a big PR
-warn("Big PR") if git.lines_of_code > 500
-
-has_app_changes = !git.modified_files.grep(/WeexSDK\/Source/).empty?
-has_test_changes = !git.modified_files.grep(/WeexSDKTests/).empty?
-
-# Non-trivial amounts of app changes without tests
-if git.lines_of_code > 100 && has_app_changes && !has_test_changes
- warn "This PR may need tests."
-end
-
-
-# Fails build when Copyright header is not included
-oc_files = (git.modified_files + git.added_files).uniq.select do |file_path|
- file_path.end_with?(".h") || file_path.end_with?(".m") || file_path.end_with?(".mm")
-end
-
-copyright_header_components = Array.[](
- /Created by Weex./,
- /Copyright \(c\) .*, Alibaba, Inc. All rights reserved./,
- /This source code is licensed under the Apache Licence 2.0./,
- /For the full copyright and license information,please view the LICENSE file in the root directory of this source tree./
-)
-
-def has_copyright_header contents, copyright
- for line in copyright do
- if not contents =~ line
- return false
- end
- end
- return true
-end
-
-for file_path in oc_files do
- contents = File.read(file_path)
- if not has_copyright_header(contents, copyright_header_components)
- fail("Objective-C file '#{file_path}' does not have the copyright header.")
- end
-end
-
-# prose.check_spelling oc_files
-
-# Find reviewers without parsing blame information
-# from files matching to 'Pods/*'
-# mention.run(2, ["Pods/*"], [])
-
-
-# warn("Please add your name", file: "CHANGELOG.md", line: 4)
-
-# fail("Our linter has failed.")
-
-# markdown("## xxxxx")
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/5523afc4/android/sdk/src/test/java/com/taobao/weex/TestActivity.java
----------------------------------------------------------------------
diff --git a/android/sdk/src/test/java/com/taobao/weex/TestActivity.java b/android/sdk/src/test/java/com/taobao/weex/TestActivity.java
index f5d2e75..cd82438 100644
--- a/android/sdk/src/test/java/com/taobao/weex/TestActivity.java
+++ b/android/sdk/src/test/java/com/taobao/weex/TestActivity.java
@@ -208,8 +208,8 @@ import android.app.Activity;
/**
* Created by sospartan on 7/27/16.
*/
-public class TestActivity extends Activity {
- public void test(){
+public class TestActivity extends Activity {
+ public void test(){
//
}
}
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/5523afc4/dangerfile.js
----------------------------------------------------------------------
diff --git a/dangerfile.js b/dangerfile.js
new file mode 100644
index 0000000..1dbf20e
--- /dev/null
+++ b/dangerfile.js
@@ -0,0 +1,117 @@
+import { danger, fail, warn } from "danger";
+import fs from "fs";
+
+// Make sure there are changelog entries
+// const hasChangelog = danger.git.modified_files.includes("changelog.md")
+// if (!hasChangelog) { fail("No Changelog changes!") }
+
+const jsFiles = danger.git.created_files.filter(path => path.endsWith("js"));
+
+// new js files should have `@flow` at the top
+const unFlowedFiles = jsFiles.filter(filepath => {
+ const content = fs.readFileSync(filepath);
+ return !content.includes("@flow");
+});
+
+if (unFlowedFiles.length > 0) {
+ warn(
+ `These new JS files do not have Flow enabled: ${unFlowedFiles.join(", ")}`
+ );
+}
+
+// Error or Warn when delete public interface
+var methion_break_change = false;
+for (let c of danger.git.commits) {
+ // console.log("msg:" + c.message);
+ if (c.message && c.message.match(/break\s+change/i)) {
+ methion_break_change = true;
+ break;
+ }
+}
+
+// File name match any of these patterns will be ignored.
+function is_ignored_public_check(file) {
+ var ignored_break_change_pattern = [
+ /^android\/sdk\/src\/test\/.+/,
+ /^android\/playground\/.+/
+ ];
+ for (let p of ignored_break_change_pattern) {
+ if (file.match(p)) {
+ return true;
+ }
+ }
+ return false;
+}
+
+var has_app_changes = false;
+var has_test_changes = false;
+var codefiles = [];
+for (let file of danger.git.modified_files) {
+ console.log("check file:" + file);
+ if (file.match(/WeexSDK\/Source/)) {
+ has_app_changes = true;
+ } else if (file.match(/WeexSDKTests/)) {
+ has_test_changes = true;
+ }
+
+ if (!is_ignored_public_check(file) && file.endsWith(".java")) {
+ var diff = danger.git.diffForFile(file);
+ // console.log("diff\uff1a" + diff+ typeof diff);
+ if (diff && diff.match(/^-\s*?public\s+[\s\S]+$/gm)) {
+ if (methion_break_change) {
+ warn("Potential BREAK CHANGE. Modify public in " + file);
+ } else {
+ warn(
+ "Potential BREAK CHANGE. Modify public in " +
+ file +
+ " without metion it in commit message. You'd better add 'break change' in your commit log. "
+ );
+ }
+ }
+ }
+
+ if (
+ file.endsWith(".h") ||
+ file.endsWith(".m") ||
+ file.endsWith(".mm")
+ ) {
+ codefiles.push(file);
+ }
+}
+if(danger.git.added_files){
+ for (let file of danger.git.added_files) {
+ if (
+ file.endsWith(".h") ||
+ file.endsWith(".m") ||
+ file.endsWith(".mm")
+ ) {
+ codefiles.push(file);
+ }
+ }
+}
+
+if (danger.git.lines_of_code > 500) {
+ warn("Big PR");
+}
+
+if (danger.git.lines_of_code > 100 && has_app_changes && !has_test_changes) {
+ warn("This PR may need tests.");
+}
+
+//check ios copyright
+const copyright_header_components = [
+ "Created by Weex.",
+ "Copyright \\(c\\) .*, Alibaba, Inc. All rights reserved.",
+ "This source code is licensed under the Apache Licence 2.0.",
+ "For the full copyright and license information,please view the LICENSE file in the root directory of this source tree."
+];
+
+codefiles.forEach(filepath => {
+ const content = fs.readFileSync(filepath).toString();
+ for (const line of copyright_header_components) {
+ if (!content.match(new RegExp(line))) {
+ fail("Code file "+ filepath +" does not have the copyright header.");
+ return;
+ }
+ }
+});
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/5523afc4/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 39c3f76..69980e8 100644
--- a/package.json
+++ b/package.json
@@ -72,7 +72,8 @@
"clean": "npm run clean:examples && npm run clean:test",
"copy:js": "cp -vf ./dist/native.js ./android/sdk/assets/main.js",
"copy:examples": "rm -rf ./android/playground/app/src/main/assets/* && cp -vrf ./examples/build/* ./android/playground/app/src/main/assets/",
- "copy": "npm run copy:js && npm run copy:examples"
+ "copy": "npm run copy:js && npm run copy:examples",
+ "danger": "danger"
},
"dependencies": {
"animationjs": "^0.1.5",
@@ -91,9 +92,6 @@
"weex-styler":"0.1.9"
},
"devDependencies": {
- "xml2map": "^1.0.2",
- "weex-wd": "^1.0.14",
- "macaca-utils": "^0.1.9",
"babel-core": "^6.17.0",
"babel-istanbul": "^0.11.0",
"babel-loader": "^6.2.5",
@@ -104,6 +102,7 @@
"chromedriver": "^2.21.2",
"cross-spawn": "^4.0.0",
"css-loader": "^0.26.1",
+ "danger": "^0.11.5",
"eslint": "^2.11.1",
"fs-extra": "^2.0.0",
"http-server": "^0.9.0",
@@ -144,6 +143,7 @@
"weex-components": "^0.2.0",
"weex-loader": "^0.4.0",
"weex-vdom-tester": "^0.2.0",
+ "weex-wd": "^1.0.14",
"wwp": "^0.3.5",
"xml2map": "^1.0.2"
}
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/5523afc4/test/ci-funcs.sh
----------------------------------------------------------------------
diff --git a/test/ci-funcs.sh b/test/ci-funcs.sh
index 8b4915b..00135fb 100644
--- a/test/ci-funcs.sh
+++ b/test/ci-funcs.sh
@@ -63,7 +63,7 @@ function setup_cpt {
# setupBasic
npm install
else
- gem install danger danger-xcode_summary xcpretty xcpretty-json-formatter
+ npm install
fi
}
@@ -111,7 +111,7 @@ function test_cpt {
npm run build
npm run test
else
- bundle exec danger
+ npm run danger
fi
}