Add License text to every source file
This commit is contained in:
@@ -5,6 +5,8 @@ from pathlib import Path
|
||||
|
||||
# Simple Script to generate/update Assets
|
||||
|
||||
license_text = "/**\n* This file is part of RenderD7\n* Copyright (C) 2021-2024 NPI-D7, tobid7\n*\n* This program is free software: you can redistribute it and/or modify\n* it under the terms of the GNU General Public License as published by\n* the Free Software Foundation, either version 3 of the License, or\n* (at your option) any later version.\n*\n* This program is distributed in the hope that it will be useful,\n* but WITHOUT ANY WARRANTY; without even the implied warranty of\n* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n* GNU General Public License for more details.\n*\n* You should have received a copy of the GNU General Public License\n* along with this program. If not, see <http://www.gnu.org/licenses/>.\n*/\n\n"
|
||||
|
||||
def file2array(path, custom_incluse_path):
|
||||
print(path)
|
||||
cip = len(custom_incluse_path)
|
||||
@@ -16,6 +18,8 @@ def file2array(path, custom_incluse_path):
|
||||
buf = filei.read()
|
||||
filei.close()
|
||||
fs = open(name + '.cpp', 'w')
|
||||
fs.write(license_text)
|
||||
fs.write("// THIS FILE WAS GENERATED BY generate_assets.py!!!\n\n")
|
||||
fs.write('#include <'+ sip + name + '.hpp>\n\n')
|
||||
fs.write('// clang-format off\n')
|
||||
fs.write('unsigned char ' + name + '[] = {\n')
|
||||
@@ -26,6 +30,8 @@ def file2array(path, custom_incluse_path):
|
||||
fs.write('size_t ' + name + '_size = ' + hex(len(buf)) + ';')
|
||||
fs.close()
|
||||
fh = open(name + '.hpp', 'w')
|
||||
fh.write(license_text)
|
||||
fh.write("// THIS FILE WAS GENERATED BY generate_assets.py!!!\n\n")
|
||||
fh.write('#pragma once\n\n')
|
||||
fh.write('#include <cstddef>\n\n')
|
||||
fh.write('extern unsigned char ' + name + '[];\n')
|
||||
|
||||
Reference in New Issue
Block a user