blob: aee1ed98c914a8b8b5d22e7eccad94406e52a856 [file] [log] [blame]
Sigmund Cherem561e8242019-12-19 23:12:53 +00001# Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
2# for details. All rights reserved. Use of this source code is governed by a
3# BSD-style license that can be found in the LICENSE file.
4
5_dart_root = get_path_info(".", "abspath")
6
Nicholas Shahan50d972b2019-10-09 23:24:21 +00007declare_args() {
Sigmund Cherem561e8242019-12-19 23:12:53 +00008 # Absolute path to the .git folder.
9 #
10 # This is used in rules that need to refer to `.git/logs/HEAD` to include
11 # a hash in the version string. By default the folder is `.git`, but we define
12 # it as an argument so it can be overriden by users of `git-worktree` (See
13 # Issue #33619).
14 #
15 # When using git-worktree, you can add
16 #
17 # default_git_folder = "/path/to/main/git/repo/.git/worktrees/name/"
18 #
19 # to out/ReleaseX64/args.gn. The path above can be extracted from the `.git`
20 # file under the git worktree folder.
Jens Johansen1b3f6d82021-03-16 12:32:55 +000021 # The script run here should take care of everything automatically though.
22 default_git_folder = exec_script("$_dart_root/tools/get_dot_git_folder.py",
William Hessee900b9c2021-03-16 16:58:49 +000023 [
24 rebase_path("$_dart_root/.git"),
25 "$_dart_root/.git",
26 ],
Jens Johansen1b3f6d82021-03-16 12:32:55 +000027 "trim string")
Clement Skau0ce83982020-07-07 06:08:20 +000028
29 # Whether to enable the SDK hash check that will prevent loading a kernel
30 # into a VM which was built with a different SDK.
31 verify_sdk_hash = true
Zach Anderson46189bc2021-06-29 18:45:29 +000032
33 # The location in the build output directory of the built Dart SDK.
34 dart_sdk_output = "dart-sdk"
Clement Skau0ce83982020-07-07 06:08:20 +000035}
36
37# The SDK hash to build into VM and kernels.
38# The value 0000000000 signifies no hash is set, which will disable the check.
39if (verify_sdk_hash) {
40 sdk_hash = exec_script("$_dart_root/tools/make_version.py",
41 [ "--format={{GIT_HASH}}" ],
42 "trim string",
43 [
44 "$_dart_root/tools/VERSION",
45 "$_dart_root/tools/utils.py",
Ryan Macnak48c21812020-07-09 21:12:15 +000046 "$default_git_folder/logs/HEAD",
Clement Skau0ce83982020-07-07 06:08:20 +000047 ])
48} else {
49 sdk_hash = "0000000000"
Nicholas Shahan50d972b2019-10-09 23:24:21 +000050}