@@ -48,46 +48,9 @@ Future<void> main() async {
4848 await _tryMacOSLint (macosintegrationTestPodspec, < String > []);
4949 });
5050
51- section ('Create Objective-C plugin' );
51+ section ('Create plugin' );
5252
53- const String objcPluginName = 'test_plugin_objc' ;
54- await inDirectory (tempDir, () async {
55- await flutter (
56- 'create' ,
57- options: < String > [
58- '--org' ,
59- 'io.flutter.devicelab' ,
60- '--template=plugin' ,
61- '--platforms=ios,android' ,
62- '--ios-language=objc' ,
63- objcPluginName,
64- ],
65- );
66- });
67-
68- section ('Lint Objective-C iOS podspec plugin as framework' );
69-
70- final String objcPluginPath = path.join (tempDir.path, objcPluginName);
71- final String objcPodspecPath = path.join (objcPluginPath, 'ios' , '$objcPluginName .podspec' );
72- await inDirectory (tempDir, () async {
73- await exec ('pod' , < String > ['lib' , 'lint' , objcPodspecPath, '--allow-warnings' ]);
74- });
75-
76- section ('Lint Objective-C iOS podspec plugin as library' );
77-
78- await inDirectory (tempDir, () async {
79- await exec ('pod' , < String > [
80- 'lib' ,
81- 'lint' ,
82- objcPodspecPath,
83- '--allow-warnings' ,
84- '--use-libraries' ,
85- ]);
86- });
87-
88- section ('Create Swift plugin' );
89-
90- const String swiftPluginName = 'test_plugin_swift' ;
53+ const String pluginName = 'test_plugin' ;
9154 await inDirectory (tempDir, () async {
9255 await flutter (
9356 'create' ,
@@ -96,44 +59,39 @@ Future<void> main() async {
9659 'io.flutter.devicelab' ,
9760 '--template=plugin' ,
9861 '--platforms=ios,macos' ,
99- '--ios-language=swift' ,
100- swiftPluginName,
62+ pluginName,
10163 ],
10264 );
10365 });
10466
105- section ('Lint Swift iOS podspec plugin as framework' );
67+ section ('Lint iOS podspec plugin as framework' );
10668
107- final String swiftPluginPath = path.join (tempDir.path, swiftPluginName );
108- final String swiftPodspecPath = path.join (swiftPluginPath , 'ios' , '$swiftPluginName .podspec' );
69+ final String pluginPath = path.join (tempDir.path, pluginName );
70+ final String podspecPath = path.join (pluginPath , 'ios' , '$pluginName .podspec' );
10971 await inDirectory (tempDir, () async {
110- await exec ('pod' , < String > ['lib' , 'lint' , swiftPodspecPath , '--allow-warnings' ]);
72+ await exec ('pod' , < String > ['lib' , 'lint' , podspecPath , '--allow-warnings' ]);
11173 });
11274
113- section ('Lint Swift iOS podspec plugin as library' );
75+ section ('Lint iOS podspec plugin as library' );
11476
11577 await inDirectory (tempDir, () async {
11678 await exec ('pod' , < String > [
11779 'lib' ,
11880 'lint' ,
119- swiftPodspecPath ,
81+ podspecPath ,
12082 '--allow-warnings' ,
12183 '--use-libraries' ,
12284 ]);
12385 });
12486
125- section ('Lint Swift macOS podspec plugin as framework' );
87+ section ('Lint macOS podspec plugin as framework' );
12688
127- final String macOSPodspecPath = path.join (
128- swiftPluginPath,
129- 'macos' ,
130- '$swiftPluginName .podspec' ,
131- );
89+ final String macOSPodspecPath = path.join (pluginPath, 'macos' , '$pluginName .podspec' );
13290 await inDirectory (tempDir, () async {
13391 await _tryMacOSLint (macOSPodspecPath, < String > ['--allow-warnings' ]);
13492 });
13593
136- section ('Lint Swift macOS podspec plugin as library' );
94+ section ('Lint macOS podspec plugin as library' );
13795
13896 await inDirectory (tempDir, () async {
13997 await _tryMacOSLint (macOSPodspecPath, < String > ['--allow-warnings' , '--use-libraries' ]);
@@ -149,7 +107,7 @@ Future<void> main() async {
149107 );
150108 });
151109
152- section ('Build iOS application with Swift and Objective-C plugins as frameworks' );
110+ section ('Build iOS application with plugins as frameworks' );
153111
154112 final String appPath = path.join (tempDir.path, iosAppName);
155113
@@ -160,7 +118,7 @@ Future<void> main() async {
160118 // Add the new plugins we just made.
161119 pubspecContent = pubspecContent.replaceFirst (
162120 '\n dependencies:\n ' ,
163- '\n dependencies:\n $objcPluginName :\n path: $objcPluginPath \n $ swiftPluginName : \n path: $ swiftPluginPath \n url_launcher: 6.0.16\n url_launcher_macos:\n ' ,
121+ '\n dependencies:\n $pluginName :\n path: $pluginPath \n url_launcher: 6.0.16\n url_launcher_macos:\n ' ,
164122 );
165123 pubspec.writeAsStringSync (pubspecContent, flush: true );
166124
@@ -174,7 +132,7 @@ Future<void> main() async {
174132 return TaskResult .failure ('Expected default Podfile to contain use_frameworks' );
175133 }
176134
177- section ('Build iOS application with Swift and Objective-C plugins as libraries' );
135+ section ('Build iOS application with plugins as libraries' );
178136
179137 iosPodfileContent = iosPodfileContent.replaceAll ('use_frameworks!' , '' );
180138 iosPodfile.writeAsStringSync (iosPodfileContent, flush: true );
@@ -198,26 +156,15 @@ Future<void> main() async {
198156
199157 _validateMacOSPodfile (appPath);
200158
201- section ('Build macOS application with plugins as libraries' );
202-
203- macosPodfileContent = macosPodfileContent.replaceAll ('use_frameworks!' , '' );
204- macOSPodfile.writeAsStringSync (macosPodfileContent, flush: true );
205-
206- await inDirectory (appPath, () async {
207- await flutter ('build' , options: < String > ['macos' ]);
208- });
209-
210- _validateMacOSPodfile (appPath);
211-
212159 section ('Remove iOS support from plugin' );
213160
214- Directory (path.join (objcPluginPath , 'ios' )).deleteSync (recursive: true );
161+ Directory (path.join (pluginPath , 'ios' )).deleteSync (recursive: true );
215162
216163 const String iosPlatformMap = '''
217164 ios:
218- pluginClass: TestPluginObjcPlugin ''' ;
165+ pluginClass: TestPlugin ''' ;
219166
220- final File pluginPubspec = File (path.join (objcPluginPath , 'pubspec.yaml' ));
167+ final File pluginPubspec = File (path.join (pluginPath , 'pubspec.yaml' ));
221168 String pluginPubspecContent = pluginPubspec.readAsStringSync ();
222169 if (! pluginPubspecContent.contains (iosPlatformMap)) {
223170 return TaskResult .failure ('Plugin pubspec.yaml missing iOS platform map' );
@@ -237,10 +184,9 @@ Future<void> main() async {
237184 final String podfileLockOutput = podfileLockFile.readAsStringSync ();
238185 if (! podfileLockOutput.contains (':path: ".symlinks/plugins/url_launcher_ios/ios"' ) ||
239186 ! podfileLockOutput.contains (':path: Flutter' )
240- // test_plugin_objc no longer supports iOS, shouldn't be present.
187+ // test_plugin no longer supports iOS, shouldn't be present.
241188 ||
242- podfileLockOutput.contains (':path: ".symlinks/plugins/test_plugin_objc/ios"' ) ||
243- ! podfileLockOutput.contains (':path: ".symlinks/plugins/test_plugin_swift/ios"' )) {
189+ podfileLockOutput.contains (':path: ".symlinks/plugins/test_plugin/ios"' )) {
244190 print (podfileLockOutput);
245191 return TaskResult .failure ('Podfile.lock does not contain expected pods' );
246192 }
@@ -249,10 +195,19 @@ Future<void> main() async {
249195
250196 checkDirectoryExists (path.join (pluginSymlinks, 'url_launcher_ios' , 'ios' ));
251197
252- checkDirectoryExists (path.join (pluginSymlinks, 'test_plugin_swift' , 'ios' ));
198+ // test_plugin no longer supports iOS, shouldn't exist!
199+ checkDirectoryNotExists (path.join (pluginSymlinks, 'test_plugin' ));
253200
254- // test_plugin_objc no longer supports iOS, shouldn't exist!
255- checkDirectoryNotExists (path.join (pluginSymlinks, 'test_plugin_objc' ));
201+ section ('Build macOS application with plugins as libraries' );
202+
203+ macosPodfileContent = macosPodfileContent.replaceAll ('use_frameworks!' , '' );
204+ macOSPodfile.writeAsStringSync (macosPodfileContent, flush: true );
205+
206+ await inDirectory (appPath, () async {
207+ await flutter ('build' , options: < String > ['macos' ]);
208+ });
209+
210+ _validateMacOSPodfile (appPath);
256211
257212 return TaskResult .success (null );
258213 } catch (e, stackTrace) {
@@ -271,8 +226,7 @@ void _validateIosPodfile(String appPath) {
271226 final String podfileLockOutput = podfileLockFile.readAsStringSync ();
272227 if (! podfileLockOutput.contains (':path: ".symlinks/plugins/url_launcher_ios/ios"' ) ||
273228 ! podfileLockOutput.contains (':path: Flutter' ) ||
274- ! podfileLockOutput.contains (':path: ".symlinks/plugins/test_plugin_objc/ios"' ) ||
275- ! podfileLockOutput.contains (':path: ".symlinks/plugins/test_plugin_swift/ios"' ) ||
229+ ! podfileLockOutput.contains (':path: ".symlinks/plugins/test_plugin/ios"' ) ||
276230 podfileLockOutput.contains ('url_launcher_macos' )) {
277231 print (podfileLockOutput);
278232 throw TaskResult .failure ('iOS Podfile.lock does not contain expected pods' );
@@ -288,9 +242,7 @@ void _validateIosPodfile(String appPath) {
288242
289243 checkDirectoryNotExists (path.join (pluginSymlinks, 'url_launcher_macos' ));
290244
291- checkDirectoryExists (path.join (pluginSymlinks, 'test_plugin_objc' , 'ios' ));
292-
293- checkDirectoryExists (path.join (pluginSymlinks, 'test_plugin_swift' , 'ios' ));
245+ checkDirectoryExists (path.join (pluginSymlinks, 'test_plugin' , 'ios' ));
294246
295247 // Make sure no Xcode build settings are leaking derived data/build directory into the ios directory.
296248 checkDirectoryNotExists (path.join (appPath, 'ios' , 'build' ));
@@ -305,9 +257,7 @@ void _validateMacOSPodfile(String appPath) {
305257 ! podfileLockOutput.contains (
306258 ':path: Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos' ,
307259 ) ||
308- ! podfileLockOutput.contains (
309- ':path: Flutter/ephemeral/.symlinks/plugins/test_plugin_swift/macos' ,
310- ) ||
260+ ! podfileLockOutput.contains (':path: Flutter/ephemeral/.symlinks/plugins/test_plugin/macos' ) ||
311261 podfileLockOutput.contains ('url_launcher_ios/' )) {
312262 print (podfileLockOutput);
313263 throw TaskResult .failure ('macOS Podfile.lock does not contain expected pods' );
@@ -328,7 +278,7 @@ void _validateMacOSPodfile(String appPath) {
328278
329279 checkDirectoryNotExists (path.join (pluginSymlinks, 'url_launcher_ios' ));
330280
331- checkDirectoryExists (path.join (pluginSymlinks, 'test_plugin_swift ' , 'macos' ));
281+ checkDirectoryExists (path.join (pluginSymlinks, 'test_plugin ' , 'macos' ));
332282}
333283
334284Future <void > _tryMacOSLint (String podspecPath, List <String > extraArguments) async {
0 commit comments