Unverified Commit 4fb9ce84 authored by Jenn Magder's avatar Jenn Magder Committed by GitHub

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

parent 080dfb5e
......@@ -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');
......
......@@ -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 &&
......
......@@ -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,
......
......@@ -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
......
......@@ -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);
......
......@@ -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;
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment