xref: /aosp_15_r20/external/jazzer-api/deploy/jazzer-api_artifact_test.sh (revision 33edd6723662ea34453766bfdca85dbfdd5342b8)
1*33edd672SMark#!/usr/bin/env sh
2*33edd672SMark# Copyright 2022 Code Intelligence GmbH
3*33edd672SMark#
4*33edd672SMark# Licensed under the Apache License, Version 2.0 (the "License");
5*33edd672SMark# you may not use this file except in compliance with the License.
6*33edd672SMark# You may obtain a copy of the License at
7*33edd672SMark#
8*33edd672SMark#      http://www.apache.org/licenses/LICENSE-2.0
9*33edd672SMark#
10*33edd672SMark# Unless required by applicable law or agreed to in writing, software
11*33edd672SMark# distributed under the License is distributed on an "AS IS" BASIS,
12*33edd672SMark# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13*33edd672SMark# See the License for the specific language governing permissions and
14*33edd672SMark# limitations under the License.
15*33edd672SMark
16*33edd672SMark[ -f "$1" ] || exit 1
17*33edd672SMark# List all files in the jar and exclude an allowed list of files.
18*33edd672SMark# Since grep fails if there is no match, ! ... | grep ... fails if there is a
19*33edd672SMark# match.
20*33edd672SMark! external/local_jdk/bin/jar tf "$1" | \
21*33edd672SMark  grep -v \
22*33edd672SMark    -e '^com/$' \
23*33edd672SMark    -e '^com/code_intelligence/$' \
24*33edd672SMark    -e '^com/code_intelligence/jazzer/$' \
25*33edd672SMark    -e '^com/code_intelligence/jazzer/api/' \
26*33edd672SMark    -e '^jaz/' \
27*33edd672SMark    -e '^META-INF/$' \
28*33edd672SMark    -e '^META-INF/MANIFEST.MF$'
29