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

Add Lint in TravisCI and Update iOS TravisCI #2731

Merged
merged 143 commits into from
Aug 8, 2019
Merged
Show file tree
Hide file tree
Changes from 83 commits
Commits
Show all changes
143 commits
Select commit Hold shift + click to select a range
7e93ae3
merge
wrmswindmill Jul 15, 2019
034d38c
Merge branch 'master' of https://github.com/wrmswindmill/incubator-weex
wrmswindmill Jul 16, 2019
d6d127f
update .travis.yml for oclint
wrmswindmill Jul 18, 2019
ed2e713
Merge branch 'master' of https://github.com/wrmswindmill/incubator-weex
wrmswindmill Jul 18, 2019
bbf9446
update .travis.yml for oclint
wrmswindmill Jul 18, 2019
6cefc8d
Merge branch 'master' of https://github.com/wrmswindmill/incubator-weex
wrmswindmill Jul 18, 2019
175b747
.travis.yml
wrmswindmill Jul 18, 2019
2a2e998
.travis.yml
wrmswindmill Jul 18, 2019
1c99e59
update
wrmswindmill Jul 18, 2019
5aa966d
update
wrmswindmill Jul 18, 2019
da83adf
update
wrmswindmill Jul 18, 2019
c2ff7d0
update android and ios
wrmswindmill Jul 18, 2019
fce5c37
update android and ios
wrmswindmill Jul 18, 2019
d226c55
test
wrmswindmill Jul 18, 2019
70382ff
test
wrmswindmill Jul 18, 2019
c19263c
test -2
wrmswindmill Jul 18, 2019
45632bf
test-3
wrmswindmill Jul 18, 2019
3825f00
test-4
wrmswindmill Jul 18, 2019
798e867
test-5
wrmswindmill Jul 18, 2019
cb0687b
test-5
wrmswindmill Jul 18, 2019
345a85e
Delete 1.sh
wrmswindmill Jul 19, 2019
7804e01
upload ios/sdk/.gitignore
wrmswindmill Jul 19, 2019
629b759
Merge branch 'master' of https://github.com/wrmswindmill/incubator-weex
wrmswindmill Jul 19, 2019
0adc403
delete
wrmswindmill Jul 19, 2019
ca1573b
test android code format
wrmswindmill Jul 21, 2019
dc625cf
add new line in android/sdk/src/main/java/com/taobao/weex/adapter/Cla…
wrmswindmill Jul 21, 2019
82c5bb6
add new line in android/sdk/src/main/java/com/taobao/weex/adapter/Cla…
wrmswindmill Jul 21, 2019
eed9cc4
add new line in android/sdk/src/main/java/com/taobao/weex/adapter/Cla…
wrmswindmill Jul 21, 2019
0cbc129
add new line in android/sdk/src/main/java/com/taobao/weex/adapter/Cla…
wrmswindmill Jul 21, 2019
45dbeaf
add new line in android/sdk/src/main/java/com/taobao/weex/adapter/Cla…
wrmswindmill Jul 21, 2019
dbcaa92
Update .travis.yml
wrmswindmill Jul 21, 2019
b6711dc
test
wrmswindmill Jul 22, 2019
df518ad
Merge branch 'lint' of https://github.com/wrmswindmill/incubator-weex…
wrmswindmill Jul 22, 2019
d54f801
test
wrmswindmill Jul 22, 2019
18a9573
test
wrmswindmill Jul 22, 2019
d439e99
test
wrmswindmill Jul 22, 2019
9907c91
test
wrmswindmill Jul 22, 2019
d0407b9
test for dangerfile ruby
wrmswindmill Jul 22, 2019
a52a635
test for dangerfile ruby
wrmswindmill Jul 22, 2019
b189e3d
test for dangerfile ruby
wrmswindmill Jul 22, 2019
2d96450
test for dangerfile ruby
wrmswindmill Jul 22, 2019
b6cb33b
test for dangerfile ruby
wrmswindmill Jul 22, 2019
4b30d74
test for dangerfile ruby
wrmswindmill Jul 22, 2019
950a8cb
add asan
wrmswindmill Jul 22, 2019
cedf4fb
add asan
wrmswindmill Jul 22, 2019
69a406b
test code format and asan
wrmswindmill Jul 22, 2019
7b8def1
test code format and asan
wrmswindmill Jul 22, 2019
931cbc0
test code format and asan
wrmswindmill Jul 22, 2019
2aff44d
test code format and asan2
wrmswindmill Jul 22, 2019
193124d
adjust job order
wrmswindmill Jul 22, 2019
acc85c1
update .travis.yml
wrmswindmill Jul 22, 2019
7cba71b
test
wrmswindmill Jul 22, 2019
615f84d
test ios travis
wrmswindmill Jul 22, 2019
bfc7a40
merge
wrmswindmill Jul 22, 2019
7a5f6b0
update .travis.yml for oclint
wrmswindmill Jul 18, 2019
006c765
.travis.yml
wrmswindmill Jul 18, 2019
6dbff5c
.travis.yml
wrmswindmill Jul 18, 2019
310c32e
update
wrmswindmill Jul 18, 2019
59ac991
update
wrmswindmill Jul 18, 2019
8a36f04
update
wrmswindmill Jul 18, 2019
160b8aa
update android and ios
wrmswindmill Jul 18, 2019
e8321bc
update android and ios
wrmswindmill Jul 18, 2019
c0e261f
test
wrmswindmill Jul 18, 2019
78ffbd5
test
wrmswindmill Jul 18, 2019
86de4c3
test -2
wrmswindmill Jul 18, 2019
c678b2c
test-3
wrmswindmill Jul 18, 2019
76f0e2f
test-4
wrmswindmill Jul 18, 2019
d4d3efd
test-5
wrmswindmill Jul 18, 2019
b7d474e
Delete 1.sh
wrmswindmill Jul 19, 2019
a4777c4
upload ios/sdk/.gitignore
wrmswindmill Jul 19, 2019
1467029
Merge branch 'master' of https://github.com/wrmswindmill/incubator-weex
wrmswindmill Jul 22, 2019
b58efdc
Merge pull request #11 from wrmswindmill/lint
wrmswindmill Jul 22, 2019
9bb8a10
update
wrmswindmill Jul 22, 2019
266bcb6
update2
wrmswindmill Jul 22, 2019
ce77b0c
update3
wrmswindmill Jul 22, 2019
5b49f35
update3
wrmswindmill Jul 22, 2019
d943110
update3
wrmswindmill Jul 23, 2019
e199c3f
update3
wrmswindmill Jul 23, 2019
98f6545
Merge pull request #12 from wrmswindmill/lint2
wrmswindmill Jul 23, 2019
97ae515
ios uitest fail and exit
wrmswindmill Jul 23, 2019
ce436aa
Update .travis.yml
wrmswindmill Jul 23, 2019
ddd48f7
Merge remote-tracking branch 'upstream/master'
wrmswindmill Jul 24, 2019
efc4614
merge
wrmswindmill Jul 24, 2019
b66e8b8
Update .travis.yml
wrmswindmill Jul 25, 2019
d691708
Update ClassLoaderAdapter.java
wrmswindmill Jul 25, 2019
3531b25
Update ClassLoaderAdapter.java
wrmswindmill Jul 25, 2019
8ef0ecc
update ClassLoaderAdapter.java
Yogayu Jul 25, 2019
fef51dd
Update ClassLoaderAdapter.java
wrmswindmill Jul 25, 2019
f79edc1
update ClassLoaderAdapter.java
Yogayu Jul 25, 2019
830bb6f
Reset ClassLoaderAdapter.java
Yogayu Jul 25, 2019
11dd0e5
output oclint message
wrmswindmill Jul 27, 2019
bc05793
update
wrmswindmill Jul 30, 2019
d25582d
update danger from 0.8 to 9.0 And --danger-id
wrmswindmill Jul 30, 2019
1943636
remove -i
wrmswindmill Jul 30, 2019
e91e1e0
update npm to yarn
wrmswindmill Jul 30, 2019
3083794
update npm from 7.6 to 8.0
wrmswindmill Jul 30, 2019
935cb49
Merge branch 'master' into fix-danger
wrmswindmill Jul 30, 2019
daed95c
update danger run to danger ci
wrmswindmill Jul 30, 2019
f3cf951
update
wrmswindmill Jul 30, 2019
1d9d5a0
update npm package
wrmswindmill Jul 30, 2019
e563bbf
update node to 12.6
wrmswindmill Jul 30, 2019
51a05c0
reset yarn to npm run danger --
wrmswindmill Jul 30, 2019
09bf60e
reset package.json and package-lock.json
wrmswindmill Jul 30, 2019
748fa44
change to yarn because npm package error and install android lint plugin
wrmswindmill Jul 30, 2019
65647dd
update to grep
wrmswindmill Jul 30, 2019
4c159fd
add java file
wrmswindmill Jul 30, 2019
049f481
remove osx_image: xcode7.2 and add cd android
wrmswindmill Jul 30, 2019
cba1a26
brew update node
wrmswindmill Jul 30, 2019
f07e90f
try to fix ios build error
wrmswindmill Jul 30, 2019
e3e9a0a
add -quiet to solve log too log and increase git init in android
wrmswindmill Jul 30, 2019
677c3fe
fix android lint plugin
wrmswindmill Jul 30, 2019
8dfff58
remove modify for Gemfile.lock
wrmswindmill Jul 30, 2019
6e3b2e7
add lintOptions:xmlReport true in android/sdk/build.gradle
wrmswindmill Jul 30, 2019
5d4c334
only keep android lint to test
wrmswindmill Jul 30, 2019
90c3a87
only keep android lint to test
wrmswindmill Jul 30, 2019
084777c
only keep android lint to test
wrmswindmill Jul 30, 2019
5a22656
only keep android lint to test 5
wrmswindmill Jul 30, 2019
392c836
only keep android lint to test 6
wrmswindmill Jul 30, 2019
1e5f1a6
only keep android lint to test 7
wrmswindmill Jul 30, 2019
efa2145
only keep android lint to test 8
wrmswindmill Jul 30, 2019
3e66136
only keep android lint to test 9
wrmswindmill Jul 31, 2019
2583824
remove android lint plugin
wrmswindmill Jul 31, 2019
d0b48c0
remove android lint plugin test2
wrmswindmill Jul 31, 2019
18bd209
read sdk/build/reports/lint-results.xml
wrmswindmill Jul 31, 2019
b6aa447
read sdk/build/reports/lint-results.xml and update
wrmswindmill Jul 31, 2019
cd13248
update xml directory
wrmswindmill Jul 31, 2019
0400639
finish
wrmswindmill Jul 31, 2019
31004d0
remove android lint plugin
wrmswindmill Jul 31, 2019
241bb46
Merge pull request #15 from wrmswindmill/fix-danger
wrmswindmill Jul 31, 2019
98dc055
test android lint
wrmswindmill Jul 31, 2019
7be8783
Merge branch 'master' of https://github.com/wrmswindmill/incubator-weex
wrmswindmill Jul 31, 2019
fb5fbb6
reset java file
wrmswindmill Jul 31, 2019
c535016
format androidlint output
wrmswindmill Jul 31, 2019
8ef6a10
format androidlint output and add a java file for test
wrmswindmill Jul 31, 2019
fddd73a
add comment to danger-output.js
wrmswindmill Jul 31, 2019
2f2d3a7
reset java file
wrmswindmill Jul 31, 2019
6f62829
add disable-rule=BitwiseOperatorInConditional
wrmswindmill Aug 1, 2019
076be05
update changes for code review
wrmswindmill Aug 2, 2019
79494d2
reset Gemfile.lock
wrmswindmill Aug 3, 2019
9715008
remove codeFormat task in Travis CI
wrmswindmill Aug 7, 2019
b333353
reset weex-playground
wrmswindmill Aug 8, 2019
e850657
update .travis.yml and reset playground
wrmswindmill Aug 8, 2019
4fbb51e
use lastest weex-playground
wrmswindmill Aug 8, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 91 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ node_js: 7.6
matrix:
fast_finish: true
include:
# format code using clang-format
- env: FORMAT_CODE=true
YorkShen marked this conversation as resolved.
Show resolved Hide resolved
language: ruby
- env: TEST_SUITE=danger
- env: TEST_SUITE=jsfm
- env: TEST_SUITE=ios
Expand All @@ -25,27 +28,51 @@ matrix:
- android-26
- extra-android-m2repository
- env: TEST_SUITE=android ABI=x86
language: android
dist: trusty
jdk: oraclejdk8
android:
components:
- android-26
- extra-android-m2repository
# static check
- env: STATIC_CODE_ANALYSIS=true CHECK_C=true
YorkShen marked this conversation as resolved.
Show resolved Hide resolved
language: objective-c
osx_image: xcode7.2
- env: STATIC_CODE_ANALYSIS=true CHECK_ANDROID=true
YorkShen marked this conversation as resolved.
Show resolved Hide resolved
language: android
dist: trusty
jdk: oraclejdk8
android:
components:
- android-26
- extra-android-m2repository

cache:
directories:
- npm
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
- $HOME/.android/build-cache
- $HOME/android-ndk-r18b
- bundle

before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/

before_install:
- |
# install oclint
if [[ ("${STATIC_CODE_ANALYSIS}" = "true") && ("${CHECK_C}" = "true") ]]; then
brew cask uninstall oclint
brew tap oclint/formulae
brew install oclint
fi

install:
- |
case $TEST_SUITE in
"android")
if [[ ("$TEST_SUITE" = "android") || ("${CHECK_ANDROID}" = "true") ]]; then
curl -o- https://github.com/raw/nvm-sh/nvm/v0.34.0/install.sh | bash
nvm install 7.6
npm install
Expand All @@ -64,11 +91,18 @@ install:
export ANDROID_NDK_HOME=$HOME/android-ndk-r18b
export PATH=$PATH:$ANDROID_NDK_HOME
echo "ndk.dir=$ANDROID_NDK_HOME" > android/local.properties
;;
"jsfm" | "danger" | "ios" )
elif [[ ("$TEST_SUITE" = "jsfm") || ("$TEST_SUITE" = "danger") || ("${CHECK_C}" = "true") ]]; then
npm install
;;
esac
elif [[ ("$TEST_SUITE" = "ios") ]]; then
git submodule update --init --remote
cd weex-playground/ios && bash update_podfile_for_travisci.sh
cd ../../ && npm install
cd weex-playground/ios && pod install --repo-update
cd ../../
elif [[ ("${FORMAT_CODE}" = "true" )]]; then
bundle install
fi

script:
- |
case $TEST_SUITE in
Expand Down Expand Up @@ -106,10 +140,60 @@ script:
hasIosFile=$(npm run danger -- run --dangerfile ./dangerfile-ios.js)
echo "The value of hasIosFile is ${hasIosFile}"
if [[ "$hasIosFile" =~ "hasIosFile" ]]; then
xcodebuild -project ios/sdk/WeexSDK.xcodeproj test -scheme WeexSDKTests CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO -destination "platform=iOS Simulator,name=iPhone 6"
# build WeexSDK and run WeexSDKTests
xcodebuild -project ios/sdk/WeexSDK.xcodeproj test -scheme WeexSDKTests CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO -destination "platform=iOS Simulator,name=iPhone 6" || exit 1
# build WeexDemo and run WeexDemo test
cd weex-playground/ios && mkdir tmp && mv * tmp;cd tmp
xcodebuild -workspace WeexDemo.xcworkspace test -scheme WeexDemo CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO -destination "platform=iOS Simulator,name=iPhone 6" || exit 1
fi
;;
esac

if [[ ("${STATIC_CODE_ANALYSIS}" = "true") && ("${CHECK_C}" = "true") ]]; then
hasCFile=$(npm run danger -- run --dangerfile ./dangerfile-static-check.js)
echo "The value of hasCFile is ${hasCFile}"
if [[ "$hasCFile" =~ "hasCFile" ]]; then
echo "hasCFile"
cd ios/sdk && xcodebuild | xcpretty -r json-compilation-database -o compile_commands.json
oclint-json-compilation-database oclint_args -- \
YorkShen marked this conversation as resolved.
Show resolved Hide resolved
-disable-rule=ShortVariableName \
-disable-rule=LongLine \
-disable-rule=LongMethod \
-disable-rule=HighNcssMethod \
-disable-rule=LongVariableName \
-disable-rule=HighCyclomaticComplexity \
-disable-rule=HighNPathComplexity \
-disable-rule=UnusedLocalVariable \
-disable-rule=DoubleNegative \
-disable-rule=MultipleUnaryOperator \
-disable-rule=DeepNestedBlock \
-max-priority-1=15000 \
-max-priority-2=15000 \
-max-priority-3=15000
fi
fi

if [[ ("${STATIC_CODE_ANALYSIS}" = "true") && ("${CHECK_ANDROID}" = "true") ]]; then
hasAndroidFile=$(npm run danger -- run --dangerfile ./dangerfile-static-check.js)
echo "The value of hasAndroidFile is ${hasAndroidFile}"
if [[ "$hasAndroidFile" =~ "hasAndroidFile" ]]; then
# format code using google-java-format at first
# for n in `find ./android -name "*.java"`; do
# java -jar ./format-tool/google-java-format-1.7-all-deps.jar --replace $n
# done
# then run android lint
# echo "hasAndroidFile"
echo "run android lint"
cd android
./gradlew lint
fi
fi

if [[ ("${FORMAT_CODE}" = "true" )]]; then
echo "exec danger ruby"
bundle exec danger
fi

notifications:
webhooks:
on_pull_requests: false
Expand Down
1 change: 1 addition & 0 deletions Dangerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
code_style_validation.check file_extensions: ['.cc', '.cpp', '.m', 'mm', '.h', '.java']
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why adding this file?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because code format validator is based on danger plugin: code_style_validation
and this line in Dangerfile is to start format check.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not that familiar with danger, please let me know when this Dangerfile will be executed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here is the format code part in .travis I list above:

matrix:
    fast_finish: true
    include:
      # format code using clang-format
      - env: TEST_SUITE=code_format
        language: ruby

install:
    elif[[ ("$TEST_SUITE" = "code_format") ]]; then
        bundle install
    fi

script:
    if [[ ("$TEST_SUITE" = "code_format") ]]; then
        echo "exec danger ruby"
        bundle exec danger
    fi

Copy link
Contributor

@YorkShen YorkShen Aug 2, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct me if I am wrong.

It seems like you are using the ruby version of danger for code_format, and the ruby version danger will some use Dangerfile as its source.

If this is the case, relying on https://github.com/wrmswindmill/danger-code_style_validation.git is not an option in my knowledge, as the source file could be changed in any minutes. At least, you should rely a publish version of https://github.com/wrmswindmill/danger-code_style_validation.git. I suggest you share your ideas in the mailing list.

PS:

  1. I don't see the output of the code format in danger.
  2. You should also provide a format script or file, within which developers could import the file into their IDE( XCode or Android Studio) and format code with one click.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, it rely on https://github.com/wrmswindmill/danger-code_style_validation.git, which I fork from https://github.com/flix-tech/danger-code_style_validation and I update some code for weex project. I will share this plugin in the mailing list as well as the static check in Travis CI.

here are some changes I make for danger-code_style_validation:

  1. change message level from error to warn
  2. modify the message hint:
If you have not install clang-format, you can install clang-format by npm install -g clang-format
Then Execute one of the following actions and commit again:

Run clang-format -i on the offending files
Apply the suggested patches with git apply patch.
If you use Xcode,you can also use clang-format plugin: https://github.com/travisjeffery/ClangFormat-Xcode

the below is my answer for your question:

  1. there are not output of the code format in danger because every file I changed is conform with the regulations ,here is the demo of it:test oclint output using danger_output wrmswindmill/incubator-weex#13 (comment)
  2. I provide the extra message. Xcode has plugin but there are no plugin for android studio.

3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ if !ENV['CIRCLECI']
gem "danger"
gem "danger-xcode_summary"
gem "cocoapods"
# fork by 'https://github.com/flix-tech/danger-code_style_validation.git'
# update the message level from fail to warn
gem 'danger-code_style_validation', :git => 'https://github.com/wrmswindmill/danger-code_style_validation.git'
YorkShen marked this conversation as resolved.
Show resolved Hide resolved
end
end
# gem "danger-prose"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,5 @@ public Class<? extends WXComponent> getComponentClass(String name, String classN
}
}

}
}
YorkShen marked this conversation as resolved.
Show resolved Hide resolved

21 changes: 2 additions & 19 deletions dangerfile-ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,22 +90,5 @@ if (!hasIosFile && danger.git.deleted_files) {
}

if(hasIosFile){
console.log('hasIosFile');
}
// console.log('-----------------------------hasIosFile-----------------------------:'+hasIosFile);
// if(hasIosFile){
// var runTestCmd='source ~/.bash_profile; '
// +'xcodebuild -project ios/sdk/WeexSDK.xcodeproj test '
// +'-scheme WeexSDKTests CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO '
// +'-destination "platform=iOS Simulator,name=iPhone 6"'
// runSuccess = shell.exec(runTestCmd,{ async: false, timeout: 8 * 60 * 1000, maxBuffer: 200 * 1024 * 1024 }).code == 0;
// if(!runSuccess){
// fail("ios platform run unit test failed!");
// }
// }else{
// console.log('has no ios file changed.');
// message('has no ios file changed.');
// }
// message('ios test finished.')


console.log('hasIosFile!!!');
YorkShen marked this conversation as resolved.
Show resolved Hide resolved
}
88 changes: 88 additions & 0 deletions dangerfile-static-check.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
/*
* 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.
*/
// Removed import
import fs from "fs";
import path from 'path';
import GitHubApi from 'github';
import parseDiff from 'parse-diff';
import shell from "shelljs";

const type_unknown = 0;
const type_c = 1;
const type_android = 2;

const getFileType = file => {
if (file.match(/.+\.(m|h|mm|cpp|cc)/)) {
return type_c;
} else if (file.match(/.+\.java/)) {
YorkShen marked this conversation as resolved.
Show resolved Hide resolved
return type_android;
} else {
return type_unknown;
}
}

var hasCFile = false;
var hasAndroidFile = false;

function check(file_type) {
var has_file_type = false;
if (!has_file_type && danger.git.created_files) {
danger.git.created_files.some(file => {
var f = (getFileType(file) == file_type)
if (f) {
has_file_type = f;
}
return f;
});
}

if (!has_file_type && danger.git.modified_files) {
danger.git.modified_files.some(file => {
var f = (getFileType(file) == file_type)
if (f) {
has_file_type = f;
}
return f;
});
}

if (!has_file_type && danger.git.deleted_files) {
danger.git.deleted_files.some(file => {
var f = (getFileType(file) == file_type)
if (f) {
has_file_type = f;
}
return f;
});
}

return has_file_type
}

hasCFile = check(type_c)
hasAndroidFile = check(type_android)

var output_str = ""
if (hasCFile) {
output_str += 'hasCFile\n'
}
if (hasAndroidFile) {
output_str += 'hasAndroidFile\n'
}
console.log(output_str)
1 change: 1 addition & 0 deletions ios/sdk/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*compile_commands.json
4 changes: 2 additions & 2 deletions ios/sdk/WeexSDK/Sources/Utility/WXVersion.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
#import "WXVersion.h"
#import "WXDefine.h"

static const char* WeexSDKBuildTime = "2019-07-16 07:08:34 UTC";
static const unsigned long WeexSDKBuildTimestamp = 1563260914;
static const char* WeexSDKBuildTime = "2019-07-21 09:08:41 UTC";
static const unsigned long WeexSDKBuildTimestamp = 1563700121;

NSString* GetWeexSDKVersion(void)
{
Expand Down