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

Commit

Permalink
test android code format
Browse files Browse the repository at this point in the history
  • Loading branch information
wrmswindmill committed Jul 21, 2019
1 parent 0adc403 commit ca1573b
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 40 deletions.
62 changes: 34 additions & 28 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,32 @@ matrix:
include:
- env: TEST_SUITE=danger
- env: TEST_SUITE=jsfm
- env: TEST_SUITE=ios
language: objective-c
- env: TEST_SUITE=android ABI=armeabi-v7a
language: android
dist: trusty
jdk: oraclejdk8
android:
components:
- android-26
- extra-android-m2repository
- env: TEST_SUITE=android ABI=arm64-v8a
language: android
dist: trusty
jdk: oraclejdk8
android:
components:
- android-26
- extra-android-m2repository
- env: TEST_SUITE=android ABI=x86
language: android
dist: trusty
jdk: oraclejdk8
android:
components:
- android-26
- extra-android-m2repository
# - env: TEST_SUITE=ios
# language: objective-c
# - env: TEST_SUITE=android ABI=armeabi-v7a
# language: android
# dist: trusty
# jdk: oraclejdk8
# android:
# components:
# - android-26
# - extra-android-m2repository
# - env: TEST_SUITE=android ABI=arm64-v8a
# language: android
# dist: trusty
# jdk: oraclejdk8
# android:
# components:
# - 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
Expand Down Expand Up @@ -90,6 +90,7 @@ install:
elif [[ ("$TEST_SUITE" = "jsfm") || ("$TEST_SUITE" = "danger") || ("${CHECK_C}" = "true") ]]; then
npm install
elif [[ ("$TEST_SUITE" = "ios") ]]; then
bash weex-playground/ios/update_podfile_for_travisci.sh
npm install
cd weex-playground/ios && pod install --repo-update
cd ../../
Expand Down Expand Up @@ -133,9 +134,9 @@ script:
echo "The value of hasIosFile is ${hasIosFile}"
if [[ "$hasIosFile" =~ "hasIosFile" ]]; then
# 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"
xcodebuild -project ios/sdk/WeexSDK.xcodeproj test -scheme WeexSDKTests CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO -destination "platform=iOS Simulator,name=iPhone 6" | egrep -A 5 "(error|warning)
# build WeexDemo and run WeexDemo test
xcodebuild -workspace weex-playground/ios/WeexDemo.xcworkspace test -scheme WeexDemo CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO -destination "platform=iOS Simulator,name=iPhone 6" | grep -A 5 error
xcodebuild -workspace weex-playground/ios/WeexDemo.xcworkspace test -scheme WeexDemo CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO -destination "platform=iOS Simulator,name=iPhone 6" | egrep -A 5 "(error|warning)
fi
;;
esac
Expand Down Expand Up @@ -168,6 +169,11 @@ script:
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"
cd android
./gradlew clean assembleDebug test lint
Expand Down
10 changes: 1 addition & 9 deletions dangerfile-static-check.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,19 @@ import shell from "shelljs";
const type_unknown = 0;
const type_c = 1;
const type_android = 2;
const type_js = 3;

const getFileType = file => {
if (file.match(/.+\.(m|h|mm|cpp|cc)/)) {
return type_c;
} else if (file.match(/.+\.java/)) {
return type_android;
} else if (file.match(/.+\.js/)) {
return type_js;
}else{
return type_unknown;
}
}

var hasCFile = false;
var hasAndroidFile = false;
var hasJsFile = false;

function check(file_type){
var has_file_type = false;
Expand Down Expand Up @@ -81,7 +77,6 @@ function check(file_type){

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

var output_str = ""
if(hasCFile){
Expand All @@ -90,7 +85,4 @@ if(hasCFile){
if(hasAndroidFile){
output_str += 'hasAndroidFile\n'
}
if(hasJsFile){
output_str += 'hasJsFile\n'
}
console.log(output_str)
console.log(output_str)
Binary file added format-tool/google-java-format-1.7-all-deps.jar
Binary file not shown.
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-19 00:54:45 UTC";
static const unsigned long WeexSDKBuildTimestamp = 1563497685;
static const char* WeexSDKBuildTime = "2019-07-21 09:08:41 UTC";
static const unsigned long WeexSDKBuildTimestamp = 1563700121;

NSString* GetWeexSDKVersion(void)
{
Expand Down

0 comments on commit ca1573b

Please sign in to comment.