Skip to content

Commit f7e9b67

Browse files
committed
Parse-iOS-Dynamic builds a dynamic framework 🎉
1 parent 90bb8b7 commit f7e9b67

File tree

6 files changed

+377
-0
lines changed

6 files changed

+377
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
//
2+
// Copyright (c) 2015-present, Parse, LLC.
3+
// All rights reserved.
4+
//
5+
// This source code is licensed under the BSD-style license found in the
6+
// LICENSE file in the root directory of this source tree. An additional grant
7+
// of patent rights can be found in the PATENTS file in the same directory.
8+
//
9+
10+
SUPPORTED_PLATFORMS = iphonesimulator iphoneos
11+
VALID_ARCHS[sdk=iphoneos*] = arm64 armv7 armv7s
12+
VALID_ARCHS[sdk=iphonesimulator*] = i386 x86_64
13+
14+
ENABLE_BITCODE = NO
15+
ENABLE_BITCODE[sdk=iphoneos*] = YES
16+
ENABLE_BITCODE[sdk=iphonesimulator*] = YES
17+
18+
// Dynamic linking uses different default copy paths
19+
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
20+
21+
DYLIB_INSTALL_NAME_BASE = @rpath
22+
23+
MACH_O_TYPE = mh_dylib
24+
CLANG_MODULES_AUTOLINK = YES
25+
IPHONEOS_DEPLOYMENT_TARGET = 8.0
26+
ONLY_ACTIVE_ARCH = NO
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
//
2+
// Copyright (c) 2015-present, Parse, LLC.
3+
// All rights reserved.
4+
//
5+
// This source code is licensed under the BSD-style license found in the
6+
// LICENSE file in the root directory of this source tree. An additional grant
7+
// of patent rights can be found in the PATENTS file in the same directory.
8+
//
9+
10+
#include "Shared/Product/Framework.xcconfig"
11+
12+
PRODUCT_NAME = Parse
13+
IPHONEOS_DEPLOYMENT_TARGET = 8.0
14+
// This silence a warning
15+
16+
SDKROOT[sdk=macos*] = iphoneos
17+
SDKROOT[sdk=iphoneos*] = iphoneos
18+
SDKROOT[sdk=iphonesimulator*] = iphonesimulator
19+
20+
MACH_O_TYPE = mh_dylib
21+
22+
ENABLE_BITCODE = NO
23+
ENABLE_BITCODE[sdk=iphoneos*] = YES
24+
ENABLE_BITCODE[sdk=iphonesimulator*] = YES
25+
DEFINES_MODULE = YES
26+
27+
SUPPORTED_PLATFORMS = iphonesimulator iphoneos
28+
29+
VALID_ARCHS[sdk=iphoneos*] = arm64 armv7 armv7s
30+
VALID_ARCHS[sdk=iphonesimulator*] = i386 x86_64
31+
32+
ARCHS[sdk=iphoneos*] = arm64 armv7 armv7s
33+
ARCHS[sdk=iphonesimulator*] = i386 x86_64
34+
35+
// Breaks the build if intherited $(BUILD_PRODUCTS_DIR)
36+
FRAMEWORK_SEARCH_PATHS = $PARSE_DIR/build
37+
38+
// Dynamic linking uses different default copy paths
39+
LD_RUNPATH_SEARCH_PATHS[sdk=iphoneos*] = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
40+
LD_RUNPATH_SEARCH_PATHS[sdk=iphonesimulator*] = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
41+
42+
DYLIB_INSTALL_NAME_BASE = @rpath
43+
44+
OTHER_LDFLAGS = $(inherited) '-dynamiclib' '-lsqlite3'
45+
CLANG_MODULES_AUTOLINK = YES
46+
47+
ONLY_ACTIVE_ARCH = NO
48+
49+
INFOPLIST_FILE = $(PROJECT_DIR)/$(PRODUCT_NAME)/Resources/Parse-iOS.Info.plist

Parse.xcodeproj/project.pbxproj

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1574,6 +1574,13 @@
15741574
/* End PBXBuildFile section */
15751575

15761576
/* Begin PBXContainerItemProxy section */
1577+
4A8E7F261C0627D300E8AF28 /* PBXContainerItemProxy */ = {
1578+
isa = PBXContainerItemProxy;
1579+
containerPortal = 09D33641139C54930098E916 /* Project object */;
1580+
proxyType = 1;
1581+
remoteGlobalIDString = 4A8E7F1E1C0627AF00E8AF28;
1582+
remoteInfo = "Bolts-iOS-dynamic";
1583+
};
15771584
811167461B8402DA003CB026 /* PBXContainerItemProxy */ = {
15781585
isa = PBXContainerItemProxy;
15791586
containerPortal = 09D33641139C54930098E916 /* Project object */;
@@ -1719,6 +1726,8 @@
17191726
499E425615B6409000A2C28E /* PFProduct.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PFProduct.m; sourceTree = "<group>"; };
17201727
49FDE2EC158C138F00126F64 /* PFPurchase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PFPurchase.h; sourceTree = "<group>"; };
17211728
49FDE2ED158C138F00126F64 /* PFPurchase.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PFPurchase.m; sourceTree = "<group>"; };
1729+
4A26C3B61C053AEE00E5F505 /* Parse-iOS-Dynamic.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Parse-iOS-Dynamic.xcconfig"; sourceTree = "<group>"; };
1730+
4A8E7F291C06458F00E8AF28 /* Bolts-iOS-Dynamic.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Bolts-iOS-Dynamic.xcconfig"; sourceTree = "<group>"; };
17221731
63723F6D1565A085007A1A73 /* PFRole.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PFRole.h; sourceTree = "<group>"; };
17231732
63723F6E1565A085007A1A73 /* PFRole.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PFRole.m; sourceTree = "<group>"; };
17241733
638CBBB415191435004F54E4 /* PFAnonymousUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PFAnonymousUtils.h; sourceTree = "<group>"; };
@@ -3724,12 +3733,14 @@
37243733
isa = PBXGroup;
37253734
children = (
37263735
F55ABB531B4F39DA00A0ECD5 /* Parse-iOS.xcconfig */,
3736+
4A26C3B61C053AEE00E5F505 /* Parse-iOS-Dynamic.xcconfig */,
37273737
F55ABB541B4F39DA00A0ECD5 /* Parse-OSX.xcconfig */,
37283738
815F24171BD04D310054659F /* Parse-tvOS.xcconfig */,
37293739
810154FE1BB382F800D7C7BD /* Parse-watchOS.xcconfig */,
37303740
F55ABB591B4F39DA00A0ECD5 /* ParseUnitTests-iOS.xcconfig */,
37313741
F55ABB5A1B4F39DA00A0ECD5 /* ParseUnitTests-OSX.xcconfig */,
37323742
812F31FB1BCF40DC00FCBCD4 /* Bolts-iOS.xcconfig */,
3743+
4A8E7F291C06458F00E8AF28 /* Bolts-iOS-Dynamic.xcconfig */,
37333744
812F31FC1BCF40DC00FCBCD4 /* Bolts-OSX.xcconfig */,
37343745
815F24191BD04DB70054659F /* Bolts-tvOS.xcconfig */,
37353746
812F31FD1BCF40DC00FCBCD4 /* Bolts-watchOS.xcconfig */,
@@ -4622,6 +4633,35 @@
46224633
/* End PBXHeadersBuildPhase section */
46234634

46244635
/* Begin PBXLegacyTarget section */
4636+
4A26C3BB1C053C2C00E5F505 /* Parse-iOS-Dynamic */ = {
4637+
isa = PBXLegacyTarget;
4638+
buildArgumentsString = "-xcconfig Configurations/Parse-iOS-Dynamic.xcconfig -workspace Parse.xcworkspace -scheme Parse-iOS -configuration $(CONFIGURATION) -sdk $SDKROOT CONFIGURATION_BUILD_DIR=$(CONFIGURATION_BUILD_DIR) $(ACTION)";
4639+
buildConfigurationList = 4A26C3BC1C053C2D00E5F505 /* Build configuration list for PBXLegacyTarget "Parse-iOS-Dynamic" */;
4640+
buildPhases = (
4641+
);
4642+
buildToolPath = xcodebuild;
4643+
buildWorkingDirectory = "$(SRCROOT)";
4644+
dependencies = (
4645+
4A8E7F271C0627D300E8AF28 /* PBXTargetDependency */,
4646+
);
4647+
name = "Parse-iOS-Dynamic";
4648+
passBuildSettingsInEnvironment = 1;
4649+
productName = Parse;
4650+
};
4651+
4A8E7F1E1C0627AF00E8AF28 /* Bolts-iOS-Dynamic */ = {
4652+
isa = PBXLegacyTarget;
4653+
buildArgumentsString = "Scripts/build_bolts_dynamic.sh $(ACTION)";
4654+
buildConfigurationList = 4A8E7F251C0627AF00E8AF28 /* Build configuration list for PBXLegacyTarget "Bolts-iOS-Dynamic" */;
4655+
buildPhases = (
4656+
);
4657+
buildToolPath = sh;
4658+
buildWorkingDirectory = "$(SRCROOT)";
4659+
dependencies = (
4660+
);
4661+
name = "Bolts-iOS-Dynamic";
4662+
passBuildSettingsInEnvironment = 1;
4663+
productName = "Bolts-iOS-dynamic";
4664+
};
46254665
812F31F71BCF40AA00FCBCD4 /* Bolts-watchOS */ = {
46264666
isa = PBXLegacyTarget;
46274667
buildArgumentsString = "$(SRCROOT)/Vendor/Bolts-ObjC/ \\\n\"Vendor/Bolts-ObjC/scripts/build_framework.sh -n -c Release --with-watchos --with-tvos\"";
@@ -4810,6 +4850,12 @@
48104850
LastUpgradeCheck = 0710;
48114851
ORGANIZATIONNAME = "Parse Inc.";
48124852
TargetAttributes = {
4853+
4A26C3BB1C053C2C00E5F505 = {
4854+
CreatedOnToolsVersion = 7.1.1;
4855+
};
4856+
4A8E7F1E1C0627AF00E8AF28 = {
4857+
CreatedOnToolsVersion = 7.1.1;
4858+
};
48134859
81493A931A0D3492008D5504 = {
48144860
CreatedOnToolsVersion = 6.1;
48154861
};
@@ -4838,6 +4884,7 @@
48384884
projectRoot = "";
48394885
targets = (
48404886
81C3821B19CCA89E0066284A /* Parse-iOS */,
4887+
4A26C3BB1C053C2C00E5F505 /* Parse-iOS-Dynamic */,
48414888
816F441B1A8E8933009CDB32 /* ParseUnitTests-iOS */,
48424889
97010FAB1630B18F00AB761E /* Parse-OSX */,
48434890
81C09F501AF97A490043B49C /* ParseUnitTests-OSX */,
@@ -4847,6 +4894,7 @@
48474894
81493A931A0D3492008D5504 /* Bolts-OSX */,
48484895
815F241A1BD04DBB0054659F /* Bolts-tvOS */,
48494896
812F31F71BCF40AA00FCBCD4 /* Bolts-watchOS */,
4897+
4A8E7F1E1C0627AF00E8AF28 /* Bolts-iOS-Dynamic */,
48504898
);
48514899
};
48524900
/* End PBXProject section */
@@ -5831,6 +5879,11 @@
58315879
/* End PBXSourcesBuildPhase section */
58325880

58335881
/* Begin PBXTargetDependency section */
5882+
4A8E7F271C0627D300E8AF28 /* PBXTargetDependency */ = {
5883+
isa = PBXTargetDependency;
5884+
target = 4A8E7F1E1C0627AF00E8AF28 /* Bolts-iOS-Dynamic */;
5885+
targetProxy = 4A8E7F261C0627D300E8AF28 /* PBXContainerItemProxy */;
5886+
};
58345887
811167471B8402DA003CB026 /* PBXTargetDependency */ = {
58355888
isa = PBXTargetDependency;
58365889
target = 97010FAB1630B18F00AB761E /* Parse-OSX */;
@@ -5894,6 +5947,44 @@
58945947
};
58955948
name = Release;
58965949
};
5950+
4A8E7F2A1C06458F00E8AF28 /* Debug */ = {
5951+
isa = XCBuildConfiguration;
5952+
buildSettings = {
5953+
COPY_PHASE_STRIP = NO;
5954+
GCC_DYNAMIC_NO_PIC = NO;
5955+
GCC_OPTIMIZATION_LEVEL = 0;
5956+
PRODUCT_NAME = "Bolts-iOS-dynamic";
5957+
};
5958+
name = Debug;
5959+
};
5960+
4A8E7F2B1C06458F00E8AF28 /* Release */ = {
5961+
isa = XCBuildConfiguration;
5962+
buildSettings = {
5963+
COPY_PHASE_STRIP = YES;
5964+
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
5965+
PRODUCT_NAME = "Bolts-iOS-dynamic";
5966+
};
5967+
name = Release;
5968+
};
5969+
4A8E7F371C0652D500E8AF28 /* Debug */ = {
5970+
isa = XCBuildConfiguration;
5971+
buildSettings = {
5972+
COPY_PHASE_STRIP = NO;
5973+
GCC_DYNAMIC_NO_PIC = NO;
5974+
GCC_OPTIMIZATION_LEVEL = 0;
5975+
PRODUCT_NAME = Parse;
5976+
};
5977+
name = Debug;
5978+
};
5979+
4A8E7F381C0652D500E8AF28 /* Release */ = {
5980+
isa = XCBuildConfiguration;
5981+
buildSettings = {
5982+
COPY_PHASE_STRIP = YES;
5983+
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
5984+
PRODUCT_NAME = Parse;
5985+
};
5986+
name = Release;
5987+
};
58975988
810156671BB3832700D7C7BD /* Debug */ = {
58985989
isa = XCBuildConfiguration;
58995990
baseConfigurationReference = 810154FE1BB382F800D7C7BD /* Parse-watchOS.xcconfig */;
@@ -6050,6 +6141,24 @@
60506141
defaultConfigurationIsVisible = 0;
60516142
defaultConfigurationName = Release;
60526143
};
6144+
4A26C3BC1C053C2D00E5F505 /* Build configuration list for PBXLegacyTarget "Parse-iOS-Dynamic" */ = {
6145+
isa = XCConfigurationList;
6146+
buildConfigurations = (
6147+
4A8E7F371C0652D500E8AF28 /* Debug */,
6148+
4A8E7F381C0652D500E8AF28 /* Release */,
6149+
);
6150+
defaultConfigurationIsVisible = 0;
6151+
defaultConfigurationName = Release;
6152+
};
6153+
4A8E7F251C0627AF00E8AF28 /* Build configuration list for PBXLegacyTarget "Bolts-iOS-Dynamic" */ = {
6154+
isa = XCConfigurationList;
6155+
buildConfigurations = (
6156+
4A8E7F2A1C06458F00E8AF28 /* Debug */,
6157+
4A8E7F2B1C06458F00E8AF28 /* Release */,
6158+
);
6159+
defaultConfigurationIsVisible = 0;
6160+
defaultConfigurationName = Release;
6161+
};
60536162
810156661BB3832700D7C7BD /* Build configuration list for PBXNativeTarget "Parse-watchOS" */ = {
60546163
isa = XCConfigurationList;
60556164
buildConfigurations = (
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "0710"
4+
version = "1.3">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "YES"
11+
buildForRunning = "YES"
12+
buildForProfiling = "YES"
13+
buildForArchiving = "YES"
14+
buildForAnalyzing = "YES">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "4A26C3BB1C053C2C00E5F505"
18+
BuildableName = "Parse-iOS-Dynamic"
19+
BlueprintName = "Parse-iOS-Dynamic"
20+
ReferencedContainer = "container:Parse.xcodeproj">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
</BuildActionEntries>
24+
</BuildAction>
25+
<TestAction
26+
buildConfiguration = "Debug"
27+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
shouldUseLaunchSchemeArgsEnv = "YES">
30+
<Testables>
31+
</Testables>
32+
<AdditionalOptions>
33+
</AdditionalOptions>
34+
</TestAction>
35+
<LaunchAction
36+
buildConfiguration = "Release"
37+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
38+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
39+
launchStyle = "0"
40+
useCustomWorkingDirectory = "NO"
41+
ignoresPersistentStateOnLaunch = "NO"
42+
debugDocumentVersioning = "YES"
43+
debugServiceExtension = "internal"
44+
allowLocationSimulation = "YES">
45+
<MacroExpansion>
46+
<BuildableReference
47+
BuildableIdentifier = "primary"
48+
BlueprintIdentifier = "4A26C3BB1C053C2C00E5F505"
49+
BuildableName = "Parse-iOS-Dynamic"
50+
BlueprintName = "Parse-iOS-Dynamic"
51+
ReferencedContainer = "container:Parse.xcodeproj">
52+
</BuildableReference>
53+
</MacroExpansion>
54+
<AdditionalOptions>
55+
</AdditionalOptions>
56+
</LaunchAction>
57+
<ProfileAction
58+
buildConfiguration = "Release"
59+
shouldUseLaunchSchemeArgsEnv = "YES"
60+
savedToolIdentifier = ""
61+
useCustomWorkingDirectory = "NO"
62+
debugDocumentVersioning = "YES">
63+
<MacroExpansion>
64+
<BuildableReference
65+
BuildableIdentifier = "primary"
66+
BlueprintIdentifier = "4A26C3BB1C053C2C00E5F505"
67+
BuildableName = "Parse-iOS-Dynamic"
68+
BlueprintName = "Parse-iOS-Dynamic"
69+
ReferencedContainer = "container:Parse.xcodeproj">
70+
</BuildableReference>
71+
</MacroExpansion>
72+
</ProfileAction>
73+
<AnalyzeAction
74+
buildConfiguration = "Debug">
75+
</AnalyzeAction>
76+
<ArchiveAction
77+
buildConfiguration = "Release"
78+
revealArchiveInOrganizer = "YES">
79+
</ArchiveAction>
80+
</Scheme>

Rakefile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,24 @@ namespace :build do
7878
end
7979
end
8080

81+
desc 'Build iOS Dynamic framework.'
82+
task :ios_dynamic do
83+
task = XCTask::BuildFrameworkTask.new do |t|
84+
t.directory = script_folder
85+
t.build_directory = build_folder
86+
t.framework_type = XCTask::FrameworkType::IOS
87+
t.framework_name = 'Parse.framework'
88+
t.workspace = 'Parse.xcworkspace'
89+
t.scheme = 'Parse-iOS-Dynamic'
90+
t.configuration = 'Release'
91+
end
92+
result = task.execute
93+
unless result
94+
puts 'Failed to build iOS Framework.'
95+
exit(1)
96+
end
97+
end
98+
8199
desc 'Build watchOS framework.'
82100
task :watchos do
83101
task = XCTask::BuildFrameworkTask.new do |t|
@@ -138,6 +156,7 @@ end
138156

139157
namespace :package do
140158
package_ios_name = 'Parse-iOS.zip'
159+
package_ios_dynamic_name = 'Parse-iOS-Dynamic.zip'
141160
package_osx_name = 'Parse-OSX.zip'
142161
package_starter_ios_name = 'ParseStarterProject-iOS.zip'
143162
package_starter_osx_name = 'ParseStarterProject-OSX.zip'
@@ -160,6 +179,13 @@ namespace :package do
160179
[ios_framework_path, bolts_path],
161180
package_ios_name)
162181

182+
Rake::Task['build:ios_dynamic'].invoke
183+
bolts_path = File.join(build_folder, 'Bolts.framework')
184+
ios_framework_path = File.join(build_folder, 'Parse.framework')
185+
make_package(release_folder,
186+
[ios_framework_path, bolts_path],
187+
package_ios_dynamic_name)
188+
163189
## Build OS X Framework
164190
Rake::Task['build:osx'].invoke
165191
bolts_path = File.join(bolts_build_folder, 'osx', 'Bolts.framework')

0 commit comments

Comments
 (0)