Clean App.framework, Generated.xcconfig, flutter_export_environment.sh (#51532)

This commit is contained in:
Jenn Magder 2020-02-27 12:18:06 -08:00 committed by GitHub
parent 080dfb5eb3
commit 4fb9ce8414
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 31 additions and 30 deletions

View File

@ -43,20 +43,16 @@ class CleanCommand extends FlutterCommand {
deleteFile(flutterProject.dartTool);
final Directory androidEphemeralDirectory = flutterProject.android.ephemeralDirectory;
deleteFile(androidEphemeralDirectory);
deleteFile(flutterProject.android.ephemeralDirectory);
final Directory iosEphemeralDirectory = flutterProject.ios.ephemeralDirectory;
deleteFile(iosEphemeralDirectory);
deleteFile(flutterProject.ios.ephemeralDirectory);
deleteFile(flutterProject.ios.generatedXcodePropertiesFile);
deleteFile(flutterProject.ios.generatedEnvironmentVariableExportScript);
deleteFile(flutterProject.ios.compiledDartFramework);
final Directory linuxEphemeralDirectory = flutterProject.linux.ephemeralDirectory;
deleteFile(linuxEphemeralDirectory);
final Directory macosEphemeralDirectory = flutterProject.macos.ephemeralDirectory;
deleteFile(macosEphemeralDirectory);
final Directory windowsEphemeralDirectory = flutterProject.windows.ephemeralDirectory;
deleteFile(windowsEphemeralDirectory);
deleteFile(flutterProject.linux.ephemeralDirectory);
deleteFile(flutterProject.macos.ephemeralDirectory);
deleteFile(flutterProject.windows.ephemeralDirectory);
return const FlutterCommandResult(ExitStatus.success);
}
@ -73,7 +69,7 @@ class CleanCommand extends FlutterCommand {
final Directory xcodeWorkspace = xcodeProject.xcodeWorkspace;
final XcodeProjectInfo projectInfo = await xcodeProjectInterpreter.getInfo(xcodeWorkspace.parent.path);
for (final String scheme in projectInfo.schemes) {
xcodeProjectInterpreter.cleanWorkspace(xcodeWorkspace.path, scheme);
await xcodeProjectInterpreter.cleanWorkspace(xcodeWorkspace.path, scheme);
}
} catch (error) {
globals.printTrace('Could not clean Xcode workspace: $error');

View File

@ -429,16 +429,6 @@ return result.exitCode != 0 &&
result.stdout.contains('there are two concurrent builds running');
}
String readGeneratedXcconfig(String appPath) {
final String generatedXcconfigPath =
globals.fs.path.join(globals.fs.currentDirectory.path, appPath, 'Flutter', 'Generated.xcconfig');
final File generatedXcconfigFile = globals.fs.file(generatedXcconfigPath);
if (!generatedXcconfigFile.existsSync()) {
return null;
}
return generatedXcconfigFile.readAsStringSync();
}
Future<void> diagnoseXcodeBuildFailure(XcodeBuildResult result) async {
if (result.xcodeBuildExecution != null &&
result.xcodeBuildExecution.buildForPhysicalDevice &&

View File

@ -357,8 +357,8 @@ class XcodeProjectInterpreter {
}
}
void cleanWorkspace(String workspacePath, String scheme) {
_processUtils.runSync(<String>[
Future<void> cleanWorkspace(String workspacePath, String scheme) async {
await _processUtils.run(<String>[
_executable,
'-workspace',
workspacePath,

View File

@ -567,6 +567,10 @@ class IosProject extends FlutterProjectPlatform implements XcodeBasedProject {
.childDirectory('Flutter')
.childFile('Generated.xcconfig');
Directory get compiledDartFramework => _flutterLibRoot
.childDirectory('Flutter')
.childDirectory('App.framework');
Directory get pluginRegistrantHost {
return isModule
? _flutterLibRoot

View File

@ -44,7 +44,12 @@ void main() {
projectUnderTest.dartTool.createSync(recursive: true);
projectUnderTest.android.ephemeralDirectory.createSync(recursive: true);
projectUnderTest.ios.ephemeralDirectory.createSync(recursive: true);
projectUnderTest.ios.generatedXcodePropertiesFile.createSync(recursive: true);
projectUnderTest.ios.generatedEnvironmentVariableExportScript.createSync(recursive: true);
projectUnderTest.ios.compiledDartFramework.createSync(recursive: true);
projectUnderTest.linux.ephemeralDirectory.createSync(recursive: true);
projectUnderTest.macos.ephemeralDirectory.createSync(recursive: true);
projectUnderTest.windows.ephemeralDirectory.createSync(recursive: true);
@ -57,7 +62,12 @@ void main() {
expect(buildDirectory.existsSync(), isFalse);
expect(projectUnderTest.dartTool.existsSync(), isFalse);
expect(projectUnderTest.android.ephemeralDirectory.existsSync(), isFalse);
expect(projectUnderTest.ios.ephemeralDirectory.existsSync(), isFalse);
expect(projectUnderTest.ios.generatedXcodePropertiesFile.existsSync(), isFalse);
expect(projectUnderTest.ios.generatedEnvironmentVariableExportScript.existsSync(), isFalse);
expect(projectUnderTest.ios.compiledDartFramework.existsSync(), isFalse);
expect(projectUnderTest.linux.ephemeralDirectory.existsSync(), isFalse);
expect(projectUnderTest.macos.ephemeralDirectory.existsSync(), isFalse);
expect(projectUnderTest.windows.ephemeralDirectory.existsSync(), isFalse);

View File

@ -224,12 +224,12 @@ void main() {
'FLUTTER_XCODE_CODE_SIGN_STYLE': 'Manual',
'FLUTTER_XCODE_ARCHS': 'arm64'
});
when(processManager.runSync(
when(processManager.run(
any,
workingDirectory: anyNamed('workingDirectory')))
.thenReturn(ProcessResult(1, 0, '', ''));
xcodeProjectInterpreter.cleanWorkspace('workspace_path', 'Runner');
final List<dynamic> captured = verify(processManager.runSync(
.thenAnswer((_) => Future<ProcessResult>.value(ProcessResult(1, 0, '', '')));
await xcodeProjectInterpreter.cleanWorkspace('workspace_path', 'Runner');
final List<dynamic> captured = verify(processManager.run(
captureAny,
workingDirectory: anyNamed('workingDirectory'),
environment: anyNamed('environment'))).captured;

View File

@ -386,7 +386,8 @@ class FakeXcodeProjectInterpreter implements XcodeProjectInterpreter {
}
@override
void cleanWorkspace(String workspacePath, String scheme) {
Future<void> cleanWorkspace(String workspacePath, String scheme) {
return null;
}
@override