blob: a9e53d8fde0815f0828d610d634878ab70a073d2 [file] [log] [blame]
Igor Murashkineaddcd42012-11-26 12:01:11 -08001#!/bin/bash
2
3#
4# Copyright (C) 2012 The Android Open Source Project
5#
6# Licensed under the Apache License, Version 2.0 (the "License");
7# you may not use this file except in compliance with the License.
8# You may obtain a copy of the License at
9#
10# http://www.apache.org/licenses/LICENSE-2.0
11#
12# Unless required by applicable law or agreed to in writing, software
13# distributed under the License is distributed on an "AS IS" BASIS,
14# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15# See the License for the specific language governing permissions and
16# limitations under the License.
17#
18
19#
20# Generate all files we have templates for:
21# docs.html
22# ../src/camera_metadata_tag_info.c
23# ../src/camera_metadata_tags.h
24#
25
26thisdir=$(dirname $(readlink -f $0))
27
28function gen_file() {
29 local in=$thisdir/$1
30 local out=$thisdir/$2
31
Igor Murashkin0334aa02012-12-04 14:59:53 -080032 python $thisdir/metadata_parser_xml.py $thisdir/metadata_properties.xml $in > $out
Igor Murashkineaddcd42012-11-26 12:01:11 -080033 return $?
34}
35
Igor Murashkin0334aa02012-12-04 14:59:53 -080036$thisdir/metadata-check-dependencies || exit 1
Igor Murashkineaddcd42012-11-26 12:01:11 -080037$thisdir/metadata-parser-sanity-check || exit 1
38gen_file html.mako docs.html || exit 1
39gen_file camera_metadata_tag_info.mako ../src/camera_metadata_tag_info.c || exit 1
40gen_file camera_metadata_tags.mako ../include/system/camera_metadata_tags.h || exit 1
41
42echo "Successfully generated all metadata source files"
43
44exit 0