Skip to content

Commit

Permalink
switch to vendored frameworks
Browse files Browse the repository at this point in the history
  • Loading branch information
Homayoun authored and Homayoun committed Jun 19, 2023
1 parent f499a48 commit fd30bd0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 20 deletions.
11 changes: 5 additions & 6 deletions FulaMobile.podspec → Fula.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'FulaMobile' # Name for your pod
s.version = '0.1.3'
s.name = 'Fula' # Name for your pod
s.version = '0.1.1'
s.summary = 'Go-fula for iOS'
s.homepage = 'https://github.com/functionland/go-fula'

Expand All @@ -10,11 +10,10 @@ Pod::Spec.new do |s|
s.platform = :ios
# change the source location
s.source = { :http => "https://github.com/functionland/go-fula/releases/download/cocoapods-bundle/cocoapods-bundle.zip" }
s.source_files = "Headers/*.{h}"
s.module_map = "Modules/module.modulemap"

s.ios.deployment_target = '13.0'
s.vendored_libraries = 'libfula.a'
s.vendored_framework = 'Fula.xcframework'
s.static_framework = true
s.user_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64' }
s.pod_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64' }
end
end
17 changes: 3 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ GO_MOD_REPLACEMENT=replace github.com/raulk/go-watchdog => ./tmp-fula-build/go-w
all:
go test ./...

fula-xcframework: patch-go-watchdog prepare-gomobile build-fula-xcframework build-bundle lipo zip
fula-xcframework: patch-go-watchdog prepare-gomobile build-fula-xcframework build-bundle zip
patch-go-watchdog:
mkdir -p tmp-fula-build &&\
cd tmp-fula-build &&\
Expand All @@ -24,22 +24,11 @@ build-fula-xcframework:
build-bundle:
mkdir -p build &&\
cp LICENSE ./build/LICENSE && cd build &&\
cp ../Fula.xcframework/ios-arm64/Fula.framework/Fula libfula_ios.a &&\
cp ../Fula.xcframework/ios-arm64_x86_64-simulator/Fula.framework/Fula libfula_iossimulator.a &&\
cp -r ../Fula.xcframework/ios-arm64/Fula.framework/Headers Headers &&\
cp -r ../Fula.xcframework/ios-arm64/Fula.framework/Modules Modules

lipo:
cd build && \
lipo libfula_iossimulator.a -remove arm64 -output libfula_iossimulator.a && \
lipo -create \
libfula_iossimulator.a \
libfula_ios.a \
-output libfula.a
mv ../Fula.xcframework .

zip:
cd build &&\
zip -r ./cocoapods-bundle.zip ./libfula.a ./Headers ./Modules && echo "$$(openssl dgst -sha256 ./cocoapods-bundle.zip)" > ./cocoapods-bundle.zip.sha256
zip -r ./cocoapods-bundle.zip ./Fula.xcframework ./LICENSE && echo "$$(openssl dgst -sha256 ./cocoapods-bundle.zip)" > ./cocoapods-bundle.zip.sha256

clean-up:
grep -v "$(GO_MOD_REPLACEMENT)" ./go.mod > ./tmp.mod ; mv ./tmp.mod ./go.mod &&\
Expand Down

0 comments on commit fd30bd0

Please sign in to comment.