1*0e209d39SAndroid Build Coastguard Worker#!/usr/bin/python3 -B 2*0e209d39SAndroid Build Coastguard Worker# Copyright 2015 The Android Open Source Project 3*0e209d39SAndroid Build Coastguard Worker# 4*0e209d39SAndroid Build Coastguard Worker# Licensed under the Apache License, Version 2.0 (the "License"); 5*0e209d39SAndroid Build Coastguard Worker# you may not use this file except in compliance with the License. 6*0e209d39SAndroid Build Coastguard Worker# You may obtain a copy of the License at 7*0e209d39SAndroid Build Coastguard Worker# 8*0e209d39SAndroid Build Coastguard Worker# http://www.apache.org/licenses/LICENSE-2.0 9*0e209d39SAndroid Build Coastguard Worker# 10*0e209d39SAndroid Build Coastguard Worker# Unless required by applicable law or agreed to in writing, software 11*0e209d39SAndroid Build Coastguard Worker# distributed under the License is distributed on an "AS IS" BASIS, 12*0e209d39SAndroid Build Coastguard Worker# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13*0e209d39SAndroid Build Coastguard Worker# See the License for the specific language governing permissions and 14*0e209d39SAndroid Build Coastguard Worker# limitations under the License. 15*0e209d39SAndroid Build Coastguard Worker 16*0e209d39SAndroid Build Coastguard Worker"""Regenerates (just) ICU data files used in the Android system image.""" 17*0e209d39SAndroid Build Coastguard Worker 18*0e209d39SAndroid Build Coastguard Workerfrom __future__ import print_function 19*0e209d39SAndroid Build Coastguard Worker 20*0e209d39SAndroid Build Coastguard Workerimport sys 21*0e209d39SAndroid Build Coastguard Worker 22*0e209d39SAndroid Build Coastguard Workerimport icuutil 23*0e209d39SAndroid Build Coastguard Worker 24*0e209d39SAndroid Build Coastguard Worker 25*0e209d39SAndroid Build Coastguard Worker# Run with no arguments from any directory, with no special setup required. 26*0e209d39SAndroid Build Coastguard Workerdef main(): 27*0e209d39SAndroid Build Coastguard Worker icu_dir = icuutil.icuDir() 28*0e209d39SAndroid Build Coastguard Worker print('Found icu in %s ...' % icu_dir) 29*0e209d39SAndroid Build Coastguard Worker 30*0e209d39SAndroid Build Coastguard Worker icuutil.GenerateIcuDataFiles() 31*0e209d39SAndroid Build Coastguard Worker 32*0e209d39SAndroid Build Coastguard Worker print('Look in %s for new data files' % icu_dir) 33*0e209d39SAndroid Build Coastguard Worker sys.exit(0) 34*0e209d39SAndroid Build Coastguard Worker 35*0e209d39SAndroid Build Coastguard Workerif __name__ == '__main__': 36*0e209d39SAndroid Build Coastguard Worker main() 37