Skip to content

Commit

Permalink
Pull CocoaPods config out into separate Package.swift, part 3
Browse files Browse the repository at this point in the history
  • Loading branch information
dfed committed Jan 3, 2025
1 parent 9a29f1b commit a93266d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion CocoaPods/Package.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// swift-tools-version: 6.0
// The swift-tools-version declares the minimum version of Swift required to build this package.

import CompilerPluginSupport
import PackageDescription

let package = Package(
Expand Down
4 changes: 2 additions & 2 deletions SafeDI.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ Pod::Spec.new do |s|
s.visionos.deployment_target = '1.0'

s.source_files = 'Sources/SafeDI/**/*.{swift}'
s.preserve_paths = 'CocoaPods/', 'Sources/SafeDIMacros'
s.preserve_paths = 'CocoaPods/', 'Sources/SafeDIMacros', 'Sources/SafeDICore'

# The below scripts and flags were inspired by https://soumyamahunt.medium.com/support-swift-macros-with-cocoapods-3911f9317042
script = <<-SCRIPT.squish
env -i PATH="$PATH" "$SHELL" -l -c
"swift build --package-path CocoaPods -c $(echo ${CONFIGURATION} | tr '[:upper:]' '[:lower:]') --product SafeDIMacros
--sdk \\"`xcrun --show-sdk-path`\\"
--package-path \\"$PODS_TARGET_SRCROOT\\"
--package-path \\"${PODS_TARGET_SRCROOT}/CocoaPods\\"
--scratch-path \\"${PODS_BUILD_DIR}/Macros/SafeDIMacros\\""
SCRIPT

Expand Down

0 comments on commit a93266d

Please sign in to comment.