//////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2023, 2026 Contributors to the Eclipse Foundation
//
// See the NOTICE file(s) distributed with this work for additional
// information regarding copyright ownership.
//
// This program and the accompanying materials are made available
// under the terms of the MIT License which is available at
// https://opensource.org/licenses/MIT
//
// SPDX-License-Identifier: MIT
//////////////////////////////////////////////////////////////////////////////

include::_part_attributes.asciidoc[]

:leveloffset: -2

[[development-license-year-update-chapter-index]]
== License year update

The source files in the Eclipse ESCET toolset contain license headers.
The current year is part of that license header.
Therefore, at the beginning of each new year, the license headers need to be updated.

To update the license year:

* Update the desired license-header regular expression in `org.eclipse.escet.root/misc/license-header/license-header-check.bash`.
* Change the year in the source file headers, where `xxxx` is the previous year, `yyyy` is the new year, and `zzzz` the year after that:
** In Eclipse, select menu:Search[Search...].
** For _Containg text_ enter: `([0-9]\{4\}), xxxx Contributors to the Eclipse Foundation`.
** Enable _Regular expression_ and disable _Case sensitive_.
** For _File name patterns_ enter `*`.
** For _Scope_ select _Workspace_.
** Click btn:[Replace...] and wait for the _Replace Text Matches_ window to appear.
** For _With_ enter: `$1, yyyy Contributors to the Eclipse Foundation`.
** Click btn:[OK].
** If problems are found, review them and click btn:[Continue].
** Again select menu:Search[Search...].
** For _Containg text_ enter: `xxxx Contributors to the Eclipse Foundation`.
** Click btn:[Replace...] and wait for the _Replace Text Matches_ window to appear.
** For _With_ enter: `xxxx, yyyy Contributors to the Eclipse Foundation`.
** Commit the changes of the automatic regular expression replacements, to more easily see the subsequent changes.
** Update the header of `org.eclipse.escet.setext.tests.integration/test_models/models_invalid/char_cls_empty.setext` manually.
* Check if anything was missed by searching for the previous year (menu:Search[Search...]).
* Run `license-header-check.bash` and fix the violations if there are any.
* Commit the remaining changes.
* Create a license update issue for next year:
** Go to https://gitlab.eclipse.org/eclipse/escet/escet/-/issues.
** Sign in with your Eclipse Foundation account using the link at the top-right of the page.
** Click _New issue_.
** For _Title_ enter `Update license headers for zzzz`.
** For _Labels_ select _RelEng/DevOps_ and _Type::Enhancement_.
** For _Description_ enter `See the development documentation for the steps to follow.`
** For _Due data_ select the first day of the new year.
** Click _Create issue_.
