Skip to content

Commit 145df4a

Browse files
jmagmanEgor
authored and
Egor
committed
[in_app_purchase] Add example test target to Podfile, add OCMock dependency (flutter#3145)
1 parent 6ece587 commit 145df4a

File tree

4 files changed

+87
-16
lines changed

4 files changed

+87
-16
lines changed

packages/in_app_purchase/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.3.4+14
2+
3+
* Add test target to iOS example app Podfile
4+
15
## 0.3.4+13
26

37
* Android Code Inspection and Clean up.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Uncomment this line to define a global platform for your project
2+
# platform :ios, '9.0'
3+
4+
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
5+
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
6+
7+
project 'Runner', {
8+
'Debug' => :debug,
9+
'Profile' => :release,
10+
'Release' => :release,
11+
}
12+
13+
def flutter_root
14+
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
15+
unless File.exist?(generated_xcode_build_settings_path)
16+
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
17+
end
18+
19+
File.foreach(generated_xcode_build_settings_path) do |line|
20+
matches = line.match(/FLUTTER_ROOT\=(.*)/)
21+
return matches[1].strip if matches
22+
end
23+
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
24+
end
25+
26+
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
27+
28+
flutter_ios_podfile_setup
29+
30+
target 'Runner' do
31+
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
32+
33+
target 'in_app_purchase_pluginTests' do
34+
inherit! :search_paths
35+
36+
# Matches in_app_purchase test_spec dependency.
37+
pod 'OCMock','3.5'
38+
end
39+
end
40+
41+
post_install do |installer|
42+
installer.pods_project.targets.each do |target|
43+
flutter_additional_ios_build_settings(target)
44+
end
45+
end

packages/in_app_purchase/example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 37 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,11 @@
99
/* Begin PBXBuildFile section */
1010
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
1111
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
12-
3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; };
13-
3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
12+
523686A0BE5A2D2269D4F386 /* libPods-in_app_purchase_pluginTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E20838C66ABCD8667B0BB95D /* libPods-in_app_purchase_pluginTests.a */; };
1413
688DE35121F2A5A100EA2684 /* TranslatorTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 688DE35021F2A5A100EA2684 /* TranslatorTest.m */; };
1514
6896B34621E9363700D37AEF /* ProductRequestHandlerTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 6896B34521E9363700D37AEF /* ProductRequestHandlerTest.m */; };
1615
6896B34C21EEB4B800D37AEF /* Stubs.m in Sources */ = {isa = PBXBuildFile; fileRef = 6896B34B21EEB4B800D37AEF /* Stubs.m */; };
1716
861D0D93B0757D95C8A69620 /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B2AB6BE1D4E2232AB5D4A002 /* libPods-Runner.a */; };
18-
9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; };
19-
9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
2017
978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; };
2118
97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; };
2219
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
@@ -44,8 +41,6 @@
4441
dstPath = "";
4542
dstSubfolderSpec = 10;
4643
files = (
47-
3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */,
48-
9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */,
4944
);
5045
name = "Embed Frameworks";
5146
runOnlyForDeploymentPostprocessing = 0;
@@ -56,7 +51,6 @@
5651
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
5752
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
5853
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
59-
3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = "<group>"; };
6054
688DE35021F2A5A100EA2684 /* TranslatorTest.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = TranslatorTest.m; path = ../../../ios/Tests/TranslatorTest.m; sourceTree = "<group>"; };
6155
6896B34521E9363700D37AEF /* ProductRequestHandlerTest.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = ProductRequestHandlerTest.m; path = ../../../ios/Tests/ProductRequestHandlerTest.m; sourceTree = "<group>"; };
6256
6896B34A21EEB4B800D37AEF /* Stubs.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Stubs.h; path = ../../../ios/Tests/Stubs.h; sourceTree = "<group>"; };
@@ -66,7 +60,6 @@
6660
7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
6761
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
6862
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
69-
9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = "<group>"; };
7063
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
7164
97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
7265
97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
@@ -77,9 +70,12 @@
7770
A59001A421E69658004A3E5E /* in_app_purchase_pluginTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = in_app_purchase_pluginTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
7871
A59001A621E69658004A3E5E /* InAppPurchasePluginTest.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = InAppPurchasePluginTest.m; path = ../../../ios/Tests/InAppPurchasePluginTest.m; sourceTree = "<group>"; };
7972
A59001A821E69658004A3E5E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
73+
ACAF3B1D3B61187149C0FF81 /* Pods-in_app_purchase_pluginTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-in_app_purchase_pluginTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-in_app_purchase_pluginTests/Pods-in_app_purchase_pluginTests.release.xcconfig"; sourceTree = "<group>"; };
8074
B2AB6BE1D4E2232AB5D4A002 /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; };
8175
BE95F46E12942F78BF67E55B /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
76+
CC2B3FFB29B2574DEDD718A6 /* Pods-in_app_purchase_pluginTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-in_app_purchase_pluginTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-in_app_purchase_pluginTests/Pods-in_app_purchase_pluginTests.debug.xcconfig"; sourceTree = "<group>"; };
8277
DE7EEEE26E27ACC04BA9951D /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
78+
E20838C66ABCD8667B0BB95D /* libPods-in_app_purchase_pluginTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-in_app_purchase_pluginTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
8379
F78AF3132342BC89008449C7 /* PaymentQueueTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PaymentQueueTest.m; path = ../../../ios/Tests/PaymentQueueTest.m; sourceTree = "<group>"; };
8480
/* End PBXFileReference section */
8581

@@ -88,8 +84,6 @@
8884
isa = PBXFrameworksBuildPhase;
8985
buildActionMask = 2147483647;
9086
files = (
91-
9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */,
92-
3B80C3941E831B6300D905FE /* App.framework in Frameworks */,
9387
861D0D93B0757D95C8A69620 /* libPods-Runner.a in Frameworks */,
9488
A5279298219369C600FF69E6 /* StoreKit.framework in Frameworks */,
9589
);
@@ -99,6 +93,7 @@
9993
isa = PBXFrameworksBuildPhase;
10094
buildActionMask = 2147483647;
10195
files = (
96+
523686A0BE5A2D2269D4F386 /* libPods-in_app_purchase_pluginTests.a in Frameworks */,
10297
);
10398
runOnlyForDeploymentPostprocessing = 0;
10499
};
@@ -110,16 +105,16 @@
110105
children = (
111106
DE7EEEE26E27ACC04BA9951D /* Pods-Runner.debug.xcconfig */,
112107
BE95F46E12942F78BF67E55B /* Pods-Runner.release.xcconfig */,
108+
CC2B3FFB29B2574DEDD718A6 /* Pods-in_app_purchase_pluginTests.debug.xcconfig */,
109+
ACAF3B1D3B61187149C0FF81 /* Pods-in_app_purchase_pluginTests.release.xcconfig */,
113110
);
114111
name = Pods;
115112
sourceTree = "<group>";
116113
};
117114
9740EEB11CF90186004384FC /* Flutter */ = {
118115
isa = PBXGroup;
119116
children = (
120-
3B80C3931E831B6300D905FE /* App.framework */,
121117
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
122-
9740EEBA1CF902C7004384FC /* Flutter.framework */,
123118
9740EEB21CF90195004384FC /* Debug.xcconfig */,
124119
7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
125120
9740EEB31CF90195004384FC /* Generated.xcconfig */,
@@ -191,6 +186,7 @@
191186
children = (
192187
A5279297219369C600FF69E6 /* StoreKit.framework */,
193188
B2AB6BE1D4E2232AB5D4A002 /* libPods-Runner.a */,
189+
E20838C66ABCD8667B0BB95D /* libPods-in_app_purchase_pluginTests.a */,
194190
);
195191
name = Frameworks;
196192
sourceTree = "<group>";
@@ -224,6 +220,7 @@
224220
isa = PBXNativeTarget;
225221
buildConfigurationList = A59001AD21E69658004A3E5E /* Build configuration list for PBXNativeTarget "in_app_purchase_pluginTests" */;
226222
buildPhases = (
223+
4EA84B170943DF9C4A2CF33C /* [CP] Check Pods Manifest.lock */,
227224
A59001A021E69658004A3E5E /* Sources */,
228225
A59001A121E69658004A3E5E /* Frameworks */,
229226
A59001A221E69658004A3E5E /* Resources */,
@@ -316,7 +313,29 @@
316313
);
317314
runOnlyForDeploymentPostprocessing = 0;
318315
shellPath = /bin/sh;
319-
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin";
316+
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
317+
};
318+
4EA84B170943DF9C4A2CF33C /* [CP] Check Pods Manifest.lock */ = {
319+
isa = PBXShellScriptBuildPhase;
320+
buildActionMask = 2147483647;
321+
files = (
322+
);
323+
inputFileListPaths = (
324+
);
325+
inputPaths = (
326+
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
327+
"${PODS_ROOT}/Manifest.lock",
328+
);
329+
name = "[CP] Check Pods Manifest.lock";
330+
outputFileListPaths = (
331+
);
332+
outputPaths = (
333+
"$(DERIVED_FILE_DIR)/Pods-in_app_purchase_pluginTests-checkManifestLockResult.txt",
334+
);
335+
runOnlyForDeploymentPostprocessing = 0;
336+
shellPath = /bin/sh;
337+
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";
338+
showEnvVarsInLog = 0;
320339
};
321340
5DF63B80D489A62B306EA07A /* [CP] Check Pods Manifest.lock */ = {
322341
isa = PBXShellScriptBuildPhase;
@@ -356,9 +375,12 @@
356375
files = (
357376
);
358377
inputPaths = (
378+
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
379+
"${PODS_ROOT}/../Flutter/Flutter.framework",
359380
);
360381
name = "[CP] Embed Pods Frameworks";
361382
outputPaths = (
383+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework",
362384
);
363385
runOnlyForDeploymentPostprocessing = 0;
364386
shellPath = /bin/sh;
@@ -422,7 +444,6 @@
422444
/* Begin XCBuildConfiguration section */
423445
97C147031CF9000F007C117D /* Debug */ = {
424446
isa = XCBuildConfiguration;
425-
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
426447
buildSettings = {
427448
ALWAYS_SEARCH_USER_PATHS = NO;
428449
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
@@ -479,7 +500,6 @@
479500
};
480501
97C147041CF9000F007C117D /* Release */ = {
481502
isa = XCBuildConfiguration;
482-
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
483503
buildSettings = {
484504
ALWAYS_SEARCH_USER_PATHS = NO;
485505
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
@@ -576,6 +596,7 @@
576596
};
577597
A59001AB21E69658004A3E5E /* Debug */ = {
578598
isa = XCBuildConfiguration;
599+
baseConfigurationReference = CC2B3FFB29B2574DEDD718A6 /* Pods-in_app_purchase_pluginTests.debug.xcconfig */;
579600
buildSettings = {
580601
BUNDLE_LOADER = "$(TEST_HOST)";
581602
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
@@ -597,6 +618,7 @@
597618
};
598619
A59001AC21E69658004A3E5E /* Release */ = {
599620
isa = XCBuildConfiguration;
621+
baseConfigurationReference = ACAF3B1D3B61187149C0FF81 /* Pods-in_app_purchase_pluginTests.release.xcconfig */;
600622
buildSettings = {
601623
BUNDLE_LOADER = "$(TEST_HOST)";
602624
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;

packages/in_app_purchase/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: in_app_purchase
22
description: A Flutter plugin for in-app purchases. Exposes APIs for making in-app purchases through the App Store and Google Play.
33
homepage: https://github.com/flutter/plugins/tree/master/packages/in_app_purchase
4-
version: 0.3.4+13
4+
version: 0.3.4+14
55

66
dependencies:
77
async: ^2.0.8

0 commit comments

Comments
 (0)