2014-05-15 21:40:09 +04:00
|
|
|
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
|
|
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
|
|
# found in the LICENSE file.
|
|
|
|
|
2018-08-01 05:09:56 +03:00
|
|
|
import("//build/util/lastchange.gni")
|
|
|
|
|
2014-05-20 23:20:40 +04:00
|
|
|
action("webkit_version") {
|
|
|
|
script = "version.py"
|
|
|
|
|
2015-10-25 17:42:26 +03:00
|
|
|
template_file = "webkit_version.h.in"
|
gn format //build
A starting point for doing all of src, and adding a PRESUBMIT.
Includes https://codereview.chromium.org/772663002/ and https://codereview.chromium.org/770053002/.
I haven't pushed new binaries yet.
Generated via:
> cd build
> git ls-files *.gn *.gni | sed -e "s/^/@..\\\\out\\\\Debug\\\\gn format --in-place /" >x.bat && x.bat
The only things that I don't love in the current output are:
1. Turning
args = [
"--depfile", rebase_path(depfile, root_build_dir),
"--android-sdk-tools", rebased_android_sdk_build_tools,
"--dex-path", rebased_output,
]
into:
args = [
"--depfile",
rebase_path(depfile, root_build_dir),
"--android-sdk-tools",
rebased_android_sdk_build_tools,
"--dex-path",
rebased_output,
]
The heuristic for this isn't trivial though, and it also affects e.g. '-Xclang' in cflags, as well
as assignments to temporaries that are later assigned to args.
2. Turning single line
if (defined(invoker.inputs)) { inputs = invoker.inputs }
into
if (defined(invoker.inputs)) {
inputs = invoker.inputs
}
This could be argued to be an improvement, but as it's very boilerplate-y perhaps an exception to
allow single line in this case is worthwhile. I think there was discussion of new syntax for this
case too, something like "inputs ?= invoker.inputs" maybe.
In both cases, I think it's worthwhile to get formatting turned on, and then go back and special
case these if we decide it's worthwhile.
R=brettw@chromium.org
BUG=348474
Review URL: https://codereview.chromium.org/766573003
Cr-Original-Commit-Position: refs/heads/master@{#306305}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: b199254f481c5db36d56e83fce40594b06d2b81f
2014-12-02 03:25:20 +03:00
|
|
|
inputs = [
|
|
|
|
lastchange_file,
|
|
|
|
template_file,
|
|
|
|
]
|
2014-05-20 23:20:40 +04:00
|
|
|
|
2015-10-28 00:37:34 +03:00
|
|
|
output_file = "$target_gen_dir/webkit_version.h"
|
2014-12-04 02:27:24 +03:00
|
|
|
outputs = [
|
|
|
|
output_file,
|
|
|
|
]
|
2014-05-20 23:20:40 +04:00
|
|
|
|
|
|
|
args = [
|
2017-04-19 23:48:47 +03:00
|
|
|
# LASTCHANGE contains "<build hash>-<ref>". The user agent only wants the
|
|
|
|
# "<build hash>" bit, so chop off everything after it.
|
|
|
|
"-e",
|
|
|
|
"LASTCHANGE=LASTCHANGE[:LASTCHANGE.find('-')]",
|
gn format //build
A starting point for doing all of src, and adding a PRESUBMIT.
Includes https://codereview.chromium.org/772663002/ and https://codereview.chromium.org/770053002/.
I haven't pushed new binaries yet.
Generated via:
> cd build
> git ls-files *.gn *.gni | sed -e "s/^/@..\\\\out\\\\Debug\\\\gn format --in-place /" >x.bat && x.bat
The only things that I don't love in the current output are:
1. Turning
args = [
"--depfile", rebase_path(depfile, root_build_dir),
"--android-sdk-tools", rebased_android_sdk_build_tools,
"--dex-path", rebased_output,
]
into:
args = [
"--depfile",
rebase_path(depfile, root_build_dir),
"--android-sdk-tools",
rebased_android_sdk_build_tools,
"--dex-path",
rebased_output,
]
The heuristic for this isn't trivial though, and it also affects e.g. '-Xclang' in cflags, as well
as assignments to temporaries that are later assigned to args.
2. Turning single line
if (defined(invoker.inputs)) { inputs = invoker.inputs }
into
if (defined(invoker.inputs)) {
inputs = invoker.inputs
}
This could be argued to be an improvement, but as it's very boilerplate-y perhaps an exception to
allow single line in this case is worthwhile. I think there was discussion of new syntax for this
case too, something like "inputs ?= invoker.inputs" maybe.
In both cases, I think it's worthwhile to get formatting turned on, and then go back and special
case these if we decide it's worthwhile.
R=brettw@chromium.org
BUG=348474
Review URL: https://codereview.chromium.org/766573003
Cr-Original-Commit-Position: refs/heads/master@{#306305}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: b199254f481c5db36d56e83fce40594b06d2b81f
2014-12-02 03:25:20 +03:00
|
|
|
"-f",
|
|
|
|
rebase_path(lastchange_file, root_build_dir),
|
2014-05-20 23:20:40 +04:00
|
|
|
rebase_path(template_file, root_build_dir),
|
|
|
|
rebase_path(output_file, root_build_dir),
|
|
|
|
]
|
|
|
|
}
|
2015-07-10 18:18:36 +03:00
|
|
|
|
|
|
|
action("chrome_version_json") {
|
|
|
|
script = "version.py"
|
|
|
|
_chrome_version_path = "//chrome/VERSION"
|
|
|
|
inputs = [
|
|
|
|
_chrome_version_path,
|
|
|
|
]
|
|
|
|
_output_file = "$root_gen_dir/CHROME_VERSION.json"
|
|
|
|
outputs = [
|
|
|
|
_output_file,
|
|
|
|
]
|
|
|
|
args = [
|
|
|
|
"--file",
|
|
|
|
rebase_path(_chrome_version_path, root_build_dir),
|
|
|
|
"--template",
|
|
|
|
"{\"full-quoted\": \"\\\"@MAJOR@.@MINOR@.@BUILD@.@PATCH@\\\"\"}",
|
|
|
|
"--output",
|
|
|
|
rebase_path(_output_file, root_build_dir),
|
|
|
|
]
|
|
|
|
}
|