|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +# Copyright 2023 Ericsson AB |
| 4 | +# |
| 5 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | +# you may not use this file except in compliance with the License. |
| 7 | +# You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, software |
| 12 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | +# See the License for the specific language governing permissions and |
| 15 | +# limitations under the License. |
| 16 | + |
| 17 | +git clone --recurse https://github.com/madler/zlib.git test-proj |
| 18 | +cd test-proj |
| 19 | +git checkout 5a82f71ed1dfc0bec044d9702463dbdf84ea3b71 |
| 20 | + |
| 21 | +# This file must be in the root of the project to be analyzed for bazelisk to work |
| 22 | +cp ../../templates/.bazelversion ./.bazelversion |
| 23 | + |
| 24 | +# Add codechecker to the project |
| 25 | +cat <<EOF >> BUILD.bazel |
| 26 | +#------------------------------------------------------- |
| 27 | +
|
| 28 | +# codechecker rules |
| 29 | +load( |
| 30 | + "@bazel_codechecker//src:codechecker.bzl", |
| 31 | + "codechecker_test", |
| 32 | +) |
| 33 | +load( |
| 34 | + "@bazel_codechecker//src:code_checker.bzl", |
| 35 | + "code_checker_test", |
| 36 | +) |
| 37 | +
|
| 38 | +
|
| 39 | +codechecker_test( |
| 40 | + name = "codechecker_test", |
| 41 | + targets = [ |
| 42 | + ":z", |
| 43 | + ], |
| 44 | +) |
| 45 | +
|
| 46 | +code_checker_test( |
| 47 | + name = "code_checker_test", |
| 48 | + targets = [ |
| 49 | + ":z", |
| 50 | + ], |
| 51 | +) |
| 52 | +
|
| 53 | +#------------------------------------------------------- |
| 54 | +EOF |
| 55 | + |
| 56 | +# Add codechecker_bazel repo to WORKSPACE |
| 57 | +cat ../../templates/WORKSPACE.template >> WORKSPACE |
0 commit comments