@@ -47,6 +47,7 @@ class XcodeProjectInterpreter {
4747 required FileSystem fileSystem,
4848 required Usage usage,
4949 Version ? version,
50+ String ? build,
5051 }) : _platform = platform,
5152 _fileSystem = fileSystem,
5253 _logger = logger,
@@ -58,6 +59,7 @@ class XcodeProjectInterpreter {
5859 processManager: processManager,
5960 ),
6061 _version = version,
62+ _build = build,
6163 _versionText = version? .toString (),
6264 _usage = usage;
6365
@@ -70,6 +72,7 @@ class XcodeProjectInterpreter {
7072 factory XcodeProjectInterpreter .test ({
7173 required ProcessManager processManager,
7274 Version ? version = const Version .withText (1000 , 0 , 0 , '1000.0.0' ),
75+ String ? build = '13C100' ,
7376 }) {
7477 final Platform platform = FakePlatform (
7578 operatingSystem: 'macos' ,
@@ -82,6 +85,7 @@ class XcodeProjectInterpreter {
8285 usage: TestUsage (),
8386 logger: BufferLogger .test (),
8487 version: version,
88+ build: build,
8589 );
8690 }
8791
@@ -91,8 +95,7 @@ class XcodeProjectInterpreter {
9195 final OperatingSystemUtils _operatingSystemUtils;
9296 final Logger _logger;
9397 final Usage _usage;
94-
95- static final RegExp _versionRegex = RegExp (r'Xcode ([0-9.]+)' );
98+ static final RegExp _versionRegex = RegExp (r'Xcode ([0-9.]+).*Build version (\w+)' );
9699
97100 void _updateVersion () {
98101 if (! _platform.isMacOS || ! _fileSystem.file ('/usr/bin/xcodebuild' ).existsSync ()) {
@@ -118,6 +121,7 @@ class XcodeProjectInterpreter {
118121 final int minorVersion = components.length < 2 ? 0 : int .parse (components[1 ]);
119122 final int patchVersion = components.length < 3 ? 0 : int .parse (components[2 ]);
120123 _version = Version (majorVersion, minorVersion, patchVersion);
124+ _build = match.group (2 );
121125 } on ProcessException {
122126 // Ignored, leave values null.
123127 }
@@ -134,13 +138,21 @@ class XcodeProjectInterpreter {
134138 }
135139
136140 Version ? _version;
141+ String ? _build;
137142 Version ? get version {
138143 if (_version == null ) {
139144 _updateVersion ();
140145 }
141146 return _version;
142147 }
143148
149+ String ? get build {
150+ if (_build == null ) {
151+ _updateVersion ();
152+ }
153+ return _build;
154+ }
155+
144156 /// The `xcrun` Xcode command to run or locate development
145157 /// tools and properties.
146158 ///
0 commit comments