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
76964621
Commit
76964621
authored
Feb 14, 2017
by
Michael Goderbauer
Committed by
GitHub
Feb 14, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add git config option to automatically convert CRLF to LF (#8122)
parent
f903a1c8
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
233 additions
and
208 deletions
+233
-208
.gitattributes
.gitattributes
+25
-0
update_dart_sdk.ps1
bin/internal/update_dart_sdk.ps1
+40
-40
VERSION_WIN_SDK
dev/bots/VERSION_WIN_SDK
+1
-1
test.dart
dev/bots/test.dart
+167
-167
No files found.
.gitattributes
0 → 100644
View file @
76964621
# Auto detect text files and perform LF normalization
* text=auto
# Always perform LF normalization on these files
*.dart text
*.gradle text
*.html text
*.java text
*.json text
*.md text
*.py text
*.sh text
*.txt text
*.xml text
*.yaml text
# Make sure that these Windows files always have CRLF line endings in checkout
*.bat text eol=crlf
*.ps1 text eol=crlf
# Never perform LF normalization on these files
*.ico binary
*.jar binary
*.png binary
*.zip binary
bin/internal/update_dart_sdk.ps1
View file @
76964621
# Copyright 2017 The Chromium Authors. All rights reserved.
# Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# found in the LICENSE file.
# ---------------------------------- NOTE ---------------------------------- #
# ---------------------------------- NOTE ---------------------------------- #
#
#
# Please keep the logic in this file consistent with the logic in the
# Please keep the logic in this file consistent with the logic in the
# `update_dart_sdk.sh` script in the same directory to ensure that Flutter
# `update_dart_sdk.sh` script in the same directory to ensure that Flutter
# continues to work across all platforms!
# continues to work across all platforms!
#
#
# -------------------------------------------------------------------------- #
# -------------------------------------------------------------------------- #
$ErrorActionPreference
=
"Stop"
$ErrorActionPreference
=
"Stop"
$progName
=
split-path
-parent
$MyInvocation
.MyCommand.Definition
$progName
=
split-path
-parent
$MyInvocation
.MyCommand.Definition
$flutterRoot
=
(
get-item
$progName
)
.parent.parent.FullName
$flutterRoot
=
(
get-item
$progName
)
.parent.parent.FullName
$dartSdkPath
=
"
$flutterRoot
\bin\cache\dart-sdk"
$dartSdkPath
=
"
$flutterRoot
\bin\cache\dart-sdk"
$dartSdkStampPath
=
"
$flutterRoot
\bin\cache\dart-sdk.stamp"
$dartSdkStampPath
=
"
$flutterRoot
\bin\cache\dart-sdk.stamp"
$dartSdkVersion
=
(
Get-Content
"
$flutterRoot
\bin\internal\dart-sdk.version"
)
$dartSdkVersion
=
(
Get-Content
"
$flutterRoot
\bin\internal\dart-sdk.version"
)
if
((
Test-Path
$dartSdkStampPath
)
-and
(
$dartSdkVersion
-eq
(
Get-Content
$dartSdkStampPath
)))
{
if
((
Test-Path
$dartSdkStampPath
)
-and
(
$dartSdkVersion
-eq
(
Get-Content
$dartSdkStampPath
)))
{
return
return
}
}
Write-Host
"Downloading Dart SDK
$dartSdkVersion
..."
Write-Host
"Downloading Dart SDK
$dartSdkVersion
..."
$dartZipName
=
"dartsdk-windows-x64-release.zip"
$dartZipName
=
"dartsdk-windows-x64-release.zip"
$dartChannel
=
if
(
$dartSdkVersion
.Contains
(
"-dev."
))
{
"dev"
}
else
{
"stable"
}
$dartChannel
=
if
(
$dartSdkVersion
.Contains
(
"-dev."
))
{
"dev"
}
else
{
"stable"
}
$dartSdkUrl
=
"https://storage.googleapis.com/dart-archive/channels/
$dartChannel
/raw/
$dartSdkVersion
/sdk/
$dartZipName
"
$dartSdkUrl
=
"https://storage.googleapis.com/dart-archive/channels/
$dartChannel
/raw/
$dartSdkVersion
/sdk/
$dartZipName
"
if
(
Test-Path
$dartSdkPath
)
{
Remove-Item
$dartSdkPath
-Recurse
}
if
(
Test-Path
$dartSdkPath
)
{
Remove-Item
$dartSdkPath
-Recurse
}
New-Item
$dartSdkPath
-force -type directory | Out-Null
New-Item
$dartSdkPath
-force -type directory | Out-Null
$dartSdkZip
=
"
$flutterRoot
\bin\cache\dart-sdk.zip"
$dartSdkZip
=
"
$flutterRoot
\bin\cache\dart-sdk.zip"
Start-BitsTransfer
-Source
$dartSdkUrl
-Destination
$dartSdkZip
Start-BitsTransfer
-Source
$dartSdkUrl
-Destination
$dartSdkZip
Add-Type
-assembly
"system.io.compression.filesystem"
Add-Type
-assembly
"system.io.compression.filesystem"
[
io.compression.zipfile]::ExtractToDirectory
(
$dartSdkZip
,
"
$flutterRoot
\bin\cache"
)
[
io.compression.zipfile]::ExtractToDirectory
(
$dartSdkZip
,
"
$flutterRoot
\bin\cache"
)
Remove-Item
$dartSdkZip
Remove-Item
$dartSdkZip
$dartSdkVersion
|
out-file
$dartSdkStampPath
$dartSdkVersion
|
out-file
$dartSdkStampPath
dev/bots/VERSION_WIN_SDK
View file @
76964621
e5715e2cc0d5644a241a4b3281bfada92bc145c2
e5715e2cc0d5644a241a4b3281bfada92bc145c2
dev/bots/test.dart
View file @
76964621
import
'dart:io'
;
import
'dart:io'
;
import
'dart:async'
;
import
'dart:async'
;
import
'package:path/path.dart'
as
p
;
import
'package:path/path.dart'
as
p
;
String
flutterRoot
=
p
.
dirname
(
p
.
dirname
(
p
.
dirname
(
p
.
fromUri
(
Platform
.
script
))));
String
flutterRoot
=
p
.
dirname
(
p
.
dirname
(
p
.
dirname
(
p
.
fromUri
(
Platform
.
script
))));
String
flutter
=
p
.
join
(
flutterRoot
,
'bin'
,
Platform
.
isWindows
?
'flutter.bat'
:
'flutter'
);
String
flutter
=
p
.
join
(
flutterRoot
,
'bin'
,
Platform
.
isWindows
?
'flutter.bat'
:
'flutter'
);
String
dart
=
p
.
join
(
flutterRoot
,
'bin'
,
'cache'
,
'dart-sdk'
,
'bin'
,
Platform
.
isWindows
?
'dart.exe'
:
'dart'
);
String
dart
=
p
.
join
(
flutterRoot
,
'bin'
,
'cache'
,
'dart-sdk'
,
'bin'
,
Platform
.
isWindows
?
'dart.exe'
:
'dart'
);
String
flutterTestArgs
=
Platform
.
environment
[
'FLUTTER_TEST_ARGS'
];
String
flutterTestArgs
=
Platform
.
environment
[
'FLUTTER_TEST_ARGS'
];
/// When you call this, you can set FLUTTER_TEST_ARGS to pass custom
/// When you call this, you can set FLUTTER_TEST_ARGS to pass custom
/// arguments to flutter test. For example, you might want to call this
/// arguments to flutter test. For example, you might want to call this
/// script using FLUTTER_TEST_ARGS=--local-engine=host_debug_unopt to
/// script using FLUTTER_TEST_ARGS=--local-engine=host_debug_unopt to
/// use your own build of the engine.
/// use your own build of the engine.
Future
<
Null
>
main
()
async
{
Future
<
Null
>
main
()
async
{
// Analyze all the Dart code in the repo.
// Analyze all the Dart code in the repo.
await
_runFlutterAnalyze
(
flutterRoot
,
await
_runFlutterAnalyze
(
flutterRoot
,
options:
<
String
>[
'--flutter-repo'
],
options:
<
String
>[
'--flutter-repo'
],
);
);
// Verify that the tests actually return failure on failure and success on success.
// Verify that the tests actually return failure on failure and success on success.
String
automatedTests
=
p
.
join
(
flutterRoot
,
'dev'
,
'automated_tests'
);
String
automatedTests
=
p
.
join
(
flutterRoot
,
'dev'
,
'automated_tests'
);
await
_runFlutterTest
(
automatedTests
,
await
_runFlutterTest
(
automatedTests
,
script:
p
.
join
(
'test_smoke_test'
,
'fail_test.dart'
),
script:
p
.
join
(
'test_smoke_test'
,
'fail_test.dart'
),
expectFailure:
true
,
expectFailure:
true
,
printOutput:
false
,
printOutput:
false
,
);
);
await
_runFlutterTest
(
automatedTests
,
await
_runFlutterTest
(
automatedTests
,
script:
p
.
join
(
'test_smoke_test'
,
'pass_test.dart'
),
script:
p
.
join
(
'test_smoke_test'
,
'pass_test.dart'
),
printOutput:
false
,
printOutput:
false
,
);
);
await
_runFlutterTest
(
automatedTests
,
await
_runFlutterTest
(
automatedTests
,
script:
p
.
join
(
'test_smoke_test'
,
'crash1_test.dart'
),
script:
p
.
join
(
'test_smoke_test'
,
'crash1_test.dart'
),
expectFailure:
true
,
expectFailure:
true
,
printOutput:
false
,
printOutput:
false
,
);
);
await
_runFlutterTest
(
automatedTests
,
await
_runFlutterTest
(
automatedTests
,
script:
p
.
join
(
'test_smoke_test'
,
'crash2_test.dart'
),
script:
p
.
join
(
'test_smoke_test'
,
'crash2_test.dart'
),
expectFailure:
true
,
expectFailure:
true
,
printOutput:
false
,
printOutput:
false
,
);
);
await
_runFlutterTest
(
automatedTests
,
await
_runFlutterTest
(
automatedTests
,
script:
p
.
join
(
'test_smoke_test'
,
'syntax_error_test.broken_dart'
),
script:
p
.
join
(
'test_smoke_test'
,
'syntax_error_test.broken_dart'
),
expectFailure:
true
,
expectFailure:
true
,
printOutput:
false
,
printOutput:
false
,
);
);
await
_runFlutterTest
(
automatedTests
,
await
_runFlutterTest
(
automatedTests
,
script:
p
.
join
(
'test_smoke_test'
,
'missing_import_test.broken_dart'
),
script:
p
.
join
(
'test_smoke_test'
,
'missing_import_test.broken_dart'
),
expectFailure:
true
,
expectFailure:
true
,
printOutput:
false
,
printOutput:
false
,
);
);
await
_runCmd
(
flutter
,
<
String
>[
'drive'
,
'--use-existing-app'
,
'-t'
,
p
.
join
(
'test_driver'
,
'failure.dart'
)],
await
_runCmd
(
flutter
,
<
String
>[
'drive'
,
'--use-existing-app'
,
'-t'
,
p
.
join
(
'test_driver'
,
'failure.dart'
)],
workingDirectory:
p
.
join
(
flutterRoot
,
'packages'
,
'flutter_driver'
),
workingDirectory:
p
.
join
(
flutterRoot
,
'packages'
,
'flutter_driver'
),
expectFailure:
true
,
expectFailure:
true
,
printOutput:
false
,
printOutput:
false
,
skip:
Platform
.
isWindows
,
// TODO(goderbauer): run on Windows when 'drive' command works
skip:
Platform
.
isWindows
,
// TODO(goderbauer): run on Windows when 'drive' command works
);
);
List
<
String
>
coverageFlags
=
<
String
>[];
List
<
String
>
coverageFlags
=
<
String
>[];
if
(
Platform
.
environment
[
'TRAVIS'
]
!=
null
&&
Platform
.
environment
[
'TRAVIS_PULL_REQUEST'
]
==
'false'
)
if
(
Platform
.
environment
[
'TRAVIS'
]
!=
null
&&
Platform
.
environment
[
'TRAVIS_PULL_REQUEST'
]
==
'false'
)
coverageFlags
.
add
(
'--coverage'
);
coverageFlags
.
add
(
'--coverage'
);
// Run tests.
// Run tests.
await
_runFlutterTest
(
p
.
join
(
flutterRoot
,
'packages'
,
'flutter'
),
await
_runFlutterTest
(
p
.
join
(
flutterRoot
,
'packages'
,
'flutter'
),
options:
coverageFlags
,
options:
coverageFlags
,
);
);
await
_runAllDartTests
(
p
.
join
(
flutterRoot
,
'packages'
,
'flutter_driver'
));
await
_runAllDartTests
(
p
.
join
(
flutterRoot
,
'packages'
,
'flutter_driver'
));
await
_runFlutterTest
(
p
.
join
(
flutterRoot
,
'packages'
,
'flutter_test'
));
await
_runFlutterTest
(
p
.
join
(
flutterRoot
,
'packages'
,
'flutter_test'
));
await
_runFlutterTest
(
p
.
join
(
flutterRoot
,
'packages'
,
'flutter_markdown'
));
await
_runFlutterTest
(
p
.
join
(
flutterRoot
,
'packages'
,
'flutter_markdown'
));
await
_runAllDartTests
(
p
.
join
(
flutterRoot
,
'packages'
,
'flutter_tools'
),
await
_runAllDartTests
(
p
.
join
(
flutterRoot
,
'packages'
,
'flutter_tools'
),
environment:
<
String
,
String
>{
'FLUTTER_ROOT'
:
flutterRoot
},
environment:
<
String
,
String
>{
'FLUTTER_ROOT'
:
flutterRoot
},
);
);
await
_runAllDartTests
(
p
.
join
(
flutterRoot
,
'dev'
,
'devicelab'
));
await
_runAllDartTests
(
p
.
join
(
flutterRoot
,
'dev'
,
'devicelab'
));
await
_runFlutterTest
(
p
.
join
(
flutterRoot
,
'dev'
,
'manual_tests'
));
await
_runFlutterTest
(
p
.
join
(
flutterRoot
,
'dev'
,
'manual_tests'
));
await
_runFlutterTest
(
p
.
join
(
flutterRoot
,
'examples'
,
'hello_world'
));
await
_runFlutterTest
(
p
.
join
(
flutterRoot
,
'examples'
,
'hello_world'
));
await
_runFlutterTest
(
p
.
join
(
flutterRoot
,
'examples'
,
'layers'
));
await
_runFlutterTest
(
p
.
join
(
flutterRoot
,
'examples'
,
'layers'
));
await
_runFlutterTest
(
p
.
join
(
flutterRoot
,
'examples'
,
'stocks'
));
await
_runFlutterTest
(
p
.
join
(
flutterRoot
,
'examples'
,
'stocks'
));
await
_runFlutterTest
(
p
.
join
(
flutterRoot
,
'examples'
,
'flutter_gallery'
));
await
_runFlutterTest
(
p
.
join
(
flutterRoot
,
'examples'
,
'flutter_gallery'
));
await
_runCmd
(
dart
,
<
String
>[
p
.
join
(
flutterRoot
,
'dev'
,
'tools'
,
'mega_gallery.dart'
)],
await
_runCmd
(
dart
,
<
String
>[
p
.
join
(
flutterRoot
,
'dev'
,
'tools'
,
'mega_gallery.dart'
)],
workingDirectory:
flutterRoot
,
workingDirectory:
flutterRoot
,
);
);
await
_runFlutterAnalyze
(
p
.
join
(
flutterRoot
,
'dev'
,
'benchmarks'
,
'mega_gallery'
),
await
_runFlutterAnalyze
(
p
.
join
(
flutterRoot
,
'dev'
,
'benchmarks'
,
'mega_gallery'
),
options:
<
String
>[
'--watch'
,
'--benchmark'
],
options:
<
String
>[
'--watch'
,
'--benchmark'
],
);
);
print
(
'
\
x1B[32mDONE: All tests successful.
\
x1B[0m'
);
print
(
'
\
x1B[32mDONE: All tests successful.
\
x1B[0m'
);
}
}
Future
<
Null
>
_runCmd
(
String
executable
,
List
<
String
>
arguments
,
{
Future
<
Null
>
_runCmd
(
String
executable
,
List
<
String
>
arguments
,
{
String
workingDirectory
,
String
workingDirectory
,
Map
<
String
,
String
>
environment
,
Map
<
String
,
String
>
environment
,
bool
expectFailure:
false
,
bool
expectFailure:
false
,
bool
printOutput:
true
,
bool
printOutput:
true
,
bool
skip:
false
,
bool
skip:
false
,
})
async
{
})
async
{
String
cmd
=
'
${p.relative(executable)}
${arguments.join(' ')}
'
;
String
cmd
=
'
${p.relative(executable)}
${arguments.join(' ')}
'
;
String
relativeWorkingDir
=
p
.
relative
(
workingDirectory
);
String
relativeWorkingDir
=
p
.
relative
(
workingDirectory
);
if
(
skip
)
{
if
(
skip
)
{
_printProgress
(
'SKIPPING'
,
relativeWorkingDir
,
cmd
);
_printProgress
(
'SKIPPING'
,
relativeWorkingDir
,
cmd
);
return
null
;
return
null
;
}
}
_printProgress
(
'RUNNING'
,
relativeWorkingDir
,
cmd
);
_printProgress
(
'RUNNING'
,
relativeWorkingDir
,
cmd
);
Process
process
=
await
Process
.
start
(
executable
,
arguments
,
Process
process
=
await
Process
.
start
(
executable
,
arguments
,
workingDirectory:
workingDirectory
,
workingDirectory:
workingDirectory
,
environment:
environment
,
environment:
environment
,
);
);
if
(
printOutput
)
{
if
(
printOutput
)
{
stdout
.
addStream
(
process
.
stdout
);
stdout
.
addStream
(
process
.
stdout
);
stderr
.
addStream
(
process
.
stderr
);
stderr
.
addStream
(
process
.
stderr
);
}
}
int
exitCode
=
await
process
.
exitCode
;
int
exitCode
=
await
process
.
exitCode
;
if
((
exitCode
==
0
)
==
expectFailure
)
{
if
((
exitCode
==
0
)
==
expectFailure
)
{
print
(
print
(
'
\
x1B[31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
\
x1B[0m
\n
'
'
\
x1B[31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
\
x1B[0m
\n
'
'
\
x1B[1mERROR:
\
x1B[31m Last command exited with
$exitCode
(expected:
${expectFailure ? 'non-zero' : 'zero'}
).
\
x1B[0m
\n
'
'
\
x1B[1mERROR:
\
x1B[31m Last command exited with
$exitCode
(expected:
${expectFailure ? 'non-zero' : 'zero'}
).
\
x1B[0m
\n
'
'
\
x1B[31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
\
x1B[0m'
'
\
x1B[31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
\
x1B[0m'
);
);
exit
(
1
);
exit
(
1
);
}
}
}
}
Future
<
Null
>
_runFlutterTest
(
String
workingDirectory
,
{
Future
<
Null
>
_runFlutterTest
(
String
workingDirectory
,
{
String
script
,
String
script
,
bool
expectFailure:
false
,
bool
expectFailure:
false
,
bool
printOutput:
true
,
bool
printOutput:
true
,
List
<
String
>
options:
const
<
String
>[],
List
<
String
>
options:
const
<
String
>[],
bool
skip:
false
,
bool
skip:
false
,
})
{
})
{
List
<
String
>
args
=
<
String
>[
'test'
]..
addAll
(
options
);
List
<
String
>
args
=
<
String
>[
'test'
]..
addAll
(
options
);
if
(
flutterTestArgs
!=
null
)
if
(
flutterTestArgs
!=
null
)
args
.
add
(
flutterTestArgs
);
args
.
add
(
flutterTestArgs
);
if
(
script
!=
null
)
if
(
script
!=
null
)
args
.
add
(
script
);
args
.
add
(
script
);
return
_runCmd
(
flutter
,
args
,
return
_runCmd
(
flutter
,
args
,
workingDirectory:
workingDirectory
,
workingDirectory:
workingDirectory
,
expectFailure:
expectFailure
,
expectFailure:
expectFailure
,
printOutput:
printOutput
,
printOutput:
printOutput
,
skip:
skip
||
Platform
.
isWindows
,
// TODO(goderbauer): run on Windows when sky_shell is available
skip:
skip
||
Platform
.
isWindows
,
// TODO(goderbauer): run on Windows when sky_shell is available
);
);
}
}
Future
<
Null
>
_runAllDartTests
(
String
workingDirectory
,
{
Future
<
Null
>
_runAllDartTests
(
String
workingDirectory
,
{
Map
<
String
,
String
>
environment
,
Map
<
String
,
String
>
environment
,
})
{
})
{
List
<
String
>
args
=
<
String
>[
'--checked'
,
p
.
join
(
'test'
,
'all.dart'
)];
List
<
String
>
args
=
<
String
>[
'--checked'
,
p
.
join
(
'test'
,
'all.dart'
)];
return
_runCmd
(
dart
,
args
,
return
_runCmd
(
dart
,
args
,
workingDirectory:
workingDirectory
,
workingDirectory:
workingDirectory
,
environment:
environment
,
environment:
environment
,
);
);
}
}
Future
<
Null
>
_runFlutterAnalyze
(
String
workingDirectory
,
{
Future
<
Null
>
_runFlutterAnalyze
(
String
workingDirectory
,
{
List
<
String
>
options:
const
<
String
>[]
List
<
String
>
options:
const
<
String
>[]
})
{
})
{
return
_runCmd
(
flutter
,
<
String
>[
'analyze'
]..
addAll
(
options
),
return
_runCmd
(
flutter
,
<
String
>[
'analyze'
]..
addAll
(
options
),
workingDirectory:
workingDirectory
,
workingDirectory:
workingDirectory
,
);
);
}
}
void
_printProgress
(
String
action
,
String
workingDir
,
String
cmd
)
{
void
_printProgress
(
String
action
,
String
workingDir
,
String
cmd
)
{
print
(
'>>>
$action
in
\
x1B[36m
$workingDir
\
x1B[0m:
\
x1B[33m
$cmd
\
x1B[0m'
);
print
(
'>>>
$action
in
\
x1B[36m
$workingDir
\
x1B[0m:
\
x1B[33m
$cmd
\
x1B[0m'
);
}
}
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