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
450a7248
Unverified
Commit
450a7248
authored
Oct 28, 2019
by
Jonah Williams
Committed by
GitHub
Oct 28, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
set trace to true for desktop builds (#43577)
parent
36d50a48
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
81 additions
and
6 deletions
+81
-6
build_linux.dart
packages/flutter_tools/lib/src/linux/build_linux.dart
+1
-1
build_macos.dart
packages/flutter_tools/lib/src/macos/build_macos.dart
+1
-1
build_windows.dart
packages/flutter_tools/lib/src/windows/build_windows.dart
+1
-1
build_linux_test.dart
..._tools/test/commands.shard/hermetic/build_linux_test.dart
+21
-1
build_macos_test.dart
..._tools/test/commands.shard/hermetic/build_macos_test.dart
+23
-1
build_windows_test.dart
...ools/test/commands.shard/hermetic/build_windows_test.dart
+34
-1
No files found.
packages/flutter_tools/lib/src/linux/build_linux.dart
View file @
450a7248
...
...
@@ -57,7 +57,7 @@ export PROJECT_DIR=${linuxProject.project.directory.path}
'-C'
,
linuxProject
.
makeFile
.
parent
.
path
,
'BUILD=
$buildFlag
'
,
]);
]
,
trace:
true
);
}
on
ArgumentError
{
throwToolExit
(
'make not found. Run
\'
flutter doctor
\'
for more information.'
);
}
finally
{
...
...
packages/flutter_tools/lib/src/macos/build_macos.dart
View file @
450a7248
...
...
@@ -79,7 +79,7 @@ Future<void> buildMacOS({
'OBJROOT=
${fs.path.join(flutterBuildDir.absolute.path, 'Build', 'Intermediates.noindex')}
'
,
'SYMROOT=
${fs.path.join(flutterBuildDir.absolute.path, 'Build', 'Products')}
'
,
'COMPILER_INDEX_STORE_ENABLE=NO'
,
]);
]
,
trace:
true
);
}
finally
{
status
.
cancel
();
}
...
...
packages/flutter_tools/lib/src/windows/build_windows.dart
View file @
450a7248
...
...
@@ -74,7 +74,7 @@ Future<void> buildWindows(WindowsProject windowsProject, BuildInfo buildInfo, {S
vcvarsScript
,
fs
.
path
.
basename
(
solutionPath
),
configuration
,
],
workingDirectory:
fs
.
path
.
dirname
(
solutionPath
));
],
workingDirectory:
fs
.
path
.
dirname
(
solutionPath
)
,
trace:
true
);
}
finally
{
status
.
cancel
();
}
...
...
packages/flutter_tools/test/commands.shard/hermetic/build_linux_test.dart
View file @
450a7248
...
...
@@ -12,6 +12,7 @@ import 'package:flutter_tools/src/base/platform.dart';
import
'package:flutter_tools/src/cache.dart'
;
import
'package:flutter_tools/src/commands/build.dart'
;
import
'package:flutter_tools/src/commands/build_linux.dart'
;
import
'package:flutter_tools/src/convert.dart'
;
import
'package:flutter_tools/src/features.dart'
;
import
'package:flutter_tools/src/globals.dart'
;
import
'package:flutter_tools/src/linux/makefile.dart'
;
...
...
@@ -46,7 +47,7 @@ void main() {
return
const
Stream
<
List
<
int
>>.
empty
();
});
when
(
mockProcess
.
stdout
).
thenAnswer
((
Invocation
invocation
)
{
return
const
Stream
<
List
<
int
>>.
empty
(
);
return
Stream
<
List
<
int
>>.
fromIterable
(<
List
<
int
>>[
utf8
.
encode
(
'STDOUT STUFF'
)]
);
});
when
(
linuxPlatform
.
isLinux
).
thenReturn
(
true
);
when
(
linuxPlatform
.
isWindows
).
thenReturn
(
false
);
...
...
@@ -140,6 +141,25 @@ void main() {
FeatureFlags:
()
=>
TestFeatureFlags
(
isLinuxEnabled:
true
),
});
testUsingContext
(
'Linux build does not spew stdout to status logger'
,
()
async
{
final
BufferLogger
bufferLogger
=
logger
;
final
BuildCommand
command
=
BuildCommand
();
applyMocksToCommand
(
command
);
setUpMockProjectFilesForBuild
();
expectMakeInvocationWithMode
(
'debug'
);
await
createTestCommandRunner
(
command
).
run
(
const
<
String
>[
'build'
,
'linux'
,
'--debug'
]
);
expect
(
bufferLogger
.
statusText
,
isNot
(
contains
(
'STDOUT STUFF'
)));
expect
(
bufferLogger
.
traceText
,
contains
(
'STDOUT STUFF'
));
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
MemoryFileSystem
(),
ProcessManager:
()
=>
mockProcessManager
,
Platform:
()
=>
linuxPlatform
,
FeatureFlags:
()
=>
TestFeatureFlags
(
isLinuxEnabled:
true
),
});
testUsingContext
(
'Linux build --debug passes debug mode to make'
,
()
async
{
final
BuildCommand
command
=
BuildCommand
();
applyMocksToCommand
(
command
);
...
...
packages/flutter_tools/test/commands.shard/hermetic/build_macos_test.dart
View file @
450a7248
...
...
@@ -7,12 +7,15 @@ import 'package:file/memory.dart';
import
'package:flutter_tools/src/base/common.dart'
;
import
'package:flutter_tools/src/base/file_system.dart'
;
import
'package:flutter_tools/src/base/io.dart'
;
import
'package:flutter_tools/src/base/logger.dart'
;
import
'package:flutter_tools/src/base/platform.dart'
;
import
'package:flutter_tools/src/build_info.dart'
;
import
'package:flutter_tools/src/cache.dart'
;
import
'package:flutter_tools/src/commands/build.dart'
;
import
'package:flutter_tools/src/commands/build_macos.dart'
;
import
'package:flutter_tools/src/convert.dart'
;
import
'package:flutter_tools/src/features.dart'
;
import
'package:flutter_tools/src/globals.dart'
;
import
'package:flutter_tools/src/ios/xcodeproj.dart'
;
import
'package:flutter_tools/src/project.dart'
;
import
'package:mockito/mockito.dart'
;
...
...
@@ -56,7 +59,7 @@ void main() {
return
const
Stream
<
List
<
int
>>.
empty
();
});
when
(
mockProcess
.
stdout
).
thenAnswer
((
Invocation
invocation
)
{
return
const
Stream
<
List
<
int
>>.
empty
(
);
return
Stream
<
List
<
int
>>.
fromIterable
(<
List
<
int
>>[
utf8
.
encode
(
'STDOUT STUFF'
)]
);
});
when
(
macosPlatform
.
isMacOS
).
thenReturn
(
true
);
when
(
macosPlatform
.
isWindows
).
thenReturn
(
false
);
...
...
@@ -124,6 +127,25 @@ void main() {
FeatureFlags:
()
=>
TestFeatureFlags
(
isMacOSEnabled:
true
),
});
testUsingContext
(
'macOS build does not spew stdout to status logger'
,
()
async
{
final
BufferLogger
bufferLogger
=
logger
;
final
BuildCommand
command
=
BuildCommand
();
applyMocksToCommand
(
command
);
createMinimalMockProjectFiles
();
setUpMockXcodeBuildHandler
(
'Debug'
);
await
createTestCommandRunner
(
command
).
run
(
const
<
String
>[
'build'
,
'macos'
,
'--debug'
]
);
expect
(
bufferLogger
.
statusText
,
isNot
(
contains
(
'STDOUT STUFF'
)));
expect
(
bufferLogger
.
traceText
,
contains
(
'STDOUT STUFF'
));
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
MemoryFileSystem
(),
ProcessManager:
()
=>
mockProcessManager
,
Platform:
()
=>
macosPlatform
,
FeatureFlags:
()
=>
TestFeatureFlags
(
isMacOSEnabled:
true
),
});
testUsingContext
(
'macOS build invokes xcode build (debug)'
,
()
async
{
final
BuildCommand
command
=
BuildCommand
();
applyMocksToCommand
(
command
);
...
...
packages/flutter_tools/test/commands.shard/hermetic/build_windows_test.dart
View file @
450a7248
...
...
@@ -11,6 +11,7 @@ import 'package:flutter_tools/src/base/platform.dart';
import
'package:flutter_tools/src/cache.dart'
;
import
'package:flutter_tools/src/commands/build.dart'
;
import
'package:flutter_tools/src/commands/build_windows.dart'
;
import
'package:flutter_tools/src/convert.dart'
;
import
'package:flutter_tools/src/features.dart'
;
import
'package:flutter_tools/src/globals.dart'
;
import
'package:flutter_tools/src/windows/visual_studio.dart'
;
...
...
@@ -51,7 +52,7 @@ void main() {
return
const
Stream
<
List
<
int
>>.
empty
();
});
when
(
mockProcess
.
stdout
).
thenAnswer
((
Invocation
invocation
)
{
return
const
Stream
<
List
<
int
>>.
empty
(
);
return
Stream
<
List
<
int
>>.
fromIterable
(<
List
<
int
>>[
utf8
.
encode
(
'STDOUT STUFF'
)]
);
});
when
(
windowsPlatform
.
isWindows
).
thenReturn
(
true
);
when
(
notWindowsPlatform
.
isWindows
).
thenReturn
(
false
);
...
...
@@ -107,6 +108,38 @@ void main() {
FeatureFlags:
()
=>
TestFeatureFlags
(
isWindowsEnabled:
true
),
});
testUsingContext
(
'Windows build does not spew stdout to status logger'
,
()
async
{
final
BufferLogger
bufferLogger
=
logger
;
final
BuildCommand
command
=
BuildCommand
();
applyMocksToCommand
(
command
);
fs
.
file
(
solutionPath
).
createSync
(
recursive:
true
);
when
(
mockVisualStudio
.
vcvarsPath
).
thenReturn
(
vcvarsPath
);
fs
.
file
(
'pubspec.yaml'
).
createSync
();
fs
.
file
(
'.packages'
).
createSync
();
fs
.
file
(
fs
.
path
.
join
(
'lib'
,
'main.dart'
)).
createSync
(
recursive:
true
);
when
(
mockProcessManager
.
start
(<
String
>[
r'C:\packages\flutter_tools\bin\vs_build.bat'
,
vcvarsPath
,
fs
.
path
.
basename
(
solutionPath
),
'Release'
,
],
workingDirectory:
fs
.
path
.
dirname
(
solutionPath
))).
thenAnswer
((
Invocation
invocation
)
async
{
return
mockProcess
;
});
await
createTestCommandRunner
(
command
).
run
(
const
<
String
>[
'build'
,
'windows'
]
);
expect
(
bufferLogger
.
statusText
,
isNot
(
contains
(
'STDOUT STUFF'
)));
expect
(
bufferLogger
.
traceText
,
contains
(
'STDOUT STUFF'
));
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
MemoryFileSystem
(
style:
FileSystemStyle
.
windows
),
ProcessManager:
()
=>
mockProcessManager
,
Platform:
()
=>
windowsPlatform
,
VisualStudio:
()
=>
mockVisualStudio
,
FeatureFlags:
()
=>
TestFeatureFlags
(
isWindowsEnabled:
true
),
});
testUsingContext
(
'Windows build invokes msbuild and writes generated files'
,
()
async
{
final
BuildCommand
command
=
BuildCommand
();
applyMocksToCommand
(
command
);
...
...
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