Igor Murashkin | eaddcd4 | 2012-11-26 12:01:11 -0800 | [diff] [blame] | 1 | #!/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 | |
| 26 | thisdir=$(dirname $(readlink -f $0)) |
| 27 | |
| 28 | function gen_file() { |
| 29 | local in=$thisdir/$1 |
| 30 | local out=$thisdir/$2 |
| 31 | |
Igor Murashkin | 0334aa0 | 2012-12-04 14:59:53 -0800 | [diff] [blame] | 32 | python $thisdir/metadata_parser_xml.py $thisdir/metadata_properties.xml $in > $out |
Igor Murashkin | eaddcd4 | 2012-11-26 12:01:11 -0800 | [diff] [blame] | 33 | return $? |
| 34 | } |
| 35 | |
Igor Murashkin | 0334aa0 | 2012-12-04 14:59:53 -0800 | [diff] [blame] | 36 | $thisdir/metadata-check-dependencies || exit 1 |
Igor Murashkin | eaddcd4 | 2012-11-26 12:01:11 -0800 | [diff] [blame] | 37 | $thisdir/metadata-parser-sanity-check || exit 1 |
| 38 | gen_file html.mako docs.html || exit 1 |
| 39 | gen_file camera_metadata_tag_info.mako ../src/camera_metadata_tag_info.c || exit 1 |
| 40 | gen_file camera_metadata_tags.mako ../include/system/camera_metadata_tags.h || exit 1 |
| 41 | |
| 42 | echo "Successfully generated all metadata source files" |
| 43 | |
| 44 | exit 0 |