Merge pull request #10 from wrmswindmill/master

Upload IOS Travis CI
diff --git a/.travis.yml b/.travis.yml
index 8938b03..be5cd8c 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -10,6 +10,8 @@
           components:
             - android-26
             - extra-android-m2repository
+      - env: TEST_SUITE=ios
+        language: objective-c
 cache:
   directories:
     - npm
@@ -43,6 +45,10 @@
         export PATH=$PATH:$ANDROID_NDK_HOME
         echo "ndk.dir=$ANDROID_NDK_HOME" > android/local.properties
         ;;
+      "ios")
+        npm install
+        cd ios && pod install --repo-update
+        ;;
     esac
 script:
   - |
@@ -55,6 +61,19 @@
           ./gradlew clean assembleRelease --info
         fi
         ;;
+      "ios")
+        echo "Pods/WeexSDK/weex_core/Source/core/common/view_utils.h"
+        cat ./Pods/WeexSDK/weex_core/Source/core/common/view_utils.h | while read line
+        do
+            echo $line
+        done
+
+        hasIosFile=$(npm run danger -- run --dangerfile ./dangerfile-ios.js)
+        echo "The value of hasIosFile is ${hasIosFile}"
+        if [[ "$hasIosFile" =~ "hasIosFile" ]]; then
+          xcodebuild -workspace WeexDemo.xcworkspace test -scheme WeexDemo CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO -destination "platform=iOS Simulator,name=iPhone 6"
+        fi
+        ;;
     esac
 notifications:
   webhooks:
diff --git a/dangerfile-ios.js b/dangerfile-ios.js
new file mode 100644
index 0000000..e6aa37c
--- /dev/null
+++ b/dangerfile-ios.js
@@ -0,0 +1,58 @@
+/*
+ * 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.
+ */
+import { schedule, danger, fail, warn, message, markdown } from "danger";
+
+function checkIosFile(file){
+  return file.match(/ios\//)?true:false;
+}
+
+var hasIosFile = false;
+
+if (!hasIosFile && danger.git.created_files) {
+  danger.git.created_files.some(file => {
+    var f = checkIosFile(file);
+    if(f){
+      hasIosFile =f;
+    }
+    return f;
+  });
+}
+if (!hasIosFile && danger.git.modified_files) {
+  danger.git.modified_files.some(file => {
+    var f = checkIosFile(file);
+    if(f){
+      hasIosFile =f;
+    }
+    return f;
+  });
+}
+if (!hasIosFile && danger.git.deleted_files) {
+  danger.git.deleted_files.some(file => {
+    var f = checkIosFile(file);
+    if(f){
+      hasIosFile =f;
+    }
+    return f;
+  });
+}
+
+if(hasIosFile){
+  console.log('hasIosFile');
+}
+
diff --git a/ios/Podfile b/ios/Podfile
index ddb2dae..46e047b 100644
--- a/ios/Podfile
+++ b/ios/Podfile
@@ -2,14 +2,15 @@
 platform :ios, '9.0'
 #inhibit_all_warnings!
 
-def common
+
+def common   
     # check if weex-playground is a submodule
     if File.file?('../../.gitmodules') && File.readlines('../../.gitmodules').grep(/submodule \"weex-playground\"/).size > 0
     	pod 'WeexSDK', :path => '../../'
     else
-        pod 'WeexSDK', :git => 'https://github.com/apache/incubator-weex.git'    
+        pod 'WeexSDK', :git => 'https://github.com/apache/incubator-weex.git'
     end
-    
+
     pod 'WXDevtool','0.20.0'
     pod 'SDWebImage', '3.7.5'
     pod 'SDWebImage/WebP'
diff --git a/ios/Podfile.lock b/ios/Podfile.lock
deleted file mode 100644
index 5c61918..0000000
--- a/ios/Podfile.lock
+++ /dev/null
@@ -1,84 +0,0 @@
-PODS:
-  - ATSDK-Weex (0.0.1)
-  - BindingX (1.0.3):
-    - WeexPluginLoader
-    - WeexSDK
-  - libwebp (1.0.2):
-    - libwebp/core (= 1.0.2)
-    - libwebp/dec (= 1.0.2)
-    - libwebp/demux (= 1.0.2)
-    - libwebp/dsp (= 1.0.2)
-    - libwebp/enc (= 1.0.2)
-    - libwebp/mux (= 1.0.2)
-    - libwebp/utils (= 1.0.2)
-    - libwebp/webp (= 1.0.2)
-  - libwebp/core (1.0.2):
-    - libwebp/webp
-  - libwebp/dec (1.0.2):
-    - libwebp/core
-  - libwebp/demux (1.0.2):
-    - libwebp/core
-  - libwebp/dsp (1.0.2):
-    - libwebp/core
-  - libwebp/enc (1.0.2):
-    - libwebp/core
-  - libwebp/mux (1.0.2):
-    - libwebp/core
-  - libwebp/utils (1.0.2):
-    - libwebp/core
-  - libwebp/webp (1.0.2)
-  - SDWebImage (3.7.5):
-    - SDWebImage/Core (= 3.7.5)
-  - SDWebImage/Core (3.7.5)
-  - SDWebImage/WebP (3.7.5):
-    - libwebp
-    - SDWebImage/Core
-  - SocketRocket (0.4.2)
-  - WeexPluginLoader (0.0.1.9.1):
-    - WeexSDK
-  - WeexSDK (0.24.0)
-  - WXDevtool (0.20.0):
-    - SocketRocket
-    - WeexSDK
-
-DEPENDENCIES:
-  - ATSDK-Weex (= 0.0.1)
-  - BindingX (= 1.0.3)
-  - SDWebImage (= 3.7.5)
-  - SDWebImage/WebP
-  - SocketRocket (= 0.4.2)
-  - WeexSDK (from `https://github.com/apache/incubator-weex.git`)
-  - WXDevtool (= 0.20.0)
-
-SPEC REPOS:
-  https://github.com/cocoapods/specs.git:
-    - ATSDK-Weex
-    - BindingX
-    - libwebp
-    - SDWebImage
-    - SocketRocket
-    - WeexPluginLoader
-    - WXDevtool
-
-EXTERNAL SOURCES:
-  WeexSDK:
-    :git: https://github.com/apache/incubator-weex.git
-
-CHECKOUT OPTIONS:
-  WeexSDK:
-    :commit: 159ccdc2f80baea89c559d547b857dacf2203000
-    :git: https://github.com/apache/incubator-weex.git
-
-SPEC CHECKSUMS:
-  ATSDK-Weex: 1b27558f4336d77fb97704d34fc6ad1fd468592c
-  BindingX: b3c6c1c5dcd8e50277cfc5daad09d7010c227524
-  libwebp: b068a3bd7c45f7460f6715be7bed1a18fd5d6b48
-  SDWebImage: 69c6303e3348fba97e03f65d65d4fbc26740f461
-  SocketRocket: ffe08119b00ef982f6c37052a4705a057c8494ad
-  WeexPluginLoader: 85c1304f8ba29864e58531614a0acfeceef1b85c
-  WeexSDK: b04beeb0cf562a1467a943a2002f3e4e018ba55b
-  WXDevtool: 833dd3e835df1f5f278fc8865c865d48196bfdab
-
-PODFILE CHECKSUM: b30fb7b0bff70242f50cb3c7f45ac09caf08f211
-
-COCOAPODS: 1.7.3
diff --git a/ios/WeexDemo.xcworkspace/xcuserdata/wangrenmin.xcuserdatad/UserInterfaceState.xcuserstate b/ios/WeexDemo.xcworkspace/xcuserdata/wangrenmin.xcuserdatad/UserInterfaceState.xcuserstate
new file mode 100644
index 0000000..02931d2
--- /dev/null
+++ b/ios/WeexDemo.xcworkspace/xcuserdata/wangrenmin.xcuserdatad/UserInterfaceState.xcuserstate
Binary files differ
diff --git a/ios/WeexDemo/extend/component/WXSelectComponent.h b/ios/WeexDemo/extend/component/WXSelectComponent.h
index a50bd5b..f9a4776 100644
--- a/ios/WeexDemo/extend/component/WXSelectComponent.h
+++ b/ios/WeexDemo/extend/component/WXSelectComponent.h
@@ -23,3 +23,4 @@
 @interface WXSelectComponent : WXComponent <UIPickerViewDataSource, UIPickerViewDelegate>
 
 @end
+