Unverified Commit 3441743c authored by Herbert Poul's avatar Herbert Poul Committed by GitHub

[macos] build: add build-number and buid-name arguments (#53928)

parent 35ed1ccc
......@@ -23,6 +23,8 @@ class BuildMacosCommand extends BuildSubCommand {
addBuildModeFlags();
addDartObfuscationOption();
usesExtraFrontendOptions();
usesBuildNumberOption();
usesBuildNameOption();
}
@override
......
......@@ -211,6 +211,34 @@ void main() {
FeatureFlags: () => TestFeatureFlags(isMacOSEnabled: true),
});
testUsingContext('macOS build supports build-name and build-number', () async {
final BuildCommand command = BuildCommand();
createMinimalMockProjectFiles();
await createTestCommandRunner(command).run(
const <String>[
'build',
'macos',
'--debug',
'--build-name=1.2.3',
'--build-number=42',
],
);
final String contents = fileSystem
.file('./macos/Flutter/ephemeral/Flutter-Generated.xcconfig')
.readAsStringSync();
expect(contents, contains('FLUTTER_BUILD_NAME=1.2.3'));
expect(contents, contains('FLUTTER_BUILD_NUMBER=42'));
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
ProcessManager: () => FakeProcessManager.list(<FakeCommand>[
setUpMockXcodeBuildHandler('Debug')
]),
Platform: () => macosPlatform,
FeatureFlags: () => TestFeatureFlags(isMacOSEnabled: true),
});
testUsingContext('Refuses to build for macOS when feature is disabled', () {
final CommandRunner<void> runner = createTestCommandRunner(BuildCommand());
......
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