Skip to content

Commit 4988af5

Browse files
[pigeon] Convert test plugins to SPM (#9105)
Updates the test harness plugins to support SPM, so that tests won't rely on CocoaPods going forward. For now I've left CocoaPods support in the plugins and the integration in the example app, so that local tests won't rely on SPM support being on, but in the future when needing to disable it locally for testing plugins is rare we can fully remove CocoaPods from the test plugins and their apps since they aren't public plugins and thus don't need to support both modes once we don't use both ourselves. Part of flutter/flutter#146922 ## Pre-Review Checklist [^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
1 parent 6317cd6 commit 4988af5

File tree

26 files changed

+255
-69
lines changed

26 files changed

+255
-69
lines changed

packages/pigeon/platform_tests/alternate_language_test_plugin/darwin/alternate_language_test_plugin.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ A plugin to test Pigeon generation for secondary languages (e.g., Java, Objectiv
1313
s.license = { :type => 'BSD', :file => '../../../LICENSE' }
1414
s.author = { 'Your Company' => '[email protected]' }
1515
s.source = { :http => 'https://github.com/flutter/packages/tree/main/packages/pigeon' }
16-
s.source_files = 'Classes/**/*'
17-
s.public_header_files = 'Classes/**/*.h'
16+
s.source_files = 'alternate_language_test_plugin/Sources/alternate_language_test_plugin/**/*.{h,m}'
17+
s.public_header_files = 'alternate_language_test_plugin/Sources/alternate_language_test_plugin/include/**/*.h'
1818
s.ios.dependency 'Flutter'
1919
s.osx.dependency 'FlutterMacOS'
2020
s.ios.deployment_target = '12.0'
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// swift-tools-version: 5.9
2+
// The swift-tools-version declares the minimum version of Swift required to build this package.
3+
4+
// Copyright 2013 The Flutter Authors. All rights reserved.
5+
// Use of this source code is governed by a BSD-style license that can be
6+
// found in the LICENSE file.
7+
8+
import PackageDescription
9+
10+
let package = Package(
11+
name: "alternate_language_test_plugin",
12+
platforms: [
13+
.iOS("12.0"),
14+
.macOS("10.14"),
15+
],
16+
products: [
17+
.library(name: "alternate-language-test-plugin", targets: ["alternate_language_test_plugin"])
18+
],
19+
dependencies: [],
20+
targets: [
21+
.target(
22+
name: "alternate_language_test_plugin",
23+
dependencies: [],
24+
resources: [],
25+
cSettings: [
26+
.headerSearchPath("include/alternate_language_test_plugin")
27+
]
28+
)
29+
]
30+
)
File renamed without changes.
File renamed without changes.

packages/pigeon/platform_tests/alternate_language_test_plugin/darwin/Classes/CoreTests.gen.m renamed to packages/pigeon/platform_tests/alternate_language_test_plugin/darwin/alternate_language_test_plugin/Sources/alternate_language_test_plugin/CoreTests.gen.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// Autogenerated from Pigeon, do not edit directly.
66
// See also: https://pub.dev/packages/pigeon
77

8-
#import "CoreTests.gen.h"
8+
#import "./include/alternate_language_test_plugin/CoreTests.gen.h"
99

1010
#if TARGET_OS_OSX
1111
#import <FlutterMacOS/FlutterMacOS.h>
File renamed without changes.
File renamed without changes.

packages/pigeon/platform_tests/alternate_language_test_plugin/example/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@
55
*.swp
66
.DS_Store
77
.atom/
8+
.build/
89
.buildlog/
910
.history
1011
.svn/
12+
.swiftpm/
1113
migrate_working_dir/
1214

1315
# IntelliJ related

packages/pigeon/platform_tests/alternate_language_test_plugin/example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
3030
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
3131
EB2133B34553CD36D4AE374F /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F87F49FAD891F66A75D95E85 /* libPods-Runner.a */; };
32+
78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */ = {isa = PBXBuildFile; productRef = 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */; };
3233
/* End PBXBuildFile section */
3334

3435
/* Begin PBXContainerItemProxy section */
@@ -109,6 +110,7 @@
109110
isa = PBXFrameworksBuildPhase;
110111
buildActionMask = 2147483647;
111112
files = (
113+
78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */,
112114
EB2133B34553CD36D4AE374F /* libPods-Runner.a in Frameworks */,
113115
);
114116
runOnlyForDeploymentPostprocessing = 0;
@@ -240,6 +242,9 @@
240242
productType = "com.apple.product-type.bundle.unit-test";
241243
};
242244
97C146ED1CF9000F007C117D /* Runner */ = {
245+
packageProductDependencies = (
246+
78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */,
247+
);
243248
isa = PBXNativeTarget;
244249
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
245250
buildPhases = (
@@ -264,6 +269,9 @@
264269

265270
/* Begin PBXProject section */
266271
97C146E61CF9000F007C117D /* Project object */ = {
272+
packageReferences = (
273+
781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */,
274+
);
267275
isa = PBXProject;
268276
attributes = {
269277
LastUpgradeCheck = 1510;
@@ -745,6 +753,18 @@
745753
defaultConfigurationName = Release;
746754
};
747755
/* End XCConfigurationList section */
756+
/* Begin XCLocalSwiftPackageReference section */
757+
781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */ = {
758+
isa = XCLocalSwiftPackageReference;
759+
relativePath = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage;
760+
};
761+
/* End XCLocalSwiftPackageReference section */
762+
/* Begin XCSwiftPackageProductDependency section */
763+
78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */ = {
764+
isa = XCSwiftPackageProductDependency;
765+
productName = FlutterGeneratedPluginSwiftPackage;
766+
};
767+
/* End XCSwiftPackageProductDependency section */
748768
};
749769
rootObject = 97C146E61CF9000F007C117D /* Project object */;
750770
}

packages/pigeon/platform_tests/alternate_language_test_plugin/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,24 @@
55
<BuildAction
66
parallelizeBuildables = "YES"
77
buildImplicitDependencies = "YES">
8+
<PreActions>
9+
<ExecutionAction
10+
ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction">
11+
<ActionContent
12+
title = "Run Prepare Flutter Framework Script"
13+
scriptText = "/bin/sh &quot;$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh&quot; prepare&#10;">
14+
<EnvironmentBuildable>
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
18+
BuildableName = "Runner.app"
19+
BlueprintName = "Runner"
20+
ReferencedContainer = "container:Runner.xcodeproj">
21+
</BuildableReference>
22+
</EnvironmentBuildable>
23+
</ActionContent>
24+
</ExecutionAction>
25+
</PreActions>
826
<BuildActionEntries>
927
<BuildActionEntry
1028
buildForTesting = "YES"
@@ -26,6 +44,7 @@
2644
buildConfiguration = "Debug"
2745
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2846
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
47+
customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"
2948
shouldUseLaunchSchemeArgsEnv = "YES">
3049
<MacroExpansion>
3150
<BuildableReference
@@ -54,11 +73,13 @@
5473
buildConfiguration = "Debug"
5574
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
5675
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
76+
customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"
5777
launchStyle = "0"
5878
useCustomWorkingDirectory = "NO"
5979
ignoresPersistentStateOnLaunch = "NO"
6080
debugDocumentVersioning = "YES"
6181
debugServiceExtension = "internal"
82+
enableGPUValidationMode = "1"
6283
allowLocationSimulation = "YES">
6384
<BuildableProductRunnable
6485
runnableDebuggingMode = "0">

0 commit comments

Comments
 (0)