Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
32b22b85
Unverified
Commit
32b22b85
authored
Jun 16, 2022
by
Jesús S Guerrero
Committed by
GitHub
Jun 16, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
parse build version on xcodeproj (#105908)
parent
ddeb0b99
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
26 additions
and
3 deletions
+26
-3
xcodeproj.dart
packages/flutter_tools/lib/src/ios/xcodeproj.dart
+14
-2
xcode.dart
packages/flutter_tools/lib/src/macos/xcode.dart
+2
-0
xcode_validator.dart
packages/flutter_tools/lib/src/macos/xcode_validator.dart
+3
-0
xcodeproj_test.dart
.../flutter_tools/test/general.shard/ios/xcodeproj_test.dart
+2
-0
xcode_validator_test.dart
..._tools/test/general.shard/macos/xcode_validator_test.dart
+2
-1
context.dart
packages/flutter_tools/test/src/context.dart
+3
-0
No files found.
packages/flutter_tools/lib/src/ios/xcodeproj.dart
View file @
32b22b85
...
@@ -47,6 +47,7 @@ class XcodeProjectInterpreter {
...
@@ -47,6 +47,7 @@ class XcodeProjectInterpreter {
required
FileSystem
fileSystem
,
required
FileSystem
fileSystem
,
required
Usage
usage
,
required
Usage
usage
,
Version
?
version
,
Version
?
version
,
String
?
build
,
})
:
_platform
=
platform
,
})
:
_platform
=
platform
,
_fileSystem
=
fileSystem
,
_fileSystem
=
fileSystem
,
_logger
=
logger
,
_logger
=
logger
,
...
@@ -58,6 +59,7 @@ class XcodeProjectInterpreter {
...
@@ -58,6 +59,7 @@ class XcodeProjectInterpreter {
processManager:
processManager
,
processManager:
processManager
,
),
),
_version
=
version
,
_version
=
version
,
_build
=
build
,
_versionText
=
version
?.
toString
(),
_versionText
=
version
?.
toString
(),
_usage
=
usage
;
_usage
=
usage
;
...
@@ -70,6 +72,7 @@ class XcodeProjectInterpreter {
...
@@ -70,6 +72,7 @@ class XcodeProjectInterpreter {
factory
XcodeProjectInterpreter
.
test
({
factory
XcodeProjectInterpreter
.
test
({
required
ProcessManager
processManager
,
required
ProcessManager
processManager
,
Version
?
version
=
const
Version
.
withText
(
1000
,
0
,
0
,
'1000.0.0'
),
Version
?
version
=
const
Version
.
withText
(
1000
,
0
,
0
,
'1000.0.0'
),
String
?
build
=
'13C100'
,
})
{
})
{
final
Platform
platform
=
FakePlatform
(
final
Platform
platform
=
FakePlatform
(
operatingSystem:
'macos'
,
operatingSystem:
'macos'
,
...
@@ -82,6 +85,7 @@ class XcodeProjectInterpreter {
...
@@ -82,6 +85,7 @@ class XcodeProjectInterpreter {
usage:
TestUsage
(),
usage:
TestUsage
(),
logger:
BufferLogger
.
test
(),
logger:
BufferLogger
.
test
(),
version:
version
,
version:
version
,
build:
build
,
);
);
}
}
...
@@ -91,8 +95,7 @@ class XcodeProjectInterpreter {
...
@@ -91,8 +95,7 @@ class XcodeProjectInterpreter {
final
OperatingSystemUtils
_operatingSystemUtils
;
final
OperatingSystemUtils
_operatingSystemUtils
;
final
Logger
_logger
;
final
Logger
_logger
;
final
Usage
_usage
;
final
Usage
_usage
;
static
final
RegExp
_versionRegex
=
RegExp
(
r'Xcode ([0-9.]+).*Build version (\w+)'
);
static
final
RegExp
_versionRegex
=
RegExp
(
r'Xcode ([0-9.]+)'
);
void
_updateVersion
()
{
void
_updateVersion
()
{
if
(!
_platform
.
isMacOS
||
!
_fileSystem
.
file
(
'/usr/bin/xcodebuild'
).
existsSync
())
{
if
(!
_platform
.
isMacOS
||
!
_fileSystem
.
file
(
'/usr/bin/xcodebuild'
).
existsSync
())
{
...
@@ -118,6 +121,7 @@ class XcodeProjectInterpreter {
...
@@ -118,6 +121,7 @@ class XcodeProjectInterpreter {
final
int
minorVersion
=
components
.
length
<
2
?
0
:
int
.
parse
(
components
[
1
]);
final
int
minorVersion
=
components
.
length
<
2
?
0
:
int
.
parse
(
components
[
1
]);
final
int
patchVersion
=
components
.
length
<
3
?
0
:
int
.
parse
(
components
[
2
]);
final
int
patchVersion
=
components
.
length
<
3
?
0
:
int
.
parse
(
components
[
2
]);
_version
=
Version
(
majorVersion
,
minorVersion
,
patchVersion
);
_version
=
Version
(
majorVersion
,
minorVersion
,
patchVersion
);
_build
=
match
.
group
(
2
);
}
on
ProcessException
{
}
on
ProcessException
{
// Ignored, leave values null.
// Ignored, leave values null.
}
}
...
@@ -134,6 +138,7 @@ class XcodeProjectInterpreter {
...
@@ -134,6 +138,7 @@ class XcodeProjectInterpreter {
}
}
Version
?
_version
;
Version
?
_version
;
String
?
_build
;
Version
?
get
version
{
Version
?
get
version
{
if
(
_version
==
null
)
{
if
(
_version
==
null
)
{
_updateVersion
();
_updateVersion
();
...
@@ -141,6 +146,13 @@ class XcodeProjectInterpreter {
...
@@ -141,6 +146,13 @@ class XcodeProjectInterpreter {
return
_version
;
return
_version
;
}
}
String
?
get
build
{
if
(
_build
==
null
)
{
_updateVersion
();
}
return
_build
;
}
/// The `xcrun` Xcode command to run or locate development
/// The `xcrun` Xcode command to run or locate development
/// tools and properties.
/// tools and properties.
///
///
...
...
packages/flutter_tools/lib/src/macos/xcode.dart
View file @
32b22b85
...
@@ -101,6 +101,8 @@ class Xcode {
...
@@ -101,6 +101,8 @@ class Xcode {
Version
?
get
currentVersion
=>
_xcodeProjectInterpreter
.
version
;
Version
?
get
currentVersion
=>
_xcodeProjectInterpreter
.
version
;
String
?
get
buildVersion
=>
_xcodeProjectInterpreter
.
build
;
String
?
get
versionText
=>
_xcodeProjectInterpreter
.
versionText
;
String
?
get
versionText
=>
_xcodeProjectInterpreter
.
versionText
;
bool
?
_eulaSigned
;
bool
?
_eulaSigned
;
...
...
packages/flutter_tools/lib/src/macos/xcode_validator.dart
View file @
32b22b85
...
@@ -37,6 +37,9 @@ class XcodeValidator extends DoctorValidator {
...
@@ -37,6 +37,9 @@ class XcodeValidator extends DoctorValidator {
xcodeVersionInfo
=
xcodeVersionInfo
.
substring
(
0
,
xcodeVersionInfo
.
indexOf
(
','
));
xcodeVersionInfo
=
xcodeVersionInfo
.
substring
(
0
,
xcodeVersionInfo
.
indexOf
(
','
));
}
}
}
}
if
(
_xcode
.
buildVersion
!=
null
)
{
messages
.
add
(
ValidationMessage
(
'Build
${_xcode.buildVersion}
'
));
}
if
(!
_xcode
.
isInstalledAndMeetsVersionCheck
)
{
if
(!
_xcode
.
isInstalledAndMeetsVersionCheck
)
{
xcodeStatus
=
ValidationType
.
partial
;
xcodeStatus
=
ValidationType
.
partial
;
messages
.
add
(
ValidationMessage
.
error
(
_userMessages
.
xcodeOutdated
(
xcodeRequiredVersion
.
toString
())));
messages
.
add
(
ValidationMessage
.
error
(
_userMessages
.
xcodeOutdated
(
xcodeRequiredVersion
.
toString
())));
...
...
packages/flutter_tools/test/general.shard/ios/xcodeproj_test.dart
View file @
32b22b85
...
@@ -146,6 +146,7 @@ void main() {
...
@@ -146,6 +146,7 @@ void main() {
]);
]);
expect
(
xcodeProjectInterpreter
.
version
,
Version
(
11
,
4
,
1
));
expect
(
xcodeProjectInterpreter
.
version
,
Version
(
11
,
4
,
1
));
expect
(
xcodeProjectInterpreter
.
build
,
'11N111s'
);
expect
(
fakeProcessManager
,
hasNoRemainingExpectations
);
expect
(
fakeProcessManager
,
hasNoRemainingExpectations
);
});
});
...
@@ -173,6 +174,7 @@ void main() {
...
@@ -173,6 +174,7 @@ void main() {
),
),
]);
]);
expect
(
xcodeProjectInterpreter
.
version
,
isNull
);
expect
(
xcodeProjectInterpreter
.
version
,
isNull
);
expect
(
xcodeProjectInterpreter
.
build
,
isNull
);
expect
(
fakeProcessManager
,
hasNoRemainingExpectations
);
expect
(
fakeProcessManager
,
hasNoRemainingExpectations
);
});
});
...
...
packages/flutter_tools/test/general.shard/macos/xcode_validator_test.dart
View file @
32b22b85
...
@@ -183,11 +183,12 @@ void main() {
...
@@ -183,11 +183,12 @@ void main() {
final
XcodeValidator
validator
=
XcodeValidator
(
xcode:
xcode
,
userMessages:
UserMessages
());
final
XcodeValidator
validator
=
XcodeValidator
(
xcode:
xcode
,
userMessages:
UserMessages
());
final
ValidationResult
result
=
await
validator
.
validate
();
final
ValidationResult
result
=
await
validator
.
validate
();
expect
(
result
.
type
,
ValidationType
.
installed
);
expect
(
result
.
type
,
ValidationType
.
installed
);
expect
(
result
.
messages
.
length
,
1
);
expect
(
result
.
messages
.
length
,
2
);
final
ValidationMessage
firstMessage
=
result
.
messages
.
first
;
final
ValidationMessage
firstMessage
=
result
.
messages
.
first
;
expect
(
firstMessage
.
type
,
ValidationMessageType
.
information
);
expect
(
firstMessage
.
type
,
ValidationMessageType
.
information
);
expect
(
firstMessage
.
message
,
'Xcode at /Library/Developer/CommandLineTools'
);
expect
(
firstMessage
.
message
,
'Xcode at /Library/Developer/CommandLineTools'
);
expect
(
result
.
statusInfo
,
'1000.0.0'
);
expect
(
result
.
statusInfo
,
'1000.0.0'
);
expect
(
result
.
messages
[
1
].
message
,
'Build 13C100'
);
});
});
});
});
}
}
packages/flutter_tools/test/src/context.dart
View file @
32b22b85
...
@@ -296,6 +296,9 @@ class FakeXcodeProjectInterpreter implements XcodeProjectInterpreter {
...
@@ -296,6 +296,9 @@ class FakeXcodeProjectInterpreter implements XcodeProjectInterpreter {
@override
@override
Version
get
version
=>
Version
(
13
,
null
,
null
);
Version
get
version
=>
Version
(
13
,
null
,
null
);
@override
String
get
build
=>
'13C100'
;
@override
@override
Future
<
Map
<
String
,
String
>>
getBuildSettings
(
Future
<
Map
<
String
,
String
>>
getBuildSettings
(
String
projectPath
,
{
String
projectPath
,
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment