Bgerstle has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/214089

Change subject: set UIFileSharingEnabled based on build config
......................................................................

set UIFileSharingEnabled based on build config

Writes to the app's Info.plist after build to enable iTunes file
sharing.

- Debug, Alpha, & Beta: enable iTunes file sharing
  - This will allow alpha & beta testers to easily import/export data
- Release
  - If WMF_FORCE_ITUNES_FILE_SHARING env var is "1", enabled (used for
    TSG builds)
  - Otherwise, disabled

Change-Id: Ia3a0b30a8a876d089cad1772d18eac94136bfe12
---
M Gemfile
M Gemfile.lock
M Makefile
M Wikipedia.xcodeproj/project.pbxproj
M Wikipedia/Wikipedia-Info.plist
M fastlane/Appfile
M fastlane/Fastfile
A scripts/process_plist.sh
8 files changed, 82 insertions(+), 46 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia 
refs/changes/89/214089/1

diff --git a/Gemfile b/Gemfile
index 23be19d..b5ff0b2 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,5 +1,5 @@
 source "https://rubygems.org";
 
 gem 'cocoapods', '~> 0.36.1'
-gem 'fastlane', '~> 1.0.2'
+gem 'fastlane', '~> 1.3.1'
 gem 'git', '~> 1.2'
diff --git a/Gemfile.lock b/Gemfile.lock
index b88636f..e5480e0 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -20,7 +20,7 @@
       rack (>= 1.0.0)
       rack-test (>= 0.5.4)
       xpath (~> 2.0)
-    cert (0.2.0)
+    cert (0.2.1)
       fastlane_core (>= 0.7.2)
     certified (1.0.0)
     claide (0.8.1)
@@ -53,11 +53,11 @@
     colored (1.2)
     commander (4.3.4)
       highline (~> 1.7.2)
-    credentials_manager (0.4.0)
+    credentials_manager (0.6.0)
       colored
       highline (>= 1.7.1)
       security
-    cupertino (1.3.3)
+    cupertino (1.3.4)
       certified (~> 1.0.0)
       commander (~> 4.3)
       highline (>= 1.7.1)
@@ -66,14 +66,13 @@
       security (~> 0.1.2)
       term-ansicolor (~> 1.0.7)
       terminal-table (~> 1.4.5)
-    deliver (0.9.4)
+    deliver (0.12.0)
       credentials_manager (>= 0.3.0)
       excon
       fastimage (~> 1.6.3)
-      fastlane_core (>= 0.5.2)
+      fastlane_core (>= 0.7.2)
       nokogiri (~> 1.6.5)
       plist (~> 3.1.0)
-      prawn
       rubyzip (~> 1.1.6)
     domain_name (0.5.24)
       unf (>= 0.0.5, < 1.0.0)
@@ -86,40 +85,41 @@
       faraday (>= 0.7.4, < 0.10)
     fastimage (1.6.8)
       addressable (~> 2.3, >= 2.3.5)
-    fastlane (1.0.2)
+    fastlane (1.3.1)
       aws-sdk (~> 1.0)
-      cert (>= 0.2.0)
+      cert (>= 0.2.1)
       cupertino (>= 1.3.3)
-      deliver (>= 0.9.4)
-      fastlane_core (>= 0.7.2)
-      frameit (>= 1.0.1)
+      deliver (>= 0.11.0)
+      fastlane_core (>= 0.7.5)
+      frameit (>= 2.0.0)
       krausefx-shenzhen (= 0.14.2)
       nokogiri (~> 1.6)
-      pem (>= 0.5.5)
+      pbxplorer (~> 1.0.0)
+      pem (>= 0.6.1)
       produce (>= 0.2.1)
-      sigh (>= 0.5.1)
+      sigh (>= 0.5.2)
       slack-notifier (~> 1.0)
-      snapshot (>= 0.8.0)
+      snapshot (>= 0.9.0)
       terminal-notifier (~> 1.6.2)
       terminal-table (~> 1.4.5)
       xcodeproj (~> 0.20)
       xcpretty (~> 0.1)
-    fastlane_core (0.7.2)
+    fastlane_core (0.7.5)
       babosa
       capybara (~> 2.4.3)
       colored
       commander (>= 4.3.4)
-      credentials_manager (>= 0.4.0)
+      credentials_manager (>= 0.6.0)
       excon (~> 0.45.0)
       highline (>= 1.7.2)
       json
       multi_json
       phantomjs (~> 1.9.8)
       poltergeist (~> 1.5.1)
-    frameit (1.0.1)
+    frameit (2.0.1)
       deliver (> 0.3)
       fastimage (~> 1.6.3)
-      fastlane_core (>= 0.5.0)
+      fastlane_core (>= 0.7.2)
       mini_magick (~> 4.0.2)
     fuzzy_match (2.0.4)
     git (1.2.9.1)
@@ -165,9 +165,9 @@
       mini_portile (~> 0.6.0)
     ntlm-http (0.1.1)
     open4 (1.3.4)
-    pdf-core (0.5.1)
-    pem (0.5.5)
-      fastlane_core (>= 0.6.0)
+    pbxplorer (1.0.0)
+    pem (0.6.3)
+      fastlane_core (>= 0.7.2)
     phantomjs (1.9.8.0)
     plist (3.1.0)
     poltergeist (1.5.1)
@@ -175,9 +175,6 @@
       cliver (~> 0.3.1)
       multi_json (~> 1.0)
       websocket-driver (>= 0.2.0)
-    prawn (2.0.1)
-      pdf-core (~> 0.5.1)
-      ttfunk (~> 1.4.0)
     produce (0.2.1)
       fastlane_core (>= 0.5.0)
     rack (1.6.1)
@@ -185,18 +182,17 @@
       rack (>= 1.0)
     rubyzip (1.1.7)
     security (0.1.3)
-    sigh (0.5.1)
+    sigh (0.5.2)
       fastlane_core (>= 0.7.2)
       plist (~> 3.1.0)
-    slack-notifier (1.2.0)
-    snapshot (0.8.0)
+    slack-notifier (1.2.1)
+    snapshot (0.9.0)
       fastimage (~> 1.6.3)
-      fastlane_core (>= 0.5.0)
+      fastlane_core (>= 0.7.2)
     term-ansicolor (1.0.7)
     terminal-notifier (1.6.3)
     terminal-table (1.4.5)
     thread_safe (0.3.5)
-    ttfunk (1.4.0)
     tzinfo (1.2.2)
       thread_safe (~> 0.1)
     unf (0.1.4)
@@ -218,5 +214,5 @@
 
 DEPENDENCIES
   cocoapods (~> 0.36.1)
-  fastlane (~> 1.0.2)
+  fastlane (~> 1.3.1)
   git (~> 1.2)
diff --git a/Makefile b/Makefile
index 48f30fd..8a20fb4 100644
--- a/Makefile
+++ b/Makefile
@@ -163,7 +163,6 @@
 
 bundle-install: ##Install gems using Bundler
 bundle-install: bundler-check
-       @$(BUNDLER) config build.nokogiri --use-system-libraries
        @$(BUNDLER) install
 
 bundler-check: ##Make sure Bundler is installed
diff --git a/Wikipedia.xcodeproj/project.pbxproj 
b/Wikipedia.xcodeproj/project.pbxproj
index d970fb4..bb13928 100644
--- a/Wikipedia.xcodeproj/project.pbxproj
+++ b/Wikipedia.xcodeproj/project.pbxproj
@@ -2556,6 +2556,7 @@
                                D4991433181D51DE00E6073C /* Resources */,
                                04E0C2771A7750AB00FE22DA /* 
copy-wmflogo-to-assets */,
                                45FA417DEEAE18B42A662320 /* Copy Pods Resources 
*/,
+                               BC44DB9E1B161839008FCD0C /* Modify App 
Info.plist */,
                        );
                        buildRules = (
                        );
@@ -2833,6 +2834,20 @@
                        shellPath = /bin/sh;
                        shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" 
\"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n    cat << 
EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' 
or update your CocoaPods installation.\nEOM\n    exit 1\nfi\n";
                };
+               BC44DB9E1B161839008FCD0C /* Modify App Info.plist */ = {
+                       isa = PBXShellScriptBuildPhase;
+                       buildActionMask = 2147483647;
+                       files = (
+                       );
+                       inputPaths = (
+                       );
+                       name = "Modify App Info.plist";
+                       outputPaths = (
+                       );
+                       runOnlyForDeploymentPostprocessing = 0;
+                       shellPath = /bin/sh;
+                       shellScript = ./scripts/process_plist.sh;
+               };
                D4C16A621970946900CD91AD /* update-storyboard-strings */ = {
                        isa = PBXShellScriptBuildPhase;
                        buildActionMask = 2147483647;
diff --git a/Wikipedia/Wikipedia-Info.plist b/Wikipedia/Wikipedia-Info.plist
index c24780c..95d40d6 100644
--- a/Wikipedia/Wikipedia-Info.plist
+++ b/Wikipedia/Wikipedia-Info.plist
@@ -30,6 +30,8 @@
        <array>
                <string>WikiFont-Glyphs.ttf</string>
        </array>
+       <key>UIFileSharingEnabled</key>
+       <true/>
        <key>UIPrerenderedIcon</key>
        <true/>
        <key>UIRequiredDeviceCapabilities</key>
diff --git a/fastlane/Appfile b/fastlane/Appfile
index 708047e..d361e8a 100644
--- a/fastlane/Appfile
+++ b/fastlane/Appfile
@@ -3,18 +3,21 @@
 team_id "AKK7J2GV64"
 team_name "Wikimedia Foundation"
 
-for_lane 'ios alpha' do
-  app_identifier "org.wikimedia.wikipedia.tfalpha"
+for_platform :ios do
+  for_lane :alpha do
+    app_identifier "org.wikimedia.wikipedia.tfalpha"
+  end
+
+  for_lane :beta do
+    app_identifier "org.wikimedia.wikipedia.tfbeta"
+  end
+
+  for_lane :rc do
+    app_identifier "org.wikimedia.wikipedia"
+  end
+
+  for_lane :store do
+    app_identifier "org.wikimedia.wikipedia"
+  end
 end
 
-for_lane 'ios beta' do
-  app_identifier "org.wikimedia.wikipedia.tfbeta"
-end
-
-for_lane 'ios rc' do
-  app_identifier "org.wikimedia.wikipedia"
-end
-
-for_lane 'ios store' do
-  app_identifier "org.wikimedia.wikipedia"
-end
diff --git a/fastlane/Fastfile b/fastlane/Fastfile
index bbc6430..0bf2195 100644
--- a/fastlane/Fastfile
+++ b/fastlane/Fastfile
@@ -5,7 +5,7 @@
 $:.unshift File.dirname(__FILE__)
 require 'lib/utils.rb'
 
-fastlane_version "1.0.0"
+fastlane_version "1.3"
 
 default_platform :ios
 
@@ -95,6 +95,8 @@
       force: true,
       filename: 'build/adhoc.mobileprovision'
     )
+    # force iTunes file sharing to be enabled (normally disabled for release 
builds)
+    ENV['WMF_FORCE_ITUNES_FILE_SHARING']='1'
     ipa(
       configuration: "Wikipedia",
       scheme: "Wikipedia",
diff --git a/scripts/process_plist.sh b/scripts/process_plist.sh
new file mode 100755
index 0000000..7e547e3
--- /dev/null
+++ b/scripts/process_plist.sh
@@ -0,0 +1,19 @@
+#! /bin/sh
+# Update Info.plist in the app bundlebased on current build configuration.
+# This script should only be at the end of a build to ensure:
+#   - The .app folder exists
+#   - the plist has been preprocessed
+# Processing is done inside the .app to prevent changes to repository status
+
+declare -r 
INFO_PLIST="${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Info.plist"
+
+# Fail if any subsequent commands fail
+set -e
+
+if [[ "${CONFIGURATION}" == "Release" && $WMF_FORCE_ITUNES_FILE_SHARING != "1" 
]]; then
+  echo "Disabling iTunes File Sharing for App Store build."
+  defaults write "${INFO_PLIST}" UIFileSharingEnabled false
+else
+  echo "Enabling iTunes File Sharing for ${CONFIGURATION} build."
+  defaults write "${INFO_PLIST}" UIFileSharingEnabled true
+fi

-- 
To view, visit https://gerrit.wikimedia.org/r/214089
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia3a0b30a8a876d089cad1772d18eac94136bfe12
Gerrit-PatchSet: 1
Gerrit-Project: apps/ios/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Bgerstle <bgers...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to