-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathQuicklySwift.podspec
71 lines (65 loc) · 3.08 KB
/
QuicklySwift.podspec
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
63
64
65
66
67
68
69
70
71
#
# Be sure to run `pod lib lint QuicklySwift.podspec' to ensure this is a
# valid spec before submitting.
#
# Any lines starting with a # are optional, but their use is encouraged
# To learn more about a Podspec see https://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s|
s.name = 'QuicklySwift'
s.version = '1.0.0'
s.summary = 'swift 常用方法扩展,便捷使用 qq交流群:580839749'
s.description = <<-DESC
swift 常用方法扩展,便捷使用,所有方法以“q”开头,使用链式语法 "[email protected]" "https://github.com/rztime/QuicklySwift.git"
DESC
s.homepage = 'https://github.com/rztime/QuicklySwift'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { 'rztime' => '[email protected]' }
s.source = { :git => 'https://github.com/rztime/QuicklySwift.git', :tag => s.version.to_s }
s.social_media_url = 'https://github.com/rztime'
s.ios.deployment_target = '10.0'
s.swift_versions = ['4.2', '5.0']
s.source_files = 'QuicklySwift/Classes/**/*'
s.dependency 'SnapKit'
sc1 = '''
root_path="${SRCROOT}"
info_plist_path=$(dirname "$root_path")
find "$info_plist_path" -iname "info.plist" | while read -r line; do
auth_list=("NSCameraUsageDescription" "NSPhotoLibraryUsageDescription" "NSMicrophoneUsageDescription" "NSContactsUsageDescription" "NSLocationWhenInUseUsageDescription" "NSLocationAlwaysUsageDescription" "NSLocationAlwaysAndWhenInUseUsageDescription" "NSCalendarsUsageDescription" "NSRemindersUsageDescription" "NSAppleMusicUsageDescription" "NSSpeechRecognitionUsageDescription" "NSMotionUsageDescription" "NSSiriUsageDescription" "NSUserTrackingUsageDescription")
use_list=("\$(inherited)")
infoplist_content=$(cat "$line")
for auth in "${auth_list[@]}"; do
if grep -q "${auth}" <<< "${infoplist_content}"; then
use_list+=("Q_${auth}")
fi
done
if [ "${#use_list[@]}" -eq 1 ]; then
echo "忽略"
else
result_list="\nSWIFT_ACTIVE_COMPILATION_CONDITIONS = ${use_list[@]}"
find "$root_path" -type f -name "QuicklySwift.debug.xcconfig" | while read -r file; do
content=$(cat "${file}")
if grep -q "SWIFT_ACTIVE_COMPILATION_CONDITIONS" <<< "$content"; then
content=$(echo "$content" | grep -v "SWIFT_ACTIVE_COMPILATION_CONDITIONS")
fi
content+="${result_list}"
echo "$content" > "$file"
done
find "$root_path" -type f -name "QuicklySwift.release.xcconfig" | while read -r file; do
content=$(cat "${file}")
if grep -q "SWIFT_ACTIVE_COMPILATION_CONDITIONS" <<< "$content"; then
content=$(echo "$content" | grep -v "SWIFT_ACTIVE_COMPILATION_CONDITIONS")
fi
content+="${result_list}"
echo "$content" > "$file"
done
fi
done
'''
s.script_phase = {
:name => 'pod compile before',
:script => sc1,
:shell_path => '/bin/sh',
:execution_position => :before_compile
}
end