[macos] build: add build-number and buid-name arguments (#53928)
This commit is contained in:
parent
35ed1ccc9a
commit
3441743c5c
@ -23,6 +23,8 @@ class BuildMacosCommand extends BuildSubCommand {
|
|||||||
addBuildModeFlags();
|
addBuildModeFlags();
|
||||||
addDartObfuscationOption();
|
addDartObfuscationOption();
|
||||||
usesExtraFrontendOptions();
|
usesExtraFrontendOptions();
|
||||||
|
usesBuildNumberOption();
|
||||||
|
usesBuildNameOption();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -211,6 +211,34 @@ void main() {
|
|||||||
FeatureFlags: () => TestFeatureFlags(isMacOSEnabled: true),
|
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', () {
|
testUsingContext('Refuses to build for macOS when feature is disabled', () {
|
||||||
final CommandRunner<void> runner = createTestCommandRunner(BuildCommand());
|
final CommandRunner<void> runner = createTestCommandRunner(BuildCommand());
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user