xref: /aosp_15_r20/external/skia/gn/make_gm_gni.py (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
1*c8dee2aaSAndroid Build Coastguard Worker#! /usr/bin/env python
2*c8dee2aaSAndroid Build Coastguard Worker# Copyright 2019 Google LLC.
3*c8dee2aaSAndroid Build Coastguard Worker# Use of this source code is governed by a BSD-style license that can be
4*c8dee2aaSAndroid Build Coastguard Worker# found in the LICENSE file.
5*c8dee2aaSAndroid Build Coastguard Workerimport os
6*c8dee2aaSAndroid Build Coastguard Workerimport glob
7*c8dee2aaSAndroid Build Coastguard Workeros.chdir(os.path.dirname(__file__))
8*c8dee2aaSAndroid Build Coastguard Workerwith open('gm.gni', 'w') as o:
9*c8dee2aaSAndroid Build Coastguard Worker    o.write('''# Copyright 2016 Google Inc.
10*c8dee2aaSAndroid Build Coastguard Worker#
11*c8dee2aaSAndroid Build Coastguard Worker# Use of this source code is governed by a BSD-style license that can be
12*c8dee2aaSAndroid Build Coastguard Worker# found in the LICENSE file.
13*c8dee2aaSAndroid Build Coastguard Worker
14*c8dee2aaSAndroid Build Coastguard Worker# Things are easiest for everyone if these source paths are absolute.
15*c8dee2aaSAndroid Build Coastguard Worker_gm = get_path_info("../gm", "abspath")
16*c8dee2aaSAndroid Build Coastguard Worker
17*c8dee2aaSAndroid Build Coastguard Workergm_sources = [
18*c8dee2aaSAndroid Build Coastguard Worker''')
19*c8dee2aaSAndroid Build Coastguard Worker    for path in sorted(glob.glob('../gm/*.c*')):
20*c8dee2aaSAndroid Build Coastguard Worker        o.write('  "%s",\n' % path.replace('../gm', '$_gm'))
21*c8dee2aaSAndroid Build Coastguard Worker    o.write(']\n')
22