Skip to content

Commit

Permalink
Simplify buildtools (flutter#9875)
Browse files Browse the repository at this point in the history
Move GN, only get clang
  • Loading branch information
dnfield authored Jul 17, 2019
1 parent 8849d30 commit f348270
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 36 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,6 @@ pubspec.lock
.vscode/
docs/doxygen/
xcuserdata

third_party/gn/

34 changes: 21 additions & 13 deletions DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,6 @@ vars = {
# Build bot tooling for iOS
'ios_tools_revision': '69b7c1b160e7107a6a98d948363772dc9caea46f',

'buildtools_revision': 'bac220c15490dcf7b7d8136f75100bbc77e8d217',

# Checkout Android dependencies only on platforms where we build for Android targets.
'download_android_deps': 'host_os == "mac" or host_os == "linux"',

Expand Down Expand Up @@ -163,9 +161,6 @@ deps = {
# As part of integrating with Fuchsia, we should eventually remove all these
# Chromium-style dependencies.

'src/buildtools':
Var('fuchsia_git') + '/buildtools' + '@' + Var('buildtools_revision'),

'src/ios_tools':
Var('chromium_git') + '/chromium/src/ios.git' + '@' + Var('ios_tools_revision'),

Expand Down Expand Up @@ -473,6 +468,27 @@ deps = {
'dep_type': 'cipd',
},

'src/flutter/third_party/gn': {
'packages': [
{
'package': 'gn/gn/${{platform}}',
'version': 'git_revision:bdb0fd02324b120cacde634a9235405061c8ea06'
},
],
'dep_type': 'cipd',
},

'src/buildtools/{host_os}-x64/clang': {
'packages': [
{
'package': 'fuchsia/clang/${{platform}}',
'version': 'git_revision:de39621f0f03f20633bdfa50bde97a3908bf6e98'
}
],
'condition': 'host_os == "mac" or host_os == "linux"',
'dep_type': 'cipd',
},

# Get the SDK from https://chrome-infra-packages.appspot.com/p/fuchsia/sdk/core at the 'latest' tag
# Get the toolchain from https://chrome-infra-packages.appspot.com/p/fuchsia/clang at the 'goma' tag

Expand Down Expand Up @@ -546,14 +562,6 @@ hooks = [
'src/flutter/tools/android_support/download_android_support.py',
],
},
{
'name': 'buildtools',
'pattern': '.',
'action': [
'python',
'src/tools/buildtools/update.py',
],
},
{
'name': 'generate_package_files',
'pattern': '.',
Expand Down
2 changes: 1 addition & 1 deletion ci/check_gn_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def main():
if subprocess.call(gn_command + [ gn_file ]) != 0:
print "ERROR: '%s' is incorrectly formatted." % os.path.relpath(gn_file, args.root_directory)
print "Format the same with 'gn format' using the 'gn' binary in //buildtools."
print "Or, run ./ci/check_gn_format.py with '--dry-run false'"
print "Or, run ./ci/check_gn_format.py with '--dry-run false'"
return -1

return 0
Expand Down
2 changes: 1 addition & 1 deletion ci/format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@ if [[ ! -z "$TRAILING_SPACES" ]]; then
fi

# Check GN format consistency
./ci/check_gn_format.py --dry-run true --root-directory . --gn-binary "../buildtools/$OS/gn"
./ci/check_gn_format.py --dry-run true --root-directory . --gn-binary "third_party/gn/gn"
2 changes: 1 addition & 1 deletion ci/licenses_golden/tool_signature
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Signature: 028d24b0ed18e117e64d68853b628ca9
Signature: aceb453d2bca05fab3734ed5f7949c51

11 changes: 2 additions & 9 deletions tools/gn
Original file line number Diff line number Diff line change
Expand Up @@ -345,17 +345,10 @@ def parse_args(args):
def main(argv):
args = parse_args(argv)

if sys.platform.startswith(('cygwin', 'win')):
subdir = 'win'
elif sys.platform == 'darwin':
subdir = 'mac-x64'
elif sys.platform.startswith('linux'):
subdir = 'linux-x64'
else:
raise Error('Unknown platform: ' + sys.platform)
exe = '.exe' if sys.platform.startswith(('cygwin', 'win')) else ''

command = [
'%s/buildtools/%s/gn' % (SRC_ROOT, subdir),
'%s/flutter/third_party/gn/gn%s' % (SRC_ROOT, exe),
'gen',
'--check',
]
Expand Down
23 changes: 12 additions & 11 deletions tools/licenses/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -926,17 +926,18 @@ class _RepositoryDirectory extends _RepositoryEntry implements LicenseSource {
List<_RepositoryDirectory> get virtualSubdirectories => <_RepositoryDirectory>[];

bool shouldRecurse(fs.IoNode entry) {
return entry.name != '.cipd' &&
entry.name != '.git' &&
entry.name != '.github' &&
entry.name != '.gitignore' &&
entry.name != '.vscode' &&
entry.name != 'test' &&
entry.name != 'test.disabled' &&
entry.name != 'test_support' &&
entry.name != 'tests' &&
entry.name != 'javatests' &&
entry.name != 'testing';
return !entry.fullName.endsWith('third_party/gn') &&
entry.name != '.cipd' &&
entry.name != '.git' &&
entry.name != '.github' &&
entry.name != '.gitignore' &&
entry.name != '.vscode' &&
entry.name != 'test' &&
entry.name != 'test.disabled' &&
entry.name != 'test_support' &&
entry.name != 'tests' &&
entry.name != 'javatests' &&
entry.name != 'testing';
}

_RepositoryDirectory createSubdirectory(fs.Directory entry) {
Expand Down

0 comments on commit f348270

Please sign in to comment.