• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2016 Google Inc.
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#      http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14#
15################################################################################
16"""Templates for OSS-Fuzz project files."""
17
18PROJECT_YAML_TEMPLATE = """\
19homepage: "<your_project_homepage>"
20language: <programming_language>  # Example values: c, c++, go, rust.
21primary_contact: "<primary_contact_email>"
22main_repo: "https://path/to/main/repo.git"
23"""
24
25DOCKER_TEMPLATE = """\
26# Copyright %(year)d Google LLC
27#
28# Licensed under the Apache License, Version 2.0 (the "License");
29# you may not use this file except in compliance with the License.
30# You may obtain a copy of the License at
31#
32#      http://www.apache.org/licenses/LICENSE-2.0
33#
34# Unless required by applicable law or agreed to in writing, software
35# distributed under the License is distributed on an "AS IS" BASIS,
36# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
37# See the License for the specific language governing permissions and
38# limitations under the License.
39#
40################################################################################
41
42FROM gcr.io/oss-fuzz-base/base-builder
43RUN apt-get update && apt-get install -y make autoconf automake libtool
44RUN git clone --depth 1 <git_url> %(project_name)s     # or use other version control
45WORKDIR %(project_name)s
46COPY build.sh $SRC/
47"""
48
49BUILD_TEMPLATE = """\
50#!/bin/bash -eu
51# Copyright %(year)d Google LLC
52#
53# Licensed under the Apache License, Version 2.0 (the "License");
54# you may not use this file except in compliance with the License.
55# You may obtain a copy of the License at
56#
57#      http://www.apache.org/licenses/LICENSE-2.0
58#
59# Unless required by applicable law or agreed to in writing, software
60# distributed under the License is distributed on an "AS IS" BASIS,
61# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
62# See the License for the specific language governing permissions and
63# limitations under the License.
64#
65################################################################################
66
67# build project
68# e.g.
69# ./autogen.sh
70# ./configure
71# make -j$(nproc) all
72
73# build fuzzers
74# e.g.
75# $CXX $CXXFLAGS -std=c++11 -Iinclude \\
76#     /path/to/name_of_fuzzer.cc -o $OUT/name_of_fuzzer \\
77#     $LIB_FUZZING_ENGINE /path/to/library.a
78"""
79