From f710864ca34fcabc33a0aaa45dc9ed7b54f9f8b5 Mon Sep 17 00:00:00 2001 From: Andy Boedo Date: Mon, 24 Aug 2020 20:07:51 -0300 Subject: [PATCH 1/2] made PurchasesCoreSwift a static library, added -all_load linker flag to Purchases, added dummy Swift file to Purchases --- Purchases.swift | 9 +++++++++ Purchases.xcodeproj/project.pbxproj | 16 ++++++++++++---- 2 files changed, 21 insertions(+), 4 deletions(-) create mode 100644 Purchases.swift diff --git a/Purchases.swift b/Purchases.swift new file mode 100644 index 0000000000..646a4b6a65 --- /dev/null +++ b/Purchases.swift @@ -0,0 +1,9 @@ +// +// Purchases.swift +// Purchases +// +// Created by Andrés Boedo on 8/24/20. +// Copyright © 2020 Purchases. All rights reserved. +// + +import Foundation diff --git a/Purchases.xcodeproj/project.pbxproj b/Purchases.xcodeproj/project.pbxproj index 0853f18c1a..3c0c22972b 100644 --- a/Purchases.xcodeproj/project.pbxproj +++ b/Purchases.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + 2D4C18A924F47E5000F268CD /* Purchases.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2D4C18A824F47E4400F268CD /* Purchases.swift */; }; 2D5033242406E4E8009CAE61 /* RCSubscriberAttribute.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D5033212406E4E8009CAE61 /* RCSubscriberAttribute.h */; settings = {ATTRIBUTES = (Private, ); }; }; 2D5033252406E4E8009CAE61 /* RCSubscriberAttribute.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D5033222406E4E8009CAE61 /* RCSubscriberAttribute.m */; }; 2D5033262406E4E8009CAE61 /* RCSpecialSubscriberAttributes.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D5033232406E4E8009CAE61 /* RCSpecialSubscriberAttributes.h */; settings = {ATTRIBUTES = (Private, ); }; }; @@ -200,6 +201,7 @@ /* Begin PBXFileReference section */ 2D1A28CC24AA6F81006BE931 /* LocalReceiptParser.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocalReceiptParser.swift; sourceTree = ""; }; + 2D4C18A824F47E4400F268CD /* Purchases.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Purchases.swift; sourceTree = ""; }; 2D5033212406E4E8009CAE61 /* RCSubscriberAttribute.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RCSubscriberAttribute.h; path = Purchases/SubscriberAttributes/RCSubscriberAttribute.h; sourceTree = SOURCE_ROOT; }; 2D5033222406E4E8009CAE61 /* RCSubscriberAttribute.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RCSubscriberAttribute.m; path = Purchases/SubscriberAttributes/RCSubscriberAttribute.m; sourceTree = SOURCE_ROOT; }; 2D5033232406E4E8009CAE61 /* RCSpecialSubscriberAttributes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RCSpecialSubscriberAttributes.h; path = Purchases/SubscriberAttributes/RCSpecialSubscriberAttributes.h; sourceTree = SOURCE_ROOT; }; @@ -506,6 +508,7 @@ 352629F41F7C4B9100C04F2C = { isa = PBXGroup; children = ( + 2D4C18A824F47E4400F268CD /* Purchases.swift */, 2DEC0CFB24A2A1B100B0E5BB /* Package.swift */, 35262A001F7C4B9100C04F2C /* Purchases */, 35262A1F1F7D77E600C04F2C /* PurchasesTests */, @@ -1104,6 +1107,7 @@ 37E35EB1B9FE3F739B8C0D71 /* RCDateProvider.m in Sources */, 37E35DC1B42094073EB105AC /* RCSystemInfo.m in Sources */, 37E352BAA55C31B1E278CA8A /* RCLogUtils.m in Sources */, + 2D4C18A924F47E5000F268CD /* Purchases.swift in Sources */, 37E35EACCCC014F719E63D5F /* RCAttributionData.m in Sources */, 37E350AAD0BAE521A7F94846 /* RCAttributionFetcher.m in Sources */, 37E35889F275514EE3125439 /* RCIdentityManager.m in Sources */, @@ -1212,6 +1216,7 @@ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACH_O_TYPE = staticlib; MACOSX_DEPLOYMENT_TARGET = 10.12; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; @@ -1244,6 +1249,7 @@ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACH_O_TYPE = staticlib; MACOSX_DEPLOYMENT_TARGET = 10.12; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.revenuecat.PurchasesCoreSwift; @@ -1426,6 +1432,7 @@ 35262A131F7C4B9100C04F2C /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; BUILD_LIBRARY_FOR_DISTRIBUTION = YES; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_WEAK = YES; @@ -1440,9 +1447,8 @@ INFOPLIST_FILE = Purchases/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 9.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.12; + OTHER_LDFLAGS = "-all_load"; PRODUCT_BUNDLE_IDENTIFIER = com.purchases.Purchases; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = NO; @@ -1459,6 +1465,7 @@ 35262A141F7C4B9100C04F2C /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; BUILD_LIBRARY_FOR_DISTRIBUTION = YES; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_WEAK = YES; @@ -1473,9 +1480,8 @@ INFOPLIST_FILE = Purchases/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 9.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.12; + OTHER_LDFLAGS = "-all_load"; PRODUCT_BUNDLE_IDENTIFIER = com.purchases.Purchases; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = NO; @@ -1491,6 +1497,7 @@ 35262A271F7D77E600C04F2C /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CLANG_ENABLE_MODULES = YES; CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = 8SXR2327BM; @@ -1520,6 +1527,7 @@ 35262A281F7D77E600C04F2C /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CLANG_ENABLE_MODULES = YES; CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = 8SXR2327BM; From e8f4bc534caa4e13f2968c2ecee175a554d7c7d0 Mon Sep 17 00:00:00 2001 From: Andy Boedo Date: Wed, 26 Aug 2020 12:53:16 -0300 Subject: [PATCH 2/2] added a comment to explain the need for Purchases.swift --- Purchases.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Purchases.swift b/Purchases.swift index 646a4b6a65..29ae810118 100644 --- a/Purchases.swift +++ b/Purchases.swift @@ -5,5 +5,7 @@ // Created by Andrés Boedo on 8/24/20. // Copyright © 2020 Purchases. All rights reserved. // +// This file is mostly empty, but is needed so that Xcode can correctly +// link Swift dependencies for the frameowrk. import Foundation