Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
0b14213
Initial commit of adding MacOS support.
IVLIVS-III Sep 29, 2022
889977a
Updated version and changelog.
IVLIVS-III Sep 29, 2022
587855d
Updated documentation.
IVLIVS-III Sep 29, 2022
ef56e75
Added missing license comments.
IVLIVS-III Sep 29, 2022
518e1ee
Fixed podspec lint issue.
IVLIVS-III Sep 29, 2022
1d93e23
Moved native tests to a shared location.
IVLIVS-III Sep 29, 2022
013943a
Decreased minimum macOS version from 10.15 to 10.11.
IVLIVS-III Sep 29, 2022
80f1d3e
Added RunnerTests target to macos example.
IVLIVS-III Sep 29, 2022
2425d2c
Unified macOS capitalization.
IVLIVS-III Oct 7, 2022
388b956
Deleted generated macOS icon assets.
IVLIVS-III Oct 7, 2022
e56276b
Removed empty function overrides.
IVLIVS-III Oct 7, 2022
8865423
Enabled tests for macOS.
IVLIVS-III Oct 23, 2022
60cad62
Added OCMock to RunnerTests target.
IVLIVS-III Oct 26, 2022
699a49a
Adapted tests for macOS.
IVLIVS-III Oct 26, 2022
e6d65fa
Merge branch 'flutter:main' into iap_macos/storekit
IVLIVS-III Oct 29, 2022
231089f
Reverted relative path dependencies.
IVLIVS-III Nov 11, 2022
93a8c17
Updated to a proper version bump.
IVLIVS-III Nov 11, 2022
c2a6a33
Make macOS no-op tests run only on iOS.
IVLIVS-III Nov 11, 2022
b4e810f
Replace directory symlinks with file symlinks.
IVLIVS-III Nov 11, 2022
ac2fef9
Marked iOS-only API as iOS-only.
IVLIVS-III Nov 11, 2022
8fce70c
Re-worded doc-comment.
IVLIVS-III Nov 11, 2022
5b1ec11
Formatted code.
IVLIVS-III Nov 11, 2022
6dc218c
Merge branch 'flutter:main' into iap_macos/storekit
IVLIVS-III Nov 11, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added RunnerTests target to macos example.
  • Loading branch information
IVLIVS-III committed Oct 26, 2022
commit 80f1d3e0603b4b5717f2124c9208fb8462152d4d
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
platform :osx, '10.11'
platform :osx, '10.15'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; };
33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; };
A2C6CD5797E6A6721FDBCA1C /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 36DEEA66738F64D983F76848 /* Pods_Runner.framework */; };
F700DD0528E652A10004836B /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F700DD0428E652A10004836B /* RunnerTests.swift */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand All @@ -37,6 +38,13 @@
remoteGlobalIDString = 33CC111A2044C6BA0003C045;
remoteInfo = FLX;
};
F700DD0628E652A10004836B /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 33CC10E52044A3C60003C045 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 33CC10EC2044A3C60003C045;
remoteInfo = Runner;
};
/* End PBXContainerItemProxy section */

/* Begin PBXCopyFilesBuildPhase section */
Expand Down Expand Up @@ -73,6 +81,8 @@
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = "<group>"; };
9A4FEABF1DEF0D106FEB7974 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
B6C8FD76BB3278AA51FED870 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
F700DD0228E652A10004836B /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
F700DD0428E652A10004836B /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand All @@ -84,6 +94,13 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
F700DCFF28E652A10004836B /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
Expand All @@ -94,7 +111,6 @@
9A4FEABF1DEF0D106FEB7974 /* Pods-Runner.release.xcconfig */,
62F1680C5AE033907C1DF7AB /* Pods-Runner.profile.xcconfig */,
);
name = Pods;
path = Pods;
sourceTree = "<group>";
};
Expand All @@ -114,6 +130,7 @@
children = (
33FAB671232836740065AC1E /* Runner */,
33CEB47122A05771004F2AC0 /* Flutter */,
F700DD0328E652A10004836B /* RunnerTests */,
33CC10EE2044A3C60003C045 /* Products */,
D73912EC22F37F3D000D13A0 /* Frameworks */,
09D47623A8E19B84FF0453EE /* Pods */,
Expand All @@ -124,6 +141,7 @@
isa = PBXGroup;
children = (
33CC10ED2044A3C60003C045 /* example.app */,
F700DD0228E652A10004836B /* RunnerTests.xctest */,
);
name = Products;
sourceTree = "<group>";
Expand Down Expand Up @@ -171,6 +189,14 @@
name = Frameworks;
sourceTree = "<group>";
};
F700DD0328E652A10004836B /* RunnerTests */ = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that you simlinked the RunnerTests folder, but you don't appear to have added any of the tests to this targets. I don't see any tests being run in CI for macOS (compare to iOS).

The Xcode project needs to be set up to run all of the tests from RunnerTests.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm… interesting, will look into this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for pointing this out. I wasn't aware that I initially setup the tests wrong for macOS. This should be fixed with 8865423.

isa = PBXGroup;
children = (
F700DD0428E652A10004836B /* RunnerTests.swift */,
);
path = RunnerTests;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
Expand All @@ -196,13 +222,31 @@
productReference = 33CC10ED2044A3C60003C045 /* example.app */;
productType = "com.apple.product-type.application";
};
F700DD0128E652A10004836B /* RunnerTests */ = {
isa = PBXNativeTarget;
buildConfigurationList = F700DD0B28E652A10004836B /* Build configuration list for PBXNativeTarget "RunnerTests" */;
buildPhases = (
F700DCFE28E652A10004836B /* Sources */,
F700DCFF28E652A10004836B /* Frameworks */,
F700DD0028E652A10004836B /* Resources */,
);
buildRules = (
);
dependencies = (
F700DD0728E652A10004836B /* PBXTargetDependency */,
);
name = RunnerTests;
productName = RunnerTests;
productReference = F700DD0228E652A10004836B /* RunnerTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
/* End PBXNativeTarget section */

/* Begin PBXProject section */
33CC10E52044A3C60003C045 /* Project object */ = {
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0920;
LastSwiftUpdateCheck = 1400;
LastUpgradeCheck = 1300;
ORGANIZATIONNAME = "";
TargetAttributes = {
Expand All @@ -220,6 +264,10 @@
CreatedOnToolsVersion = 9.2;
ProvisioningStyle = Manual;
};
F700DD0128E652A10004836B = {
CreatedOnToolsVersion = 14.0.1;
TestTargetID = 33CC10EC2044A3C60003C045;
};
};
};
buildConfigurationList = 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */;
Expand All @@ -237,6 +285,7 @@
targets = (
33CC10EC2044A3C60003C045 /* Runner */,
33CC111A2044C6BA0003C045 /* Flutter Assemble */,
F700DD0128E652A10004836B /* RunnerTests */,
);
};
/* End PBXProject section */
Expand All @@ -251,6 +300,13 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
F700DD0028E652A10004836B /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
Expand Down Expand Up @@ -343,6 +399,14 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
F700DCFE28E652A10004836B /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
F700DD0528E652A10004836B /* RunnerTests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */

/* Begin PBXTargetDependency section */
Expand All @@ -351,6 +415,11 @@
target = 33CC111A2044C6BA0003C045 /* Flutter Assemble */;
targetProxy = 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */;
};
F700DD0728E652A10004836B /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 33CC10EC2044A3C60003C045 /* Runner */;
targetProxy = F700DD0628E652A10004836B /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */

/* Begin PBXVariantGroup section */
Expand Down Expand Up @@ -596,6 +665,91 @@
};
name = Release;
};
F700DD0828E652A10004836B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GENERATE_INFOPLIST_FILE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.11;
MARKETING_VERSION = 1.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = dev.flutter.plugins.RunnerTests.RunnerTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = NO;
SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/example.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/example";
};
name = Debug;
};
F700DD0928E652A10004836B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GENERATE_INFOPLIST_FILE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.11;
MARKETING_VERSION = 1.0;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = dev.flutter.plugins.RunnerTests.RunnerTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = NO;
SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/example.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/example";
};
name = Release;
};
F700DD0A28E652A10004836B /* Profile */ = {
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GENERATE_INFOPLIST_FILE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.11;
MARKETING_VERSION = 1.0;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = dev.flutter.plugins.RunnerTests.RunnerTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = NO;
SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/example.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/example";
};
name = Profile;
};
/* End XCBuildConfiguration section */

/* Begin XCConfigurationList section */
Expand Down Expand Up @@ -629,6 +783,16 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
F700DD0B28E652A10004836B /* Build configuration list for PBXNativeTarget "RunnerTests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
F700DD0828E652A10004836B /* Debug */,
F700DD0928E652A10004836B /* Release */,
F700DD0A28E652A10004836B /* Profile */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 33CC10E52044A3C60003C045 /* Project object */;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,17 @@
</BuildableReference>
</MacroExpansion>
<Testables>
<TestableReference
skipped = "NO"
parallelizable = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "F700DD0128E652A10004836B"
BuildableName = "RunnerTests.xctest"
BlueprintName = "RunnerTests"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
//
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the purpose of this file?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Turns out, the file is not necessary after all, see this follow-up comment.

// RunnerTests.swift
// RunnerTests
//
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//

import XCTest

final class RunnerTests: XCTestCase {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these tests necessary?

From the wiki.

Write what you need and no more, but when you write it, do it right.

If the class is necessary in order for the project to compile, then I would remove any code we aren't using.

If you have other plans to implement, then you can ignore this comment.

Copy link
Contributor Author

@IVLIVS-III IVLIVS-III Oct 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The class itself is necessary, but I was able to remove all empty function overrides.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A small follow up:
I initially setup the RunnerTests target wrong for macOS. Trusting in the automatic generation, I didn't realize that a Swift-Testsuite was newly created and existing (iOS) tests written in Objective-C – tho located in the same directory – were not run on macOS.
This was corrected in 8865423 and now neither the class nor the file are necessary anymore, hence I deleted the file.


override func setUpWithError() throws {
// Put setup code here. This method is called before the invocation of each test method in the class.
}

override func tearDownWithError() throws {
// Put teardown code here. This method is called after the invocation of each test method in the class.
}

func testExample() throws {
// This is an example of a functional test case.
// Use XCTAssert and related functions to verify your tests produce the correct results.
// Any test you write for XCTest can be annotated as throws and async.
// Mark your test throws to produce an unexpected failure when your test encounters an uncaught error.
// Mark your test async to allow awaiting for asynchronous code to complete. Check the results with assertions afterwards.
}

func testPerformanceExample() throws {
// This is an example of a performance test case.
measure {
// Put the code you want to measure the time of here.
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ Downloaded by pub (not CocoaPods).
s.ios.dependency 'Flutter'
s.osx.dependency 'FlutterMacOS'
s.ios.deployment_target = '9.0'
s.osx.deployment_target = '10.11'
s.osx.deployment_target = '10.15'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://docs.google.com/document/d/1wHqr2cob78VfUKhOFEKjaUM_mnV4gL-mg3gSQCFhF7Y/edit

What will happen if the user is running 10.13 or 10.14?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I can tell, users will get a compile-time build error as was also the root cause of test failures 3 and 4 from this comment prompting them to increase their macOS deployment target to 10.15 or higher. Because of those build failures we also had to change the tool (see this separate PR).

IIRC users of cloud_firestore commonly encounter those build failures when the underlying Firebase SDK has a major version bump, dropping support for older iOS versions. As a plugin client, i.e. user, of cloud_firestore myself, I remember having to bump my deployment target a couple of times because of this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@a-wallen As mentioned above, it's not uncommon in the ecosystem for plugins to have higher minimum requirements than the minimum that Flutter itself supports. On Android, for instance, any platform view-based plugin requires 19+ or 20+ (depending on the mode).

If it turns out there are a significant number of people who really don't want to drop pre-10.15 support in order to use this plugin, we could do a follow-up to make the plugin "support" earlier versions but no-op all the methods on those versions (we have some precedent for that approach in some of our iOS plugins). I'd rather not do it if there's not demonstrated demand for it though, since having an app that uses the store but has a viable mode without the store present seems pretty niche, and it adds some annoying boilerplate throughout the plugin.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the explanations!

s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' }
end