Skip to content

Commit 4ca445d

Browse files
committed
add import in test compile
1 parent 8038a04 commit 4ca445d

File tree

3 files changed

+127
-17
lines changed

3 files changed

+127
-17
lines changed

test/Binary.xcodeproj/project.pbxproj

Lines changed: 75 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,29 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10+
3E1E218020A0B66900EFA102 /* import.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E1E217F20A0B66900EFA102 /* import.swift */; };
1011
3E83E326207BC00E0057855A /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E83E325207BC00E0057855A /* AppDelegate.swift */; };
1112
3E83E328207BC00E0057855A /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E83E327207BC00E0057855A /* ViewController.swift */; };
13+
AEBC61E3160A9AC38C3A210D /* Pods_Binary.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5687B1A81F152DBEF5CD4432 /* Pods_Binary.framework */; };
1214
/* End PBXBuildFile section */
1315

1416
/* Begin PBXFileReference section */
17+
1856F5E2BE44EDB1E470521A /* Pods-Binary.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Binary.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Binary/Pods-Binary.debug.xcconfig"; sourceTree = "<group>"; };
18+
3E1E217F20A0B66900EFA102 /* import.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = import.swift; sourceTree = "<group>"; };
1519
3E83E322207BC00E0057855A /* Binary.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Binary.app; sourceTree = BUILT_PRODUCTS_DIR; };
1620
3E83E325207BC00E0057855A /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
1721
3E83E327207BC00E0057855A /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
1822
3E83E331207BC0120057855A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
23+
5687B1A81F152DBEF5CD4432 /* Pods_Binary.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Binary.framework; sourceTree = BUILT_PRODUCTS_DIR; };
24+
7EB848DBE64BD495BCC04ECC /* Pods-Binary.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Binary.release.xcconfig"; path = "Pods/Target Support Files/Pods-Binary/Pods-Binary.release.xcconfig"; sourceTree = "<group>"; };
1925
/* End PBXFileReference section */
2026

2127
/* Begin PBXFrameworksBuildPhase section */
2228
3E83E31F207BC00E0057855A /* Frameworks */ = {
2329
isa = PBXFrameworksBuildPhase;
2430
buildActionMask = 2147483647;
2531
files = (
32+
AEBC61E3160A9AC38C3A210D /* Pods_Binary.framework in Frameworks */,
2633
);
2734
runOnlyForDeploymentPostprocessing = 0;
2835
};
@@ -34,6 +41,8 @@
3441
children = (
3542
3E83E324207BC00E0057855A /* Binary */,
3643
3E83E323207BC00E0057855A /* Products */,
44+
E8117D681BF19C1B3D847824 /* Pods */,
45+
8E13F0A6AED19C681C2CD7D5 /* Frameworks */,
3746
);
3847
sourceTree = "<group>";
3948
};
@@ -50,21 +59,41 @@
5059
children = (
5160
3E83E325207BC00E0057855A /* AppDelegate.swift */,
5261
3E83E327207BC00E0057855A /* ViewController.swift */,
62+
3E1E217F20A0B66900EFA102 /* import.swift */,
5363
3E83E331207BC0120057855A /* Info.plist */,
5464
);
5565
path = Binary;
5666
sourceTree = "<group>";
5767
};
68+
8E13F0A6AED19C681C2CD7D5 /* Frameworks */ = {
69+
isa = PBXGroup;
70+
children = (
71+
5687B1A81F152DBEF5CD4432 /* Pods_Binary.framework */,
72+
);
73+
name = Frameworks;
74+
sourceTree = "<group>";
75+
};
76+
E8117D681BF19C1B3D847824 /* Pods */ = {
77+
isa = PBXGroup;
78+
children = (
79+
1856F5E2BE44EDB1E470521A /* Pods-Binary.debug.xcconfig */,
80+
7EB848DBE64BD495BCC04ECC /* Pods-Binary.release.xcconfig */,
81+
);
82+
name = Pods;
83+
sourceTree = "<group>";
84+
};
5885
/* End PBXGroup section */
5986

6087
/* Begin PBXNativeTarget section */
6188
3E83E321207BC00E0057855A /* Binary */ = {
6289
isa = PBXNativeTarget;
6390
buildConfigurationList = 3E83E334207BC0120057855A /* Build configuration list for PBXNativeTarget "Binary" */;
6491
buildPhases = (
92+
3E002C27AE1ACBCE5F745FA7 /* [CP] Check Pods Manifest.lock */,
6593
3E83E31E207BC00E0057855A /* Sources */,
6694
3E83E31F207BC00E0057855A /* Frameworks */,
6795
3E83E320207BC00E0057855A /* Resources */,
96+
9937F6A880D56826534273F0 /* [CP] Embed Pods Frameworks */,
6897
);
6998
buildRules = (
7099
);
@@ -118,12 +147,54 @@
118147
};
119148
/* End PBXResourcesBuildPhase section */
120149

150+
/* Begin PBXShellScriptBuildPhase section */
151+
3E002C27AE1ACBCE5F745FA7 /* [CP] Check Pods Manifest.lock */ = {
152+
isa = PBXShellScriptBuildPhase;
153+
buildActionMask = 2147483647;
154+
files = (
155+
);
156+
inputPaths = (
157+
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
158+
"${PODS_ROOT}/Manifest.lock",
159+
);
160+
name = "[CP] Check Pods Manifest.lock";
161+
outputPaths = (
162+
"$(DERIVED_FILE_DIR)/Pods-Binary-checkManifestLockResult.txt",
163+
);
164+
runOnlyForDeploymentPostprocessing = 0;
165+
shellPath = /bin/sh;
166+
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";
167+
showEnvVarsInLog = 0;
168+
};
169+
9937F6A880D56826534273F0 /* [CP] Embed Pods Frameworks */ = {
170+
isa = PBXShellScriptBuildPhase;
171+
buildActionMask = 2147483647;
172+
files = (
173+
);
174+
inputPaths = (
175+
"${SRCROOT}/Pods/Target Support Files/Pods-Binary/Pods-Binary-frameworks.sh",
176+
"${PODS_ROOT}/AFNetworking/AFNetworking.framework",
177+
"${PODS_ROOT}/Literal/Literal.framework",
178+
);
179+
name = "[CP] Embed Pods Frameworks";
180+
outputPaths = (
181+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/AFNetworking.framework",
182+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Literal.framework",
183+
);
184+
runOnlyForDeploymentPostprocessing = 0;
185+
shellPath = /bin/sh;
186+
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Binary/Pods-Binary-frameworks.sh\"\n";
187+
showEnvVarsInLog = 0;
188+
};
189+
/* End PBXShellScriptBuildPhase section */
190+
121191
/* Begin PBXSourcesBuildPhase section */
122192
3E83E31E207BC00E0057855A /* Sources */ = {
123193
isa = PBXSourcesBuildPhase;
124194
buildActionMask = 2147483647;
125195
files = (
126196
3E83E328207BC00E0057855A /* ViewController.swift in Sources */,
197+
3E1E218020A0B66900EFA102 /* import.swift in Sources */,
127198
3E83E326207BC00E0057855A /* AppDelegate.swift in Sources */,
128199
);
129200
runOnlyForDeploymentPostprocessing = 0;
@@ -247,13 +318,11 @@
247318
};
248319
3E83E335207BC0120057855A /* Debug */ = {
249320
isa = XCBuildConfiguration;
321+
baseConfigurationReference = 1856F5E2BE44EDB1E470521A /* Pods-Binary.debug.xcconfig */;
250322
buildSettings = {
251323
CODE_SIGN_STYLE = Automatic;
252324
INFOPLIST_FILE = Binary/Info.plist;
253-
LD_RUNPATH_SEARCH_PATHS = (
254-
"$(inherited)",
255-
"@executable_path/Frameworks",
256-
);
325+
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
257326
PRODUCT_BUNDLE_IDENTIFIER = me.leavez.Binary;
258327
PRODUCT_NAME = "$(TARGET_NAME)";
259328
SWIFT_VERSION = 4.0;
@@ -263,13 +332,11 @@
263332
};
264333
3E83E336207BC0120057855A /* Release */ = {
265334
isa = XCBuildConfiguration;
335+
baseConfigurationReference = 7EB848DBE64BD495BCC04ECC /* Pods-Binary.release.xcconfig */;
266336
buildSettings = {
267337
CODE_SIGN_STYLE = Automatic;
268338
INFOPLIST_FILE = Binary/Info.plist;
269-
LD_RUNPATH_SEARCH_PATHS = (
270-
"$(inherited)",
271-
"@executable_path/Frameworks",
272-
);
339+
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
273340
PRODUCT_BUNDLE_IDENTIFIER = me.leavez.Binary;
274341
PRODUCT_NAME = "$(TARGET_NAME)";
275342
SWIFT_VERSION = 4.0;

test/Binary/import.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
import Literal
3+
import AFNetworking
4+
import Instabug

test/change_podfile.py

Lines changed: 48 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,65 +16,104 @@ def save_to_podfile(text):
1616
path = os.path.dirname(os.path.abspath(__file__))
1717
path += "/Podfile"
1818
file = open(path, "w+")
19-
file.write(text)
19+
file.write(text[0])
20+
file.close()
21+
22+
path = os.path.dirname(os.path.abspath(__file__))
23+
path += "/Binary/import.swift"
24+
file = open(path, "w+")
25+
file.write(text[1])
2026
file.close()
2127

2228

29+
2330
def initial():
24-
return wrapper(
31+
return (wrapper(
2532
"""
2633
pod "Masonry"
34+
"""),
35+
"""
36+
import Masonry
2737
""")
2838

2939
def addSwiftPod():
30-
return wrapper(
40+
return (wrapper(
3141
"""
3242
pod "Masonry", :binary => true
3343
pod "Literal", :binary => true
44+
"""),
45+
"""
46+
import Masonry
47+
import Literal
3448
""")
3549

3650
def addDifferentNamePod():
37-
return wrapper(
51+
return (wrapper(
3852
"""
3953
enable_bitcode_for_prebuilt_frameworks!
4054
4155
pod "Masonry", :binary => true
4256
pod "Literal", :binary => true
4357
pod "lottie-ios", :binary => true
58+
"""),
59+
"""
60+
import Masonry
61+
import Literal
62+
import Lottie
4463
""")
4564

65+
4666
def addSubPod():
47-
return wrapper(
67+
return (wrapper(
4868
"""
4969
pod "Masonry", :binary => true
5070
pod "Literal", :binary => true
5171
pod "lottie-ios", :binary => true
5272
pod "AFNetworking/Reachability", :binary => true
73+
""") ,
74+
"""
75+
import Masonry
76+
import Literal
77+
import Lottie
78+
import AFNetworking
5379
""")
5480

5581
def addVendoredLibPod():
56-
return wrapper(
82+
return (wrapper(
5783
"""
5884
pod "Literal", :binary => true
5985
pod "AFNetworking/Reachability", :binary => true
6086
pod "Instabug", :binary => true
61-
pod "GrowingID", :binary => true
87+
pod "GrowingIO", :binary => true
88+
""") ,
89+
"""
90+
import Literal
91+
import AFNetworking
92+
import Instabug
6293
""")
6394

6495
def deleteAPod():
65-
return wrapper(
96+
return (wrapper(
6697
"""
6798
pod "Literal", :binary => true
6899
pod "AFNetworking/Reachability", :binary => true
100+
""") ,
101+
"""
102+
import Literal
103+
import AFNetworking
69104
""")
70105

71106
def universalFlag():
72-
return wrapper(
107+
return (wrapper(
73108
"""
74109
all_binary!
75110
76111
pod "Literal"
77112
pod "AFNetworking/Reachability"
113+
""") ,
114+
"""
115+
import Literal
116+
import AFNetworking
78117
""")
79118

80119

0 commit comments

Comments
 (0)