forked from ParisiLabs/wire-ios
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcopyFrameworks
executable file
·62 lines (53 loc) · 2.24 KB
/
copyFrameworks
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash
#
# Wire
# Copyright (C) 2016 Wire Swiss GmbH
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
#
copy_framework ()
{
local framework=$1
local frameworks_folder="${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
local name=`basename $framework`
mkdir -p "${frameworks_folder}"
# Use ditto to thin Universal binaries to the valid architecture
#echo "note: Using ${VALID_ARCHS}"
for w in $VALID_ARCHS ; do echo "--arch"; echo $w; done | xargs -J % ditto -v % "$framework" "${frameworks_folder}/${name}"
local framework_path="${frameworks_folder}/${name}"
local file_path="$framework_path/`basename $framework .framework`"
echo "note: CODE_SIGNING_REQUIRED=${CODE_SIGNING_REQUIRED}"
if [[ "$CODE_SIGNING_REQUIRED" == "YES" ]];
then
codesign --force --sign "$EXPANDED_CODE_SIGN_IDENTITY" --preserve-metadata=identifier,entitlements,resource-rules "$framework_path"
fi
}
echo $BUILT_PRODUCTS_DIR
echo $CODE_SIGN_IDENTITY
S3_ZMESSAGING_ROOT="${BUILT_PRODUCTS_DIR}/zmessaging/zmessaging.xcarchive/Products/Library/Frameworks"
LOCAL_ZMESSAGING_ROOT="${BUILT_PRODUCTS_DIR}"
FRAMEWORK_NAMES=( "zmessaging.framework" "SyncEngineSystem.framework" )
for name in "${FRAMEWORK_NAMES[@]}"
do
LOCAL_FRAMEWORK_PATH="${LOCAL_ZMESSAGING_ROOT}/${name}"
S3_FRAMEWORK_PATH="${S3_ZMESSAGING_ROOT}/${name}"
#echo "note: LOCAL_FRAMEWORK_PATH=${LOCAL_FRAMEWORK_PATH}"
#echo "note: S3_FRAMEWORK_PATH=${S3_FRAMEWORK_PATH}"
if [ -e "${LOCAL_FRAMEWORK_PATH}" ] ; then
echo "note: Using local ${name}"
copy_framework "${LOCAL_FRAMEWORK_PATH}"
else
copy_framework "${S3_FRAMEWORK_PATH}"
fi
done