Skip to content

Latest commit

 

History

History
125 lines (96 loc) · 4.7 KB

add_license_header.md

File metadata and controls

125 lines (96 loc) · 4.7 KB

CodeOps Studio - Add License Header Script

Overview

When you add new files to the project, please include the following license notice at the top of each file:

For files with extensions(.java,.py,.cpp,.gradle,.kt,.kts)

/*************************************************************************
 * This file is part of CodeOps Studio.
 * CodeOps Studio - Code anywhere anytime
 * https://github.com/euptron/CodeOps-Studio
 * Copyright (C) 2024-2025 EUP
 *
 * 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
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see https://www.gnu.org/licenses/
 *
 * If you have more questions, feel free to message EUP if you have any
 * questions or need additional information. Email: etido.up@gmail.com
 *************************************************************************/

For files with XML syntax (.xml)

<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ~ This file is part of CodeOps Studio.
 ~ CodeOps Studio - Code anywhere anytime
 ~ https://github.com/euptron/CodeOps-Studio
 ~ Copyright (C) 2024-2025 EUP
 ~ 
 ~ 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
 ~ the Free Software Foundation, either version 3 of the License, or
 ~ (at your option) any later version.
 ~ 
 ~ This program is distributed in the hope that it will be useful,
 ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
 ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 ~ GNU General Public License for more details.
 ~ 
 ~ You should have received a copy of the GNU General Public License
 ~ along with this program. If not, see https://www.gnu.org/licenses/
 ~ 
 ~ If you have more questions, feel free to message EUP if you have any
 ~ questions or need additional information. Email: etido.up@gmail.com
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->

You can do this automatically by using the add_license_header.sh script to automate the process of adding customizable license headers to files within your project directory in Termux. It ensures compliance with licensing requirements and maintains consistency across project files.

Features

  • Automatically adds license headers to multiple file types.
  • Supports both automatic addition to all files in a directory and specific file targeting.
  • Customizable license header content tailored for different file types.

Usage

Setup

  1. Navigate to Your Project Directory:

    • Open Termux and navigate to the directory containing add_license_header.sh:
      cd /path/to/your/project
  2. Set Execution Permissions:

    • Ensure the script has execute permissions:
      chmod +x add_license_header.sh

Automatic Header Addition

To add license headers to all files in your project directory:

$ bash add_license_header.sh

Adding Header to a Specific File

To add a license header to a specific file:

$ bash add_license_header.sh --manual path/to/your/file.java

Replace path/to/your/file.java with the actual path to the file you want to modify.

Customization

  • Modify License Header: Edit the LICENSE_HEADER variable in the script to customize license text for different file types.

Pros and Cons

Pros

  • Time-saving Automation: Automates the task of adding license headers, reducing manual effort.
  • Compliance Assurance: Ensures adherence to GNU General Public License (GPL) and project-specific licensing terms.
  • Flexibility: Handles bulk updates or specific file modifications seamlessly.

Cons

  • Skill Requirement: Basic knowledge of shell scripting is necessary for customization and troubleshooting.
  • Permission Issues: Ensure correct permissions (chmod +x) to execute the script in Termux.

Troubleshooting

  • Permission Denied: Grant execute permissions (chmod +x add_license_header.sh) if needed.
  • Customization Issues: Modify the LICENSE_HEADER variable within the script as required.

Contact

For further assistance or questions regarding add_license_header.sh, please contact me at etido.up@gmail.com.