xref: /aosp_15_r20/external/angle/build/toolchain/apple/get_tool_mtime.py (revision 8975f5c5ed3d1c378011245431ada316dfb6f244)
1# Copyright 2016 The Chromium Authors
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5
6import os
7import sys
8
9# Usage: python get_tool_mtime.py path/to/file1.py path/to/file2.py
10#
11# Prints a GN scope with the variable name being the basename sans-extension
12# and the value being the file modification time. A variable is emitted for
13# each file argument on the command line.
14
15if __name__ == '__main__':
16  for f in sys.argv[1:]:
17    variable = os.path.splitext(os.path.basename(f))[0]
18    print('%s = %d' % (variable, os.path.getmtime(f)))
19