mirror of
https://github.com/flutter/flutter
synced 2024-10-13 11:42:54 +00:00
if there is no .ios or ios sub-project, don't attempt building for iOS (#31406)
This commit is contained in:
parent
872a0092e9
commit
15f271ef07
|
@ -306,8 +306,13 @@ abstract class IOSApp extends ApplicationPackage {
|
||||||
}
|
}
|
||||||
|
|
||||||
factory IOSApp.fromIosProject(IosProject project) {
|
factory IOSApp.fromIosProject(IosProject project) {
|
||||||
if (getCurrentHostPlatform() != HostPlatform.darwin_x64)
|
if (getCurrentHostPlatform() != HostPlatform.darwin_x64) {
|
||||||
return null;
|
return null;
|
||||||
|
}
|
||||||
|
// TODO(jonahwilliams): do more verification in this check.
|
||||||
|
if (!project.exists) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return BuildableIOSApp(project);
|
return BuildableIOSApp(project);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -231,6 +231,9 @@ class IosProject {
|
||||||
/// True, if the parent Flutter project is a module project.
|
/// True, if the parent Flutter project is a module project.
|
||||||
bool get isModule => parent.isModule;
|
bool get isModule => parent.isModule;
|
||||||
|
|
||||||
|
/// Whether the flutter application has an iOS project.
|
||||||
|
bool get exists => hostAppRoot.existsSync();
|
||||||
|
|
||||||
/// The xcode config file for [mode].
|
/// The xcode config file for [mode].
|
||||||
File xcodeConfigFor(String mode) => _flutterLibRoot.childDirectory('Flutter').childFile('$mode.xcconfig');
|
File xcodeConfigFor(String mode) => _flutterLibRoot.childDirectory('Flutter').childFile('$mode.xcconfig');
|
||||||
|
|
||||||
|
|
|
@ -277,6 +277,14 @@ void main() {
|
||||||
expect(iosApp.id, 'fooBundleId');
|
expect(iosApp.id, 'fooBundleId');
|
||||||
expect(iosApp.bundleName, 'bundle.app');
|
expect(iosApp.bundleName, 'bundle.app');
|
||||||
}, overrides: overrides);
|
}, overrides: overrides);
|
||||||
|
|
||||||
|
testUsingContext('returns null when there is no ios or .ios directory', () async {
|
||||||
|
fs.file('pubspec.yaml').createSync();
|
||||||
|
fs.file('.packages').createSync();
|
||||||
|
final BuildableIOSApp iosApp = IOSApp.fromIosProject((await FlutterProject.fromDirectory(fs.currentDirectory)).ios);
|
||||||
|
|
||||||
|
expect(iosApp, null);
|
||||||
|
}, overrides: overrides);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue