xref: /aosp_15_r20/build/make/tools/warn.py (revision 9e94795a3d4ef5c1d47486f9a02bb378756cea8a)
1*9e94795aSAndroid Build Coastguard Worker#!/usr/bin/env python3
2*9e94795aSAndroid Build Coastguard Worker#
3*9e94795aSAndroid Build Coastguard Worker# Copyright (C) 2019 The Android Open Source Project
4*9e94795aSAndroid Build Coastguard Worker#
5*9e94795aSAndroid Build Coastguard Worker# Licensed under the Apache License, Version 2.0 (the "License");
6*9e94795aSAndroid Build Coastguard Worker# you may not use this file except in compliance with the License.
7*9e94795aSAndroid Build Coastguard Worker# You may obtain a copy of the License at
8*9e94795aSAndroid Build Coastguard Worker#
9*9e94795aSAndroid Build Coastguard Worker#      http://www.apache.org/licenses/LICENSE-2.0
10*9e94795aSAndroid Build Coastguard Worker#
11*9e94795aSAndroid Build Coastguard Worker# Unless required by applicable law or agreed to in writing, software
12*9e94795aSAndroid Build Coastguard Worker# distributed under the License is distributed on an "AS IS" BASIS,
13*9e94795aSAndroid Build Coastguard Worker# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14*9e94795aSAndroid Build Coastguard Worker# See the License for the specific language governing permissions and
15*9e94795aSAndroid Build Coastguard Worker# limitations under the License.
16*9e94795aSAndroid Build Coastguard Worker
17*9e94795aSAndroid Build Coastguard Worker"""Call -m warn.warn to process warning messages.
18*9e94795aSAndroid Build Coastguard Worker
19*9e94795aSAndroid Build Coastguard WorkerThis script is used by Android continuous build bots for all branches.
20*9e94795aSAndroid Build Coastguard WorkerOld frozen branches will continue to use the old warn.py, and active
21*9e94795aSAndroid Build Coastguard Workerbranches will use this new version to call -m warn.warn.
22*9e94795aSAndroid Build Coastguard Worker"""
23*9e94795aSAndroid Build Coastguard Worker
24*9e94795aSAndroid Build Coastguard Workerimport os
25*9e94795aSAndroid Build Coastguard Workerimport subprocess
26*9e94795aSAndroid Build Coastguard Workerimport sys
27*9e94795aSAndroid Build Coastguard Worker
28*9e94795aSAndroid Build Coastguard Worker
29*9e94795aSAndroid Build Coastguard Workerdef main():
30*9e94795aSAndroid Build Coastguard Worker  """Old main() calls warn.warn."""
31*9e94795aSAndroid Build Coastguard Worker  os.environ['PYTHONPATH'] = os.path.dirname(os.path.abspath(__file__))
32*9e94795aSAndroid Build Coastguard Worker  subprocess.check_call(['/usr/bin/python3', '-m', 'warn.warn'] + sys.argv[1:])
33*9e94795aSAndroid Build Coastguard Worker
34*9e94795aSAndroid Build Coastguard Worker
35*9e94795aSAndroid Build Coastguard Workerif __name__ == '__main__':
36*9e94795aSAndroid Build Coastguard Worker  main()
37