|
19 | 19 | // For additional notes and disclaimer from gematik and in case of changes by gematik, |
20 | 20 | // find details in the "Readme" file. |
21 | 21 |
|
| 22 | +use chrono::Datelike; |
22 | 23 | use std::{ |
23 | 24 | env, fs, |
24 | 25 | path::{Path, PathBuf}, |
25 | 26 | process::Command, |
26 | 27 | }; |
27 | 28 |
|
| 29 | +fn get_license_header() -> String { |
| 30 | + let year = chrono::Utc::now().year(); |
| 31 | + format!( |
| 32 | + r#" |
| 33 | +// SPDX-FileCopyrightText: Copyright {year} gematik GmbH |
| 34 | +// |
| 35 | +// SPDX-License-Identifier: Apache-2.0 |
| 36 | +// |
| 37 | +// Licensed under the Apache License, Version 2.0 (the "License"); |
| 38 | +// you may not use this file except in compliance with the License. |
| 39 | +// You may obtain a copy of the License at |
| 40 | +// |
| 41 | +// http://www.apache.org/licenses/LICENSE-2.0 |
| 42 | +// |
| 43 | +// Unless required by applicable law or agreed to in writing, software |
| 44 | +// distributed under the License is distributed on an "AS IS" BASIS, |
| 45 | +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 46 | +// See the License for the specific language governing permissions and |
| 47 | +// limitations under the License. |
| 48 | +// |
| 49 | +// ******* |
| 50 | +// |
| 51 | +// For additional notes and disclaimer from gematik and in case of changes by gematik, |
| 52 | +// find details in the "Readme" file."# |
| 53 | + ) |
| 54 | + .trim() |
| 55 | + .to_string() |
| 56 | +} |
| 57 | + |
28 | 58 | fn current_dir() -> PathBuf { |
29 | 59 | env::current_dir().unwrap() |
30 | 60 | } |
@@ -147,6 +177,7 @@ fn build_openssl_bindings() { |
147 | 177 | .size_t_is_usize(true) |
148 | 178 | .layout_tests(true) |
149 | 179 | .prepend_enum_name(true) |
| 180 | + .raw_line(get_license_header()) |
150 | 181 | .formatter(bindgen::Formatter::Rustfmt) |
151 | 182 | .header(wrapper_header.display().to_string()) |
152 | 183 | .clang_args(clang_args) |
|
0 commit comments