From 79b272996b1b2ebd7d2bfb63e67af254de15059d Mon Sep 17 00:00:00 2001
From: Cam Saul <cam@Cams-iMac.local>
Date: Thu, 27 Jul 2017 17:21:27 -0700
Subject: [PATCH] Tweak Mac App build script for Xcode 8

---
 OSX/exportOptions.plist | 10 ++++++++++
 bin/osx-release         |  5 +++--
 2 files changed, 13 insertions(+), 2 deletions(-)
 create mode 100644 OSX/exportOptions.plist

diff --git a/OSX/exportOptions.plist b/OSX/exportOptions.plist
new file mode 100644
index 00000000000..df747cd00e9
--- /dev/null
+++ b/OSX/exportOptions.plist
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>method</key>
+	<string>developer-id</string>
+        <key>teamID</key>
+        <string>BR27ZJK7WW</string>
+</dict>
+</plist>
diff --git a/bin/osx-release b/bin/osx-release
index c6fe2c13bbe..16046a7e8ba 100755
--- a/bin/osx-release
+++ b/bin/osx-release
@@ -21,6 +21,7 @@ Readonly my $release_notes   => artifact('release-notes.html');
 Readonly my $dmg             => artifact('Metabase.dmg');
 
 Readonly my $xcode_project   => get_file_or_die('OSX/Metabase.xcodeproj');
+Readonly my $export_options  => get_file_or_die('OSX/exportOptions.plist');
 
 # Get the version saved in the CFBundle, e.g. '0.11.3.1'
 sub version {
@@ -82,9 +83,9 @@ sub build {
     # Ok, now create the Metabase.app artifact
     system('xcodebuild',
            '-exportArchive',
-           '-exportFormat', 'APP',
+           '-exportOptionsPlist', $export_options,
            '-archivePath', $xcarchive,
-           '-exportPath', $app) == 0 or die $!;
+           '-exportPath', OSX_ARTIFACTS_DIR) == 0 or die $!;
 
     # Ok, we can remove the .xcarchive file now
     remove_tree($xcarchive);
-- 
GitLab