refactor: [ios framework] change dylib to framework

This commit is contained in:
Gus 2020-12-21 12:41:03 -05:00
parent 6f70f80907
commit e687a86e17
9 changed files with 59 additions and 26 deletions

View File

@ -1,4 +1,4 @@
platform :ios, '11.0'
platform :ios, '11.1'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
def add_flipper_pods!

View File

@ -30,6 +30,7 @@
31C15CFB9EF7CBD68C660F2A /* libPods-TorExample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-TorExample.a"; sourceTree = BUILT_PRODUCTS_DIR; };
4D7192F03A36A017E887435B /* Pods-TorExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TorExample.release.xcconfig"; path = "Target Support Files/Pods-TorExample/Pods-TorExample.release.xcconfig"; sourceTree = "<group>"; };
85A481D925692C9D00942D45 /* TorExample.profdata */ = {isa = PBXFileReference; lastKnownFileType = file; path = TorExample.profdata; sourceTree = "<group>"; };
85C8E5052590FB1800701A4C /* libsifir_ios.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = libsifir_ios.framework; path = ../../ios/library/universal/libsifir_ios.framework; sourceTree = "<group>"; };
871719007ECC5EAD276C345C /* Pods-TorExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TorExample.debug.xcconfig"; path = "Target Support Files/Pods-TorExample/Pods-TorExample.debug.xcconfig"; sourceTree = "<group>"; };
ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
/* End PBXFileReference section */
@ -72,6 +73,7 @@
2D16E6871FA4F8E400B85C8A /* Frameworks */ = {
isa = PBXGroup;
children = (
85C8E5052590FB1800701A4C /* libsifir_ios.framework */,
ED297162215061F000B7C4FE /* JavaScriptCore.framework */,
31C15CFB9EF7CBD68C660F2A /* libPods-TorExample.a */,
);
@ -132,7 +134,7 @@
13B07F8C1A680F5B00A75B9A /* Frameworks */,
13B07F8E1A680F5B00A75B9A /* Resources */,
00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */,
897C7EC8BEB56E007D60842C /* [CP] Embed Pods Frameworks */,
F7B61BE004B04AA11CD603C2 /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
@ -204,24 +206,6 @@
shellPath = /bin/sh;
shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh\n";
};
897C7EC8BEB56E007D60842C /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-TorExample/Pods-TorExample-frameworks.sh",
"${PODS_ROOT}/../../../ios/library/universal/libsifir_ios.dylib",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/libsifir_ios.dylib",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-TorExample/Pods-TorExample-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
CCCC07BCAFDEF1FCADC0D0C9 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
@ -244,6 +228,24 @@
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
F7B61BE004B04AA11CD603C2 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-TorExample/Pods-TorExample-frameworks.sh",
"${PODS_ROOT}/../../../ios/Libsifir_ios.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Libsifir_ios.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-TorExample/Pods-TorExample-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
FD10A7F022414F080027D42C /* Start Packager */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
@ -304,7 +306,7 @@
ENABLE_BITCODE = NO;
GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = TorExample/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.1;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
OTHER_CFLAGS = (
"$(inherited)",
@ -336,7 +338,7 @@
ENABLE_BITCODE = NO;
GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = TorExample/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.1;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
OTHER_CFLAGS = (
"$(inherited)",
@ -401,7 +403,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.1;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
@ -447,7 +449,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.1;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
VALIDATE_PRODUCT = YES;

View File

@ -0,0 +1,5 @@
framework module "Libsifir_ios" {
header "Libsifir_ios.h"
export *
}

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>Libsifir_ios</string>
<key>CFBundleIdentifier</key>
<string>sifirapps.sdk.tor</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>Libsifir_Tor</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>0.1.1</string>
</dict>
</plist>

View File

@ -1 +1,2 @@
#import "React/RCTBridgeModule.h"
#import "Libsifir_ios/Libsifir_ios.h"

View File

@ -235,6 +235,7 @@
"$(SRCROOT)/../../../React/**",
"$(SRCROOT)/../../react-native/React/**",
);
IPHONEOS_DEPLOYMENT_TARGET = 11.1;
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)",
@ -259,6 +260,7 @@
"$(SRCROOT)/../../../React/**",
"$(SRCROOT)/../../react-native/React/**",
);
IPHONEOS_DEPLOYMENT_TARGET = 11.1;
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)",

View File

@ -14,7 +14,8 @@ Pod::Spec.new do |s|
s.source = { :git => "https://github.com/Sifir-io/react-native-tor.git", :tag => "#{s.version}" }
s.swift_version = '5.0'
s.source_files = "ios/**/*.{h,m,mm,swift}"
s.ios.vendored_libraries= ["ios/library/universal/libsifir_ios.dylib"]
s.source_files = "ios/*.{h,m,mm,swift}"
# s.source_files = "ios/**/*.{swift}"
s.ios.vendored_frameworks= "ios/Libsifir_ios.framework"
s.dependency "React"
end