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
cf661358
Unverified
Commit
cf661358
authored
Aug 01, 2019
by
Jonah Williams
Committed by
GitHub
Aug 01, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
only build macOS kernel in debug mode (#37365)
parent
2b03e208
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
16 additions
and
41 deletions
+16
-41
macos_build_flutter_assets.sh
packages/flutter_tools/bin/macos_build_flutter_assets.sh
+2
-2
build.dart
packages/flutter_tools/lib/src/commands/build.dart
+1
-1
build_macos.dart
packages/flutter_tools/lib/src/commands/build_macos.dart
+2
-13
build_macos.dart
packages/flutter_tools/lib/src/macos/build_macos.dart
+3
-2
macos_device.dart
packages/flutter_tools/lib/src/macos/macos_device.dart
+5
-2
build_macos_test.dart
...r_tools/test/general.shard/commands/build_macos_test.dart
+3
-3
macos_device_test.dart
...ter_tools/test/general.shard/macos/macos_device_test.dart
+0
-18
No files found.
packages/flutter_tools/bin/macos_build_flutter_assets.sh
View file @
cf661358
...
...
@@ -80,7 +80,7 @@ RunCommand "${FLUTTER_ROOT}/bin/flutter" --suppress-analytics \
precache
\
--no-android
\
--no-ios
\
--macos
\
--macos
# TODO(jonahwilliams): support flavors https://github.com/flutter/flutter/issues/32923
RunCommand
"
${
FLUTTER_ROOT
}
/bin/flutter"
--suppress-analytics
\
...
...
@@ -90,7 +90,7 @@ RunCommand "${FLUTTER_ROOT}/bin/flutter" --suppress-analytics \
assemble
\
-dTargetFile
=
"
${
target_path
}
"
\
-dTargetPlatform
=
darwin-x64
\
-dBuildMode
=
"
${
build_mode
}
"
\
-dBuildMode
=
debug
\
--build-inputs
=
"
${
build_inputs_path
}
"
\
--build-outputs
=
"
${
build_outputs_path
}
"
\
"
${
build_target
}
"
packages/flutter_tools/lib/src/commands/build.dart
View file @
cf661358
...
...
@@ -27,7 +27,7 @@ class BuildCommand extends FlutterCommand {
addSubcommand
(
BuildIOSCommand
());
addSubcommand
(
BuildBundleCommand
(
verboseHelp:
verboseHelp
));
addSubcommand
(
BuildWebCommand
());
addSubcommand
(
BuildMacosCommand
());
addSubcommand
(
BuildMacosCommand
(
verboseHelp:
verboseHelp
));
addSubcommand
(
BuildLinuxCommand
());
addSubcommand
(
BuildWindowsCommand
());
addSubcommand
(
BuildFuchsiaCommand
(
verboseHelp:
verboseHelp
));
...
...
packages/flutter_tools/lib/src/commands/build_macos.dart
View file @
cf661358
...
...
@@ -16,20 +16,9 @@ import 'build.dart';
/// A command to build a macOS desktop target through a build shell script.
class
BuildMacosCommand
extends
BuildSubCommand
{
BuildMacosCommand
()
{
BuildMacosCommand
(
{
bool
verboseHelp
}
)
{
usesTargetOption
();
argParser
.
addFlag
(
'debug'
,
negatable:
false
,
help:
'Build a debug version of your app.'
,
);
argParser
.
addFlag
(
'profile'
,
negatable:
false
,
help:
'Build a version of your app specialized for performance profiling.'
);
argParser
.
addFlag
(
'release'
,
negatable:
false
,
help:
'Build a version of your app specialized for performance profiling.'
,
);
addBuildModeFlags
(
verboseHelp:
verboseHelp
);
}
@override
...
...
packages/flutter_tools/lib/src/macos/build_macos.dart
View file @
cf661358
...
...
@@ -30,9 +30,10 @@ Future<PrebuiltMacOSApp> buildMacOS({
projectDir:
flutterProject
.
directory
,
buildDir:
flutterProject
.
dartTool
.
childDirectory
(
'flutter_build'
),
defines:
<
String
,
String
>{
kBuildMode:
buildInfo
.
isDebug
==
true
?
'debug'
:
'release'
,
// TODO(jonahwilliams): support other build types.
kBuildMode:
'debug'
,
kTargetPlatform:
'darwin-x64'
,
kTargetFile:
fs
.
file
(
targetOverride
).
absolute
.
path
kTargetFile:
targetOverride
,
},
);
...
...
packages/flutter_tools/lib/src/macos/macos_device.dart
View file @
cf661358
...
...
@@ -69,6 +69,8 @@ class MacOSDevice extends Device {
@override
Future
<
String
>
get
sdkNameAndVersion
async
=>
os
.
name
;
String
_cachedExecutable
;
@override
Future
<
LaunchResult
>
startApp
(
covariant
MacOSApp
package
,
{
...
...
@@ -92,6 +94,7 @@ class MacOSDevice extends Device {
targetOverride:
mainPath
,
);
}
_cachedExecutable
=
prebuiltMacOSApp
.
executable
;
// Ensure that the executable is locatable.
if
(
prebuiltMacOSApp
==
null
)
{
...
...
@@ -127,8 +130,8 @@ class MacOSDevice extends Device {
// TODO(jonahwilliams): implement using process manager.
// currently we rely on killing the isolate taking down the application.
@override
Future
<
bool
>
stopApp
(
covariant
Prebuilt
MacOSApp
app
)
async
{
return
killProcess
(
app
.
e
xecutable
);
Future
<
bool
>
stopApp
(
covariant
MacOSApp
app
)
async
{
return
killProcess
(
_cachedE
xecutable
);
}
@override
...
...
packages/flutter_tools/test/general.shard/commands/build_macos_test.dart
View file @
cf661358
...
...
@@ -79,7 +79,7 @@ void main() {
FeatureFlags:
()
=>
TestFeatureFlags
(
isMacOSEnabled:
true
),
});
testUsingContext
(
'macOS build invokes
build script
'
,
()
async
{
testUsingContext
(
'macOS build invokes
xcode build
'
,
()
async
{
final
BuildCommand
command
=
BuildCommand
();
applyMocksToCommand
(
command
);
fs
.
directory
(
'macos'
).
createSync
();
...
...
@@ -91,8 +91,8 @@ void main() {
projectDir:
flutterProject
.
directory
,
buildDir:
flutterProject
.
dartTool
.
childDirectory
(
'flutter_build'
),
defines:
<
String
,
String
>{
kBuildMode:
'
release
'
,
kTargetFile:
fs
.
path
.
absolute
(
fs
.
path
.
join
(
'lib'
,
'main.dart'
))
,
kBuildMode:
'
debug
'
,
kTargetFile:
'lib/main.dart'
,
kTargetPlatform:
'darwin-x64'
,
}
);
...
...
packages/flutter_tools/test/general.shard/macos/macos_device_test.dart
View file @
cf661358
...
...
@@ -48,24 +48,6 @@ void main() {
ProcessManager:
()
=>
mockProcessManager
,
});
testUsingContext
(
'stopApp'
,
()
async
{
const
String
psOut
=
r''
'
tester 17193 0.0 0.2 4791128 37820 ?? S 2:27PM 0:00.09 /Applications/foo
'''
;
final
MockMacOSApp
mockMacOSApp
=
MockMacOSApp
();
when
(
mockMacOSApp
.
executable
).
thenReturn
(
'tester'
);
when
(
mockProcessManager
.
run
(<
String
>[
'ps'
,
'aux'
])).
thenAnswer
((
Invocation
invocation
)
async
{
return
ProcessResult
(
1
,
0
,
psOut
,
''
);
});
when
(
mockProcessManager
.
run
(<
String
>[
'kill'
,
'17193'
])).
thenAnswer
((
Invocation
invocation
)
async
{
return
ProcessResult
(
2
,
0
,
''
,
''
);
});
expect
(
await
device
.
stopApp
(
mockMacOSApp
),
true
);
verify
(
mockProcessManager
.
run
(<
String
>[
'kill'
,
'17193'
]));
},
overrides:
<
Type
,
Generator
>{
ProcessManager:
()
=>
mockProcessManager
,
});
group
(
'startApp'
,
()
{
MockMacOSApp
macOSApp
;
MockFileSystem
mockFileSystem
;
...
...
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