Skip to content
This repository was archived by the owner on Jun 17, 2023. It is now read-only.

Commit ba5a59c

Browse files
committed
Move sample project to bundle
1 parent ff8a776 commit ba5a59c

File tree

12 files changed

+30
-10
lines changed

12 files changed

+30
-10
lines changed

Samples/PagingLayoutSamples.xcodeproj/project.pbxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
29A2D3D324B73A19005A0F6B /* LayoutDesignerIntroCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29A2D3D224B73A19005A0F6B /* LayoutDesignerIntroCell.swift */; };
2626
29A2D3D524B73AB7005A0F6B /* LayoutDesignerIntroInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29A2D3D424B73AB7005A0F6B /* LayoutDesignerIntroInfo.swift */; };
2727
29A2D3D724B73CB1005A0F6B /* LayoutDesignerIntroCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 29A2D3D624B73CB1005A0F6B /* LayoutDesignerIntroCell.xib */; };
28-
29A2D3FC24B769D7005A0F6B /* SampleProject in Resources */ = {isa = PBXBuildFile; fileRef = 29A2D3FB24B769D7005A0F6B /* SampleProject */; };
2928
29B5A72024A7B02900C9843E /* ShapeLayout+StackOptions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29B5A71F24A7B02900C9843E /* ShapeLayout+StackOptions.swift */; };
3029
29B5A72224A7B06300C9843E /* ShapeLayout+SnapshotOptions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29B5A72124A7B06300C9843E /* ShapeLayout+SnapshotOptions.swift */; };
3130
29B5A72424A8CC4B00C9843E /* CGFloat+String.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29B5A72324A8CC4B00C9843E /* CGFloat+String.swift */; };
@@ -34,6 +33,7 @@
3433
29B5A72A24A8D94300C9843E /* Values+Pair.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29B5A72924A8D94300C9843E /* Values+Pair.swift */; };
3534
29B5A72C24A8DD7100C9843E /* UIBlurEffect.Style+Name.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29B5A72B24A8DD7100C9843E /* UIBlurEffect.Style+Name.swift */; };
3635
29BEC4D52476DD9D004BA505 /* LayoutDesignerOptionsTableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29BEC4D42476DD9D004BA505 /* LayoutDesignerOptionsTableView.swift */; };
36+
29CE3D4624B7763C00380DCD /* SampleProject.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 29CE3D4524B7763C00380DCD /* SampleProject.bundle */; };
3737
29D9F94323F7F98800656A67 /* ShapesViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29D9F94223F7F98800656A67 /* ShapesViewController.swift */; };
3838
29D9F94523F7F99400656A67 /* ShapesViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29D9F94423F7F99400656A67 /* ShapesViewModel.swift */; };
3939
29D9F94723F7F9B700656A67 /* ShapesViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 29D9F94623F7F9B700656A67 /* ShapesViewController.xib */; };
@@ -135,7 +135,6 @@
135135
29A2D3D224B73A19005A0F6B /* LayoutDesignerIntroCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LayoutDesignerIntroCell.swift; sourceTree = "<group>"; };
136136
29A2D3D424B73AB7005A0F6B /* LayoutDesignerIntroInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LayoutDesignerIntroInfo.swift; sourceTree = "<group>"; };
137137
29A2D3D624B73CB1005A0F6B /* LayoutDesignerIntroCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = LayoutDesignerIntroCell.xib; sourceTree = "<group>"; };
138-
29A2D3FB24B769D7005A0F6B /* SampleProject */ = {isa = PBXFileReference; lastKnownFileType = folder; path = SampleProject; sourceTree = "<group>"; };
139138
29B5A71F24A7B02900C9843E /* ShapeLayout+StackOptions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ShapeLayout+StackOptions.swift"; sourceTree = "<group>"; };
140139
29B5A72124A7B06300C9843E /* ShapeLayout+SnapshotOptions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ShapeLayout+SnapshotOptions.swift"; sourceTree = "<group>"; };
141140
29B5A72324A8CC4B00C9843E /* CGFloat+String.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "CGFloat+String.swift"; sourceTree = "<group>"; };
@@ -144,6 +143,7 @@
144143
29B5A72924A8D94300C9843E /* Values+Pair.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Values+Pair.swift"; sourceTree = "<group>"; };
145144
29B5A72B24A8DD7100C9843E /* UIBlurEffect.Style+Name.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIBlurEffect.Style+Name.swift"; sourceTree = "<group>"; };
146145
29BEC4D42476DD9D004BA505 /* LayoutDesignerOptionsTableView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LayoutDesignerOptionsTableView.swift; sourceTree = "<group>"; };
146+
29CE3D4524B7763C00380DCD /* SampleProject.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = SampleProject.bundle; sourceTree = "<group>"; };
147147
29D9F94223F7F98800656A67 /* ShapesViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShapesViewController.swift; sourceTree = "<group>"; };
148148
29D9F94423F7F99400656A67 /* ShapesViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShapesViewModel.swift; sourceTree = "<group>"; };
149149
29D9F94623F7F9B700656A67 /* ShapesViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ShapesViewController.xib; sourceTree = "<group>"; };
@@ -391,7 +391,6 @@
391391
AB500A3123B104E20056BE37 /* PagingLayoutSamples */ = {
392392
isa = PBXGroup;
393393
children = (
394-
29A2D3FB24B769D7005A0F6B /* SampleProject */,
395394
292489AD2461A57900A316B0 /* Paging Layout.entitlements */,
396395
AB1E03AD23B25CD30087F904 /* CustomViews */,
397396
AB500A5223B152170056BE37 /* Modules */,
@@ -404,6 +403,7 @@
404403
AB500A4023B104E60056BE37 /* Info.plist */,
405404
292489CA24620BD600A316B0 /* AppKitBridge.h */,
406405
292489CB24620C4D00A316B0 /* PagingLayoutSamples-Bridging-Header.h */,
406+
29CE3D4524B7763C00380DCD /* SampleProject.bundle */,
407407
);
408408
path = PagingLayoutSamples;
409409
sourceTree = "<group>";
@@ -627,6 +627,7 @@
627627
AB500A5F23B154950056BE37 /* FruitsCollectionViewCell.xib in Resources */,
628628
AB1BBA9F23CA7BE3004E5C3B /* CardsViewController.xib in Resources */,
629629
2977657E2474531D00835DBD /* LayoutDesignerOptionCell.xib in Resources */,
630+
29CE3D4624B7763C00380DCD /* SampleProject.bundle in Resources */,
630631
29D9F94723F7F9B700656A67 /* ShapesViewController.xib in Resources */,
631632
ABC242D023B6861000DBD4D6 /* PhotoCollectionViewCell.xib in Resources */,
632633
ABA0DA0A23F98B70004A9C18 /* ShapeCardView.xib in Resources */,
@@ -638,7 +639,6 @@
638639
AB7C1E0823B4E2C0006441DE /* MainViewController.xib in Resources */,
639640
ABA1A72E23B42247006A46A3 /* PriceTagView.xib in Resources */,
640641
29A2D3AA24B72895005A0F6B /* LayoutDesignerCodePreviewViewController.xib in Resources */,
641-
29A2D3FC24B769D7005A0F6B /* SampleProject in Resources */,
642642
ABA1A73323B422B9006A46A3 /* QuantityControllerView.xib in Resources */,
643643
);
644644
runOnlyForDeploymentPostprocessing = 0;

Samples/PagingLayoutSamples/Modules/LayoutDesigner/Code/LayoutDesignerCodePreviewViewModel.swift

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,32 @@ struct LayoutDesignerCodePreviewViewModel {
3030
func generateSampleProject() {
3131
removeSampleProject()
3232
guard let sampleProjectTempURL = sampleProjectTempURL,
33-
let sampleProjectURL = Bundle.main.url(forResource: "SampleProject", withExtension: nil) else {
34-
return
33+
let bundlePath = Bundle.main.url(forResource: "SampleProject", withExtension: "bundle"),
34+
let sampleProjectURL = Bundle(url: bundlePath)?.url(forResource: "SampleProject", withExtension: nil) else {
35+
return
3536
}
3637
try? FileManager.default.copyItem(at: sampleProjectURL, to: sampleProjectTempURL)
3738

38-
let viewControllerPath = sampleProjectTempURL.appendingPathComponent("PagingLayout").appendingPathComponent("ViewController.swift")
39+
let baseProjectPath = sampleProjectTempURL.appendingPathComponent("PagingLayout")
40+
let viewControllerPath = baseProjectPath.appendingPathComponent("ViewController.swift")
3941
try? FileManager.default.removeItem(at: viewControllerPath)
4042

4143
let code = getCode(includeViewController: true)
4244
try? code.write(to: viewControllerPath, atomically: true, encoding: .utf8)
45+
46+
try? FileManager.default.moveItem(at: sampleProjectTempURL.appendingPathComponent("PagingLayout.xcodeproj_sample"),
47+
to: sampleProjectTempURL.appendingPathComponent("PagingLayout.xcodeproj"))
48+
49+
let projectURL = sampleProjectTempURL.appendingPathComponent("PagingLayout.xcodeproj")
50+
51+
try? FileManager.default.moveItem(at: projectURL.appendingPathComponent("project.pbxproj_sample"),
52+
to: projectURL.appendingPathComponent("project.pbxproj"))
53+
54+
try? FileManager.default.moveItem(at: projectURL.appendingPathComponent("project.xcworkspace_sample"),
55+
to: projectURL.appendingPathComponent("project.xcworkspace"))
56+
57+
try? FileManager.default.moveItem(at: baseProjectPath.appendingPathComponent("info_sample.plist"),
58+
to: baseProjectPath.appendingPathComponent("info.plist"))
4359
}
4460

4561
func removeSampleProject() {

Samples/PagingLayoutSamples/SampleProject/PagingLayout.xcodeproj/project.pbxproj renamed to Samples/PagingLayoutSamples/SampleProject.bundle/SampleProject/PagingLayout.xcodeproj_sample/project.pbxproj_sample

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,14 +276,16 @@
276276
isa = XCBuildConfiguration;
277277
buildSettings = {
278278
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
279-
CODE_SIGN_STYLE = Automatic;
279+
CODE_SIGN_STYLE = Manual;
280+
DEVELOPMENT_TEAM = "";
280281
INFOPLIST_FILE = PagingLayout/Info.plist;
281282
LD_RUNPATH_SEARCH_PATHS = (
282283
"$(inherited)",
283284
"@executable_path/Frameworks",
284285
);
285286
PRODUCT_BUNDLE_IDENTIFIER = com.none.PagingLayout;
286287
PRODUCT_NAME = "$(TARGET_NAME)";
288+
PROVISIONING_PROFILE_SPECIFIER = "";
287289
SWIFT_VERSION = 5.0;
288290
TARGETED_DEVICE_FAMILY = 1;
289291
};
@@ -293,14 +295,16 @@
293295
isa = XCBuildConfiguration;
294296
buildSettings = {
295297
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
296-
CODE_SIGN_STYLE = Automatic;
298+
CODE_SIGN_STYLE = Manual;
299+
DEVELOPMENT_TEAM = "";
297300
INFOPLIST_FILE = PagingLayout/Info.plist;
298301
LD_RUNPATH_SEARCH_PATHS = (
299302
"$(inherited)",
300303
"@executable_path/Frameworks",
301304
);
302305
PRODUCT_BUNDLE_IDENTIFIER = com.none.PagingLayout;
303306
PRODUCT_NAME = "$(TARGET_NAME)";
307+
PROVISIONING_PROFILE_SPECIFIER = "";
304308
SWIFT_VERSION = 5.0;
305309
TARGETED_DEVICE_FAMILY = 1;
306310
};

Samples/PagingLayoutSamples/SampleProject/PagingLayout.xcodeproj/project.xcworkspace/contents.xcworkspacedata renamed to Samples/PagingLayoutSamples/SampleProject.bundle/SampleProject/PagingLayout.xcodeproj_sample/project.xcworkspace_sample/contents.xcworkspacedata

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)