File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed
test/commands.shard/hermetic Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,8 @@ class BuildMacosCommand extends BuildSubCommand {
23
23
addBuildModeFlags ();
24
24
addDartObfuscationOption ();
25
25
usesExtraFrontendOptions ();
26
+ usesBuildNumberOption ();
27
+ usesBuildNameOption ();
26
28
}
27
29
28
30
@override
Original file line number Diff line number Diff line change @@ -211,6 +211,34 @@ void main() {
211
211
FeatureFlags : () => TestFeatureFlags (isMacOSEnabled: true ),
212
212
});
213
213
214
+ testUsingContext ('macOS build supports build-name and build-number' , () async {
215
+ final BuildCommand command = BuildCommand ();
216
+ createMinimalMockProjectFiles ();
217
+
218
+ await createTestCommandRunner (command).run (
219
+ const < String > [
220
+ 'build' ,
221
+ 'macos' ,
222
+ '--debug' ,
223
+ '--build-name=1.2.3' ,
224
+ '--build-number=42' ,
225
+ ],
226
+ );
227
+ final String contents = fileSystem
228
+ .file ('./macos/Flutter/ephemeral/Flutter-Generated.xcconfig' )
229
+ .readAsStringSync ();
230
+
231
+ expect (contents, contains ('FLUTTER_BUILD_NAME=1.2.3' ));
232
+ expect (contents, contains ('FLUTTER_BUILD_NUMBER=42' ));
233
+ }, overrides: < Type , Generator > {
234
+ FileSystem : () => fileSystem,
235
+ ProcessManager : () => FakeProcessManager .list (< FakeCommand > [
236
+ setUpMockXcodeBuildHandler ('Debug' )
237
+ ]),
238
+ Platform : () => macosPlatform,
239
+ FeatureFlags : () => TestFeatureFlags (isMacOSEnabled: true ),
240
+ });
241
+
214
242
testUsingContext ('Refuses to build for macOS when feature is disabled' , () {
215
243
final CommandRunner <void > runner = createTestCommandRunner (BuildCommand ());
216
244
You can’t perform that action at this time.
0 commit comments