Uh oh!
There was an error while loading. Please reload this page.
forked from SwiftyLab/MetaCodable
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMetaCodableMacro.podspec
More file actions
Latest commit
37 lines (33 loc) · 1.86 KB
/
Copy pathMetaCodableMacro.podspec
File metadata and controls
37 lines (33 loc) · 1.86 KB
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
Pod::Spec.newdo |s|
require_relative'Utils/spec'
s.extendMetaCodable::Spec
s.module_name="MetaCodable"
s.define
sources_dir='Sources'
plugin_module='MacroPlugin'
manifest_file='Package*.swift'
plugin_core='PluginCore'
script_path='Utils/macro_plugin_build.rb'
preserved_sources="{#{manifest_file},#{sources_dir}/{#{plugin_module},#{plugin_core}}/**/*.swift,#{script_path}}"
inputs=Dir.glob(preserved_sources).map{ |path| "$(PODS_TARGET_SRCROOT)/#{path}"}
build_path="${PODS_BUILD_DIR}/Macros/#{plugin_module}"
plugin_path="#{build_path}/${CONFIGURATION}/#{plugin_module}##{plugin_module}"
plugin_output="$(PODS_BUILD_DIR)/Macros/#{plugin_module}/$(CONFIGURATION)/#{plugin_module}"
script=<<-SCRIPT
echo "env -i DEVELOPER_DIR=\\"$DEVELOPER_DIR\\" PATH=\\"$PATH\\" SRCROOT=\\"$PODS_TARGET_SRCROOT\\" BUILD_DIR=\\"$PODS_BUILD_DIR\\" TOOLCHAIN=\\"$DT_TOOLCHAIN_DIR\\" CONFIGURATION=\\"$CONFIGURATION\\" $METACODABLE_PLUGIN_BUILD_ENVIRONMENT \\"${PODS_TARGET_SRCROOT}/#{script_path}\\""
env -i DEVELOPER_DIR="$DEVELOPER_DIR" PATH="$PATH" SRCROOT="$PODS_TARGET_SRCROOT" BUILD_DIR="$PODS_BUILD_DIR" TOOLCHAIN="$DT_TOOLCHAIN_DIR" CONFIGURATION="$CONFIGURATION" $METACODABLE_PLUGIN_BUILD_ENVIRONMENT "${PODS_TARGET_SRCROOT}/#{script_path}"
SCRIPT
s.preserve_paths="*.md","LICENSE",manifest_file,"#{sources_dir}/{#{plugin_module},#{plugin_core}}",script_path
s.script_phase={
:name=>'Build MetaCodable macro plugin',
:script=>script,
:input_files=>inputs,:output_files=>[plugin_output],
:execution_position=>:before_compile
}
xcconfig={
'OTHER_SWIFT_FLAGS'=>"-Xfrontend -load-plugin-executable -Xfrontend #{plugin_path}",
'METACODABLE_PLUGIN_BUILD_ENVIRONMENT'=>'METACODABLE_BEING_USED_FROM_COCOAPODS=true'
}
s.user_target_xcconfig=xcconfig
s.pod_target_xcconfig=xcconfig
end