Clean App.framework, Generated.xcconfig, flutter_export_environment.sh (#51532)
This commit is contained in:
parent
080dfb5eb3
commit
4fb9ce8414
@ -43,20 +43,16 @@ class CleanCommand extends FlutterCommand {
|
|||||||
|
|
||||||
deleteFile(flutterProject.dartTool);
|
deleteFile(flutterProject.dartTool);
|
||||||
|
|
||||||
final Directory androidEphemeralDirectory = flutterProject.android.ephemeralDirectory;
|
deleteFile(flutterProject.android.ephemeralDirectory);
|
||||||
deleteFile(androidEphemeralDirectory);
|
|
||||||
|
|
||||||
final Directory iosEphemeralDirectory = flutterProject.ios.ephemeralDirectory;
|
deleteFile(flutterProject.ios.ephemeralDirectory);
|
||||||
deleteFile(iosEphemeralDirectory);
|
deleteFile(flutterProject.ios.generatedXcodePropertiesFile);
|
||||||
|
deleteFile(flutterProject.ios.generatedEnvironmentVariableExportScript);
|
||||||
|
deleteFile(flutterProject.ios.compiledDartFramework);
|
||||||
|
|
||||||
final Directory linuxEphemeralDirectory = flutterProject.linux.ephemeralDirectory;
|
deleteFile(flutterProject.linux.ephemeralDirectory);
|
||||||
deleteFile(linuxEphemeralDirectory);
|
deleteFile(flutterProject.macos.ephemeralDirectory);
|
||||||
|
deleteFile(flutterProject.windows.ephemeralDirectory);
|
||||||
final Directory macosEphemeralDirectory = flutterProject.macos.ephemeralDirectory;
|
|
||||||
deleteFile(macosEphemeralDirectory);
|
|
||||||
|
|
||||||
final Directory windowsEphemeralDirectory = flutterProject.windows.ephemeralDirectory;
|
|
||||||
deleteFile(windowsEphemeralDirectory);
|
|
||||||
|
|
||||||
return const FlutterCommandResult(ExitStatus.success);
|
return const FlutterCommandResult(ExitStatus.success);
|
||||||
}
|
}
|
||||||
@ -73,7 +69,7 @@ class CleanCommand extends FlutterCommand {
|
|||||||
final Directory xcodeWorkspace = xcodeProject.xcodeWorkspace;
|
final Directory xcodeWorkspace = xcodeProject.xcodeWorkspace;
|
||||||
final XcodeProjectInfo projectInfo = await xcodeProjectInterpreter.getInfo(xcodeWorkspace.parent.path);
|
final XcodeProjectInfo projectInfo = await xcodeProjectInterpreter.getInfo(xcodeWorkspace.parent.path);
|
||||||
for (final String scheme in projectInfo.schemes) {
|
for (final String scheme in projectInfo.schemes) {
|
||||||
xcodeProjectInterpreter.cleanWorkspace(xcodeWorkspace.path, scheme);
|
await xcodeProjectInterpreter.cleanWorkspace(xcodeWorkspace.path, scheme);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
globals.printTrace('Could not clean Xcode workspace: $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');
|
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 {
|
Future<void> diagnoseXcodeBuildFailure(XcodeBuildResult result) async {
|
||||||
if (result.xcodeBuildExecution != null &&
|
if (result.xcodeBuildExecution != null &&
|
||||||
result.xcodeBuildExecution.buildForPhysicalDevice &&
|
result.xcodeBuildExecution.buildForPhysicalDevice &&
|
||||||
|
@ -357,8 +357,8 @@ class XcodeProjectInterpreter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void cleanWorkspace(String workspacePath, String scheme) {
|
Future<void> cleanWorkspace(String workspacePath, String scheme) async {
|
||||||
_processUtils.runSync(<String>[
|
await _processUtils.run(<String>[
|
||||||
_executable,
|
_executable,
|
||||||
'-workspace',
|
'-workspace',
|
||||||
workspacePath,
|
workspacePath,
|
||||||
|
@ -567,6 +567,10 @@ class IosProject extends FlutterProjectPlatform implements XcodeBasedProject {
|
|||||||
.childDirectory('Flutter')
|
.childDirectory('Flutter')
|
||||||
.childFile('Generated.xcconfig');
|
.childFile('Generated.xcconfig');
|
||||||
|
|
||||||
|
Directory get compiledDartFramework => _flutterLibRoot
|
||||||
|
.childDirectory('Flutter')
|
||||||
|
.childDirectory('App.framework');
|
||||||
|
|
||||||
Directory get pluginRegistrantHost {
|
Directory get pluginRegistrantHost {
|
||||||
return isModule
|
return isModule
|
||||||
? _flutterLibRoot
|
? _flutterLibRoot
|
||||||
|
@ -44,7 +44,12 @@ void main() {
|
|||||||
|
|
||||||
projectUnderTest.dartTool.createSync(recursive: true);
|
projectUnderTest.dartTool.createSync(recursive: true);
|
||||||
projectUnderTest.android.ephemeralDirectory.createSync(recursive: true);
|
projectUnderTest.android.ephemeralDirectory.createSync(recursive: true);
|
||||||
|
|
||||||
projectUnderTest.ios.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.linux.ephemeralDirectory.createSync(recursive: true);
|
||||||
projectUnderTest.macos.ephemeralDirectory.createSync(recursive: true);
|
projectUnderTest.macos.ephemeralDirectory.createSync(recursive: true);
|
||||||
projectUnderTest.windows.ephemeralDirectory.createSync(recursive: true);
|
projectUnderTest.windows.ephemeralDirectory.createSync(recursive: true);
|
||||||
@ -57,7 +62,12 @@ void main() {
|
|||||||
expect(buildDirectory.existsSync(), isFalse);
|
expect(buildDirectory.existsSync(), isFalse);
|
||||||
expect(projectUnderTest.dartTool.existsSync(), isFalse);
|
expect(projectUnderTest.dartTool.existsSync(), isFalse);
|
||||||
expect(projectUnderTest.android.ephemeralDirectory.existsSync(), isFalse);
|
expect(projectUnderTest.android.ephemeralDirectory.existsSync(), isFalse);
|
||||||
|
|
||||||
expect(projectUnderTest.ios.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.linux.ephemeralDirectory.existsSync(), isFalse);
|
||||||
expect(projectUnderTest.macos.ephemeralDirectory.existsSync(), isFalse);
|
expect(projectUnderTest.macos.ephemeralDirectory.existsSync(), isFalse);
|
||||||
expect(projectUnderTest.windows.ephemeralDirectory.existsSync(), isFalse);
|
expect(projectUnderTest.windows.ephemeralDirectory.existsSync(), isFalse);
|
||||||
|
@ -224,12 +224,12 @@ void main() {
|
|||||||
'FLUTTER_XCODE_CODE_SIGN_STYLE': 'Manual',
|
'FLUTTER_XCODE_CODE_SIGN_STYLE': 'Manual',
|
||||||
'FLUTTER_XCODE_ARCHS': 'arm64'
|
'FLUTTER_XCODE_ARCHS': 'arm64'
|
||||||
});
|
});
|
||||||
when(processManager.runSync(
|
when(processManager.run(
|
||||||
any,
|
any,
|
||||||
workingDirectory: anyNamed('workingDirectory')))
|
workingDirectory: anyNamed('workingDirectory')))
|
||||||
.thenReturn(ProcessResult(1, 0, '', ''));
|
.thenAnswer((_) => Future<ProcessResult>.value(ProcessResult(1, 0, '', '')));
|
||||||
xcodeProjectInterpreter.cleanWorkspace('workspace_path', 'Runner');
|
await xcodeProjectInterpreter.cleanWorkspace('workspace_path', 'Runner');
|
||||||
final List<dynamic> captured = verify(processManager.runSync(
|
final List<dynamic> captured = verify(processManager.run(
|
||||||
captureAny,
|
captureAny,
|
||||||
workingDirectory: anyNamed('workingDirectory'),
|
workingDirectory: anyNamed('workingDirectory'),
|
||||||
environment: anyNamed('environment'))).captured;
|
environment: anyNamed('environment'))).captured;
|
||||||
|
@ -386,7 +386,8 @@ class FakeXcodeProjectInterpreter implements XcodeProjectInterpreter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void cleanWorkspace(String workspacePath, String scheme) {
|
Future<void> cleanWorkspace(String workspacePath, String scheme) {
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
Loading…
x
Reference in New Issue
Block a user