1*b9df5ad1SAndroid Build Coastguard Worker#!/bin/bash 2*b9df5ad1SAndroid Build Coastguard Worker 3*b9df5ad1SAndroid Build Coastguard Worker# 4*b9df5ad1SAndroid Build Coastguard Worker# Copyright (C) 2012 The Android Open Source Project 5*b9df5ad1SAndroid Build Coastguard Worker# 6*b9df5ad1SAndroid Build Coastguard Worker# Licensed under the Apache License, Version 2.0 (the "License"); 7*b9df5ad1SAndroid Build Coastguard Worker# you may not use this file except in compliance with the License. 8*b9df5ad1SAndroid Build Coastguard Worker# You may obtain a copy of the License at 9*b9df5ad1SAndroid Build Coastguard Worker# 10*b9df5ad1SAndroid Build Coastguard Worker# http://www.apache.org/licenses/LICENSE-2.0 11*b9df5ad1SAndroid Build Coastguard Worker# 12*b9df5ad1SAndroid Build Coastguard Worker# Unless required by applicable law or agreed to in writing, software 13*b9df5ad1SAndroid Build Coastguard Worker# distributed under the License is distributed on an "AS IS" BASIS, 14*b9df5ad1SAndroid Build Coastguard Worker# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15*b9df5ad1SAndroid Build Coastguard Worker# See the License for the specific language governing permissions and 16*b9df5ad1SAndroid Build Coastguard Worker# limitations under the License. 17*b9df5ad1SAndroid Build Coastguard Worker# 18*b9df5ad1SAndroid Build Coastguard Worker 19*b9df5ad1SAndroid Build Coastguard Workerthisdir=$(cd "$(dirname "$0")"; pwd) 20*b9df5ad1SAndroid Build Coastguard Worker$thisdir/metadata-check-dependencies || exit 1 21*b9df5ad1SAndroid Build Coastguard Worker 22*b9df5ad1SAndroid Build Coastguard Workerif [[ $# -lt 1 ]] 23*b9df5ad1SAndroid Build Coastguard Workerthen 24*b9df5ad1SAndroid Build Coastguard Worker echo "Usage: ${BASH_SOURCE##*/} <properties-file-name.xml>" 1>&2 25*b9df5ad1SAndroid Build Coastguard Worker exit 26*b9df5ad1SAndroid Build Coastguard Workerfi 27*b9df5ad1SAndroid Build Coastguard Worker 28*b9df5ad1SAndroid Build Coastguard Workerschema=$thisdir/metadata_definitions.xsd 29*b9df5ad1SAndroid Build Coastguard Workerdoc=$1 30*b9df5ad1SAndroid Build Coastguard Worker 31*b9df5ad1SAndroid Build Coastguard Workerxmllint --noout --schema $schema $doc || exit 1 32*b9df5ad1SAndroid Build Coastguard Workerpython3 $thisdir/metadata_validate.py $doc || exit 1 33*b9df5ad1SAndroid Build Coastguard Worker 34