diff --git a/copier.yml b/copier.yml index 2b7694d..cc42414 100644 --- a/copier.yml +++ b/copier.yml @@ -5,6 +5,7 @@ _exclude: - .copier-answers.*.yml - copier.*.yml + - licenses _envops: block_end_string: '%]' @@ -245,48 +246,67 @@ default_py: ss_cmake_repo_name: default: '{{ repo_name }}' - help: 'Provide a name for the repository:' type: str when: false ss_cmake_repo_url: default: '[% from pathjoin("includes", "variable.jinja") import repo_url with context %]{{ repo_url() }}' - help: 'Provide a url for the repository:' type: str when: false ss_cmake_project_description: default: '{{ project_description }}' - help: 'Provide a brief description for the project:' type: str when: false ss_cmake_configure_coverage: default: false - help: Whether to configure coverage in cmake integration for C++. type: bool when: false ss_cmake_configure_version: default: '{{ compiled }}' - help: Whether to configure to detect git version in cmake integration for C++ type: bool when: false ss_cmake_configure_warnings_and_hardening: default: '{{ compiled }}' - help: Whether to configure warnings and hardening compiling options in cmake integrationo for C++ type: bool when: false ss_cmake_use_cpm: default: '{{ use_cpm }}' - help: Whether to use CPM to manage C++ dependencies that will break up vcpkg dependency management. type: bool when: false ss_cmake_use_conan: default: '{{ use_conan }}' - help: Whether to use conan to manage C++ dependencies that will break up vcpkg dependency management. type: bool when: false + +# Override ss-license variables + +ss_license_project_name: + default: '{{ project_name }}' + type: str + when: false + +ss_license_project_description: + default: '{{ project_description }}' + type: str + when: false + +ss_license_copyright_license: + default: '{{ copyright_license }}' + type: str + when: false + +ss_license_copyright_year: + default: '{{ copyright_year }}' + type: str + when: false + +ss_license_copyright_holder: + default: '{{ copyright_holder }}' + type: str + when: false diff --git a/template/.copier-answers.ss-license.yml b/template/.copier-answers.ss-license.yml new file mode 100644 index 0000000..f119879 --- /dev/null +++ b/template/.copier-answers.ss-license.yml @@ -0,0 +1,3 @@ +# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY +_commit: v0.0.1 +_src_path: https://github.com/serious-scaffold/ss-license diff --git a/template/LICENSE.jinja b/template/LICENSE.jinja index a635cc0..842030b 100644 --- a/template/LICENSE.jinja +++ b/template/LICENSE.jinja @@ -1,2 +1,2 @@ -[%- set license_template = 'includes/licenses/' + copyright_license + '.jinja' -%] +[%- set license_template = 'template/licenses/' + copyright_license + '.jinja' -%] [%- include license_template -%] diff --git a/template/copier.ss-license.yml b/template/copier.ss-license.yml new file mode 100644 index 0000000..072ed43 --- /dev/null +++ b/template/copier.ss-license.yml @@ -0,0 +1,28 @@ +ss_license_project_name: + help: 'Enter the name of the project in CamelCase format:' + type: str + +ss_license_project_description: + help: 'Provide a brief description for the project:' + type: str + +ss_license_copyright_license: + choices: + - Apache Software License + - Boost Software License 1.0 (BSL-1.0) + - GNU Affero General Public License v3 + - GNU General Public License v3 (GPLv3) + - GNU Lesser General Public License v3 (LGPLv3) + - MIT License + - Mozilla Public License 2.0 (MPL 2.0) + - The Unlicense (Unlicense) + help: Choose the project's license (e.g. "MIT", "GPL-3.0"). + type: str + +ss_license_copyright_year: + help: Enter the copyright year or range (e.g. "2023", "2023-2024"). + type: str + +ss_license_copyright_holder: + help: Name(s) or organization(s) holding the copyright. + type: str diff --git a/includes/licenses/Apache Software License.jinja b/template/licenses/Apache Software License.jinja similarity index 99% rename from includes/licenses/Apache Software License.jinja rename to template/licenses/Apache Software License.jinja index b74bfd9..b826243 100644 --- a/includes/licenses/Apache Software License.jinja +++ b/template/licenses/Apache Software License.jinja @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright {{ copyright_year }} {{ copyright_holder }} + Copyright {{ ss_license_copyright_year }} {{ ss_license_copyright_holder }} Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/includes/licenses/Boost Software License 1.0 (BSL-1.0).jinja b/template/licenses/Boost Software License 1.0 (BSL-1.0).jinja similarity index 100% rename from includes/licenses/Boost Software License 1.0 (BSL-1.0).jinja rename to template/licenses/Boost Software License 1.0 (BSL-1.0).jinja diff --git a/includes/licenses/GNU Affero General Public License v3.jinja b/template/licenses/GNU Affero General Public License v3.jinja similarity index 99% rename from includes/licenses/GNU Affero General Public License v3.jinja rename to template/licenses/GNU Affero General Public License v3.jinja index d4cde68..6c7222d 100644 --- a/includes/licenses/GNU Affero General Public License v3.jinja +++ b/template/licenses/GNU Affero General Public License v3.jinja @@ -629,8 +629,8 @@ to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. - {{ project_name }}: {{ project_description }} - Copyright (C) {{ copyright_year }} {{ copyright_holder }} + {{ ss_license_project_name }}: {{ ss_license_project_description }} + Copyright (C) {{ ss_license_copyright_year }} {{ ss_license_copyright_holder }} This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published diff --git a/includes/licenses/GNU General Public License v3 (GPLv3).jinja b/template/licenses/GNU General Public License v3 (GPLv3).jinja similarity index 99% rename from includes/licenses/GNU General Public License v3 (GPLv3).jinja rename to template/licenses/GNU General Public License v3 (GPLv3).jinja index 3b7cfd1..be390cc 100644 --- a/includes/licenses/GNU General Public License v3 (GPLv3).jinja +++ b/template/licenses/GNU General Public License v3 (GPLv3).jinja @@ -631,8 +631,8 @@ to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. - {{ project_name }}: {{ project_description }} - Copyright (C) {{ copyright_year }} {{ copyright_holder }} + {{ ss_license_project_name }}: {{ ss_license_project_description }} + Copyright (C) {{ ss_license_copyright_year }} {{ ss_license_copyright_holder }} This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -652,7 +652,7 @@ Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: - {{ project_name }} Copyright (C) {{ copyright_year }} {{ copyright_holder }} + {{ ss_license_project_name }} Copyright (C) {{ ss_license_copyright_year }} {{ ss_license_copyright_holder }} This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. diff --git a/includes/licenses/GNU Lesser General Public License v3 (LGPLv3).jinja b/template/licenses/GNU Lesser General Public License v3 (LGPLv3).jinja similarity index 100% rename from includes/licenses/GNU Lesser General Public License v3 (LGPLv3).jinja rename to template/licenses/GNU Lesser General Public License v3 (LGPLv3).jinja diff --git a/includes/licenses/MIT License.jinja b/template/licenses/MIT License.jinja similarity index 92% rename from includes/licenses/MIT License.jinja rename to template/licenses/MIT License.jinja index 26a3778..241f017 100644 --- a/includes/licenses/MIT License.jinja +++ b/template/licenses/MIT License.jinja @@ -1,6 +1,6 @@ MIT License -Copyright (c) {{ copyright_year }} {{ copyright_holder }} +Copyright (c) {{ ss_license_copyright_year }} {{ ss_license_copyright_holder }} Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/includes/licenses/Mozilla Public License 2.0 (MPL 2.0).jinja b/template/licenses/Mozilla Public License 2.0 (MPL 2.0).jinja similarity index 100% rename from includes/licenses/Mozilla Public License 2.0 (MPL 2.0).jinja rename to template/licenses/Mozilla Public License 2.0 (MPL 2.0).jinja diff --git a/includes/licenses/The Unlicense (Unlicense).jinja b/template/licenses/The Unlicense (Unlicense).jinja similarity index 100% rename from includes/licenses/The Unlicense (Unlicense).jinja rename to template/licenses/The Unlicense (Unlicense).jinja