Skip to content

Commit b681c8a

Browse files
mateosilguerosatya164
authored andcommitted
fix: fix building generated project on ios (#43)
1 parent 4aba928 commit b681c8a

File tree

6 files changed

+50
-129
lines changed

6 files changed

+50
-129
lines changed

templates/library/$.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*.pbxproj -text
2+
# specific for windows script files
3+
*.bat text eol=crlf
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
//
2+
// Use this file to import your target's public headers that you would like to expose to Swift.
3+
//

templates/native-library/example/ios/<%= project.name %>Example.xcodeproj/project.pbxproj

Lines changed: 27 additions & 129 deletions
Original file line numberDiff line numberDiff line change
@@ -12,45 +12,28 @@
1212
13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; };
1313
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
1414
13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
15-
2D02E4BC1E0B4A80006451C7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; };
16-
2D02E4BD1E0B4A84006451C7 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
17-
2D02E4BF1E0B4AB3006451C7 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
15+
20F357B024636CDF00C146DC /* File.swift in Sources */ = {isa = PBXBuildFile; fileRef = 20F357AF24636CDF00C146DC /* File.swift */; };
1816
/* End PBXBuildFile section */
1917

20-
/* Begin PBXContainerItemProxy section */
21-
00E356F41AD99517003FC87E /* PBXContainerItemProxy */ = {
22-
isa = PBXContainerItemProxy;
23-
containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;
24-
proxyType = 1;
25-
remoteGlobalIDString = 13B07F861A680F5B00A75B9A;
26-
remoteInfo = <%= project.name %>Example;
27-
};
28-
/* End PBXContainerItemProxy section */
29-
3018
/* Begin PBXFileReference section */
3119
008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = main.jsbundle; sourceTree = "<group>"; };
32-
00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
3320
13B07F961A680F5B00A75B9A /* <%= project.name %>Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = <%= project.name %>Example.app; sourceTree = BUILT_PRODUCTS_DIR; };
3421
13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = <%= project.name %>Example/AppDelegate.h; sourceTree = "<group>"; };
3522
13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = <%= project.name %>Example/AppDelegate.m; sourceTree = "<group>"; };
3623
13B07FB21A68108700A75B9A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = "<group>"; };
3724
13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = <%= project.name %>Example/Images.xcassets; sourceTree = "<group>"; };
3825
13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = <%= project.name %>Example/Info.plist; sourceTree = "<group>"; };
3926
13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = <%= project.name %>Example/main.m; sourceTree = "<group>"; };
27+
20F357AD24636CDE00C146DC /* <%= project.name %>Example-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "<%= project.name %>Example-Bridging-Header.h"; sourceTree = "<group>"; };
28+
20F357AE24636CDF00C146DC /* <%= project.name %>Example-Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "<%= project.name %>Example-Bridging-Header.h"; sourceTree = "<group>"; };
29+
20F357AF24636CDF00C146DC /* File.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = File.swift; sourceTree = "<group>"; };
4030
4D7192F03A36A017E887435B /* Pods-<%= project.name %>Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-<%= project.name %>Example.release.xcconfig"; path = "Target Support Files/Pods-<%= project.name %>Example/Pods-<%= project.name %>Example.release.xcconfig"; sourceTree = "<group>"; };
4131
871719007ECC5EAD276C345C /* Pods-<%= project.name %>Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-<%= project.name %>Example.debug.xcconfig"; path = "Target Support Files/Pods-<%= project.name %>Example/Pods-<%= project.name %>Example.debug.xcconfig"; sourceTree = "<group>"; };
4232
BCEA90A70F4BEAD7E9FA28B2 /* libPods-<%= project.name %>Example.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-<%= project.name %>Example.a"; sourceTree = BUILT_PRODUCTS_DIR; };
4333
ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
4434
/* End PBXFileReference section */
4535

4636
/* Begin PBXFrameworksBuildPhase section */
47-
00E356EB1AD99517003FC87E /* Frameworks */ = {
48-
isa = PBXFrameworksBuildPhase;
49-
buildActionMask = 2147483647;
50-
files = (
51-
);
52-
runOnlyForDeploymentPostprocessing = 0;
53-
};
5437
13B07F8C1A680F5B00A75B9A /* Frameworks */ = {
5538
isa = PBXFrameworksBuildPhase;
5639
buildActionMask = 2147483647;
@@ -59,31 +42,9 @@
5942
);
6043
runOnlyForDeploymentPostprocessing = 0;
6144
};
62-
2D02E4781E0B4A5D006451C7 /* Frameworks */ = {
63-
isa = PBXFrameworksBuildPhase;
64-
buildActionMask = 2147483647;
65-
files = (
66-
);
67-
runOnlyForDeploymentPostprocessing = 0;
68-
};
69-
2D02E48D1E0B4A5D006451C7 /* Frameworks */ = {
70-
isa = PBXFrameworksBuildPhase;
71-
buildActionMask = 2147483647;
72-
files = (
73-
);
74-
runOnlyForDeploymentPostprocessing = 0;
75-
};
7645
/* End PBXFrameworksBuildPhase section */
7746

7847
/* Begin PBXGroup section */
79-
00E356F01AD99517003FC87E /* Supporting Files */ = {
80-
isa = PBXGroup;
81-
children = (
82-
00E356F11AD99517003FC87E /* Info.plist */,
83-
);
84-
name = "Supporting Files";
85-
sourceTree = "<group>";
86-
};
8748
13B07FAE1A68108700A75B9A /* <%= project.name %>Example */ = {
8849
isa = PBXGroup;
8950
children = (
@@ -104,7 +65,6 @@
10465
871719007ECC5EAD276C345C /* Pods-<%= project.name %>Example.debug.xcconfig */,
10566
4D7192F03A36A017E887435B /* Pods-<%= project.name %>Example.release.xcconfig */,
10667
);
107-
name = Pods;
10868
path = Pods;
10969
sourceTree = "<group>";
11070
};
@@ -127,11 +87,14 @@
12787
83CBB9F61A601CBA00E9B192 = {
12888
isa = PBXGroup;
12989
children = (
90+
20F357AF24636CDF00C146DC /* File.swift */,
91+
20F357AE24636CDF00C146DC /* <%= project.name %>Example-Bridging-Header.h */,
13092
13B07FAE1A68108700A75B9A /* <%= project.name %>Example */,
13193
832341AE1AAA6A7D00B99B32 /* Libraries */,
13294
83CBBA001A601CBA00E9B192 /* Products */,
13395
2D16E6871FA4F8E400B85C8A /* Frameworks */,
13496
1CFFDEF7170271C97B8B7E5A /* Pods */,
97+
20F357AD24636CDE00C146DC /* <%= project.name %>Example-Bridging-Header.h */,
13598
);
13699
indentWidth = 2;
137100
sourceTree = "<group>";
@@ -178,18 +141,8 @@
178141
LastUpgradeCheck = 0940;
179142
ORGANIZATIONNAME = Facebook;
180143
TargetAttributes = {
181-
00E356ED1AD99517003FC87E = {
182-
CreatedOnToolsVersion = 6.2;
183-
TestTargetID = 13B07F861A680F5B00A75B9A;
184-
};
185-
2D02E47A1E0B4A5D006451C7 = {
186-
CreatedOnToolsVersion = 8.2.1;
187-
ProvisioningStyle = Automatic;
188-
};
189-
2D02E48F1E0B4A5D006451C7 = {
190-
CreatedOnToolsVersion = 8.2.1;
191-
ProvisioningStyle = Automatic;
192-
TestTargetID = 2D02E47A1E0B4A5D006451C7;
144+
13B07F861A680F5B00A75B9A = {
145+
LastSwiftMigration = 1110;
193146
};
194147
};
195148
};
@@ -198,6 +151,7 @@
198151
developmentRegion = English;
199152
hasScannedForEncodings = 0;
200153
knownRegions = (
154+
English,
201155
en,
202156
Base,
203157
);
@@ -212,13 +166,6 @@
212166
/* End PBXProject section */
213167

214168
/* Begin PBXResourcesBuildPhase section */
215-
00E356EC1AD99517003FC87E /* Resources */ = {
216-
isa = PBXResourcesBuildPhase;
217-
buildActionMask = 2147483647;
218-
files = (
219-
);
220-
runOnlyForDeploymentPostprocessing = 0;
221-
};
222169
13B07F8E1A680F5B00A75B9A /* Resources */ = {
223170
isa = PBXResourcesBuildPhase;
224171
buildActionMask = 2147483647;
@@ -228,21 +175,6 @@
228175
);
229176
runOnlyForDeploymentPostprocessing = 0;
230177
};
231-
2D02E4791E0B4A5D006451C7 /* Resources */ = {
232-
isa = PBXResourcesBuildPhase;
233-
buildActionMask = 2147483647;
234-
files = (
235-
2D02E4BD1E0B4A84006451C7 /* Images.xcassets in Resources */,
236-
);
237-
runOnlyForDeploymentPostprocessing = 0;
238-
};
239-
2D02E48E1E0B4A5D006451C7 /* Resources */ = {
240-
isa = PBXResourcesBuildPhase;
241-
buildActionMask = 2147483647;
242-
files = (
243-
);
244-
runOnlyForDeploymentPostprocessing = 0;
245-
};
246178
/* End PBXResourcesBuildPhase section */
247179

248180
/* Begin PBXShellScriptBuildPhase section */
@@ -260,20 +192,6 @@
260192
shellPath = /bin/sh;
261193
shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh";
262194
};
263-
2D02E4CB1E0B4B27006451C7 /* Bundle React Native Code And Images */ = {
264-
isa = PBXShellScriptBuildPhase;
265-
buildActionMask = 2147483647;
266-
files = (
267-
);
268-
inputPaths = (
269-
);
270-
name = "Bundle React Native Code And Images";
271-
outputPaths = (
272-
);
273-
runOnlyForDeploymentPostprocessing = 0;
274-
shellPath = /bin/sh;
275-
shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh";
276-
};
277195
CCCC07BCAFDEF1FCADC0D0C9 /* [CP] Check Pods Manifest.lock */ = {
278196
isa = PBXShellScriptBuildPhase;
279197
buildActionMask = 2147483647;
@@ -315,25 +233,6 @@
315233
shellScript = "export RCT_METRO_PORT=\"${RCT_METRO_PORT:=8081}\"\necho \"export RCT_METRO_PORT=${RCT_METRO_PORT}\" > \"${SRCROOT}/../node_modules/react-native/scripts/.packager.env\"\nif [ -z \"${RCT_NO_LAUNCH_PACKAGER+xxx}\" ] ; then\n if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then\n if ! curl -s \"http://localhost:${RCT_METRO_PORT}/status\" | grep -q \"packager-status:running\" ; then\n echo \"Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly\"\n exit 2\n fi\n else\n open \"$SRCROOT/../node_modules/react-native/scripts/launchPackager.command\" || echo \"Can't start packager automatically\"\n fi\nfi\n";
316234
showEnvVarsInLog = 0;
317235
};
318-
FD10A7F122414F3F0027D42C /* Start Packager */ = {
319-
isa = PBXShellScriptBuildPhase;
320-
buildActionMask = 2147483647;
321-
files = (
322-
);
323-
inputFileListPaths = (
324-
);
325-
inputPaths = (
326-
);
327-
name = "Start Packager";
328-
outputFileListPaths = (
329-
);
330-
outputPaths = (
331-
);
332-
runOnlyForDeploymentPostprocessing = 0;
333-
shellPath = /bin/sh;
334-
shellScript = "export RCT_METRO_PORT=\"${RCT_METRO_PORT:=8081}\"\necho \"export RCT_METRO_PORT=${RCT_METRO_PORT}\" > \"${SRCROOT}/../node_modules/react-native/scripts/.packager.env\"\nif [ -z \"${RCT_NO_LAUNCH_PACKAGER+xxx}\" ] ; then\n if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then\n if ! curl -s \"http://localhost:${RCT_METRO_PORT}/status\" | grep -q \"packager-status:running\" ; then\n echo \"Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly\"\n exit 2\n fi\n else\n open \"$SRCROOT/../node_modules/react-native/scripts/launchPackager.command\" || echo \"Can't start packager automatically\"\n fi\nfi\n";
335-
showEnvVarsInLog = 0;
336-
};
337236
/* End PBXShellScriptBuildPhase section */
338237

339238
/* Begin PBXSourcesBuildPhase section */
@@ -342,29 +241,13 @@
342241
buildActionMask = 2147483647;
343242
files = (
344243
13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */,
244+
20F357B024636CDF00C146DC /* File.swift in Sources */,
345245
13B07FC11A68108700A75B9A /* main.m in Sources */,
346246
);
347247
runOnlyForDeploymentPostprocessing = 0;
348248
};
349-
2D02E4771E0B4A5D006451C7 /* Sources */ = {
350-
isa = PBXSourcesBuildPhase;
351-
buildActionMask = 2147483647;
352-
files = (
353-
2D02E4BF1E0B4AB3006451C7 /* main.m in Sources */,
354-
2D02E4BC1E0B4A80006451C7 /* AppDelegate.m in Sources */,
355-
);
356-
runOnlyForDeploymentPostprocessing = 0;
357-
};
358249
/* End PBXSourcesBuildPhase section */
359250

360-
/* Begin PBXTargetDependency section */
361-
00E356F51AD99517003FC87E /* PBXTargetDependency */ = {
362-
isa = PBXTargetDependency;
363-
target = 13B07F861A680F5B00A75B9A /* <%= project.name %>Example */;
364-
targetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */;
365-
};
366-
/* End PBXTargetDependency section */
367-
368251
/* Begin PBXVariantGroup section */
369252
13B07FB11A68108700A75B9A /* LaunchScreen.xib */ = {
370253
isa = PBXVariantGroup;
@@ -383,17 +266,25 @@
383266
baseConfigurationReference = 871719007ECC5EAD276C345C /* Pods-<%= project.name %>Example.debug.xcconfig */;
384267
buildSettings = {
385268
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
269+
CLANG_ENABLE_MODULES = YES;
386270
CURRENT_PROJECT_VERSION = 1;
387271
DEAD_CODE_STRIPPING = NO;
388272
INFOPLIST_FILE = <%= project.name %>Example/Info.plist;
389273
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
274+
OTHER_CFLAGS = (
275+
"$(inherited)",
276+
"-DFB_SONARKIT_ENABLED=1",
277+
);
390278
OTHER_LDFLAGS = (
391279
"$(inherited)",
392280
"-ObjC",
393281
"-lc++",
394282
);
395283
PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.<%= project.name %>Example.$(PRODUCT_NAME:rfc1034identifier)";
396284
PRODUCT_NAME = <%= project.name %>Example;
285+
SWIFT_OBJC_BRIDGING_HEADER = "<%= project.name %>Example-Bridging-Header.h";
286+
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
287+
SWIFT_VERSION = 5.0;
397288
VERSIONING_SYSTEM = "apple-generic";
398289
};
399290
name = Debug;
@@ -403,16 +294,23 @@
403294
baseConfigurationReference = 4D7192F03A36A017E887435B /* Pods-<%= project.name %>Example.release.xcconfig */;
404295
buildSettings = {
405296
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
297+
CLANG_ENABLE_MODULES = YES;
406298
CURRENT_PROJECT_VERSION = 1;
407299
INFOPLIST_FILE = <%= project.name %>Example/Info.plist;
408300
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
301+
OTHER_CFLAGS = (
302+
"$(inherited)",
303+
"-DFB_SONARKIT_ENABLED=1",
304+
);
409305
OTHER_LDFLAGS = (
410306
"$(inherited)",
411307
"-ObjC",
412308
"-lc++",
413309
);
414310
PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.<%= project.name %>Example.$(PRODUCT_NAME:rfc1034identifier)";
415311
PRODUCT_NAME = <%= project.name %>Example;
312+
SWIFT_OBJC_BRIDGING_HEADER = "<%= project.name %>Example-Bridging-Header.h";
313+
SWIFT_VERSION = 5.0;
416314
VERSIONING_SYSTEM = "apple-generic";
417315
};
418316
name = Release;
@@ -540,4 +438,4 @@
540438
/* End XCConfigurationList section */
541439
};
542440
rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */;
543-
}
441+
}

templates/native-library/example/ios/<%= project.name %>Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
//
2+
// File.swift
3+
// <%= project.name %>Example
4+
//
5+
// Created by Mateo Silguero on 06/05/2020.
6+
// Copyright © 2020 Facebook. All rights reserved.
7+
//
8+
9+
import Foundation

templates/native-library/ios/<%= project.name %>.xcodeproj/project.xcworkspace/contents.xcworkspacedata

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)