Skip to content

Add REUSE-compliant copyright and license headers - #57

Merged
aaronzi merged 2 commits into
mainfrom
add-reuse-spdx-headers
Nov 5, 2026
Merged

aaronzi merged 2 commits into
mainfrom
add-reuse-spdx-headers

Conversation

@aaronzi

@aaronzi aaronzi commented Nov 5, 2026

Copy link
Copy Markdown
Member

The Eclipse IP team asked us to add copyright statements and license information (REUSE, SPDX) to the source files as part of the IP review of this repository (iplab issue 32776). This follows the same scheme as eclipse-aascw/aas-core3.0-python#62.

What changes

  • Every file that can carry a comment now starts with
    // SPDX-FileCopyrightText: 2023 aas-core3.0-java AUTHORS
    //
    // SPDX-License-Identifier: MIT
    
    This keeps the holder and year already used in LICENSE. Python, TOML, YAML, .gitignore and pylint.rc use #, mypy.ini uses ;. In Java files the header goes above the existing comment and the package line. In dev_scripts/continuous_integration_of_dev_scripts/precommit.py it goes after the shebang. In both pom.xml files it is an XML comment after the XML declaration. doc/overview.html gets an HTML comment before <body>, so it doesn't show up in the Javadoc overview.
  • REUSE.toml covers the files that shouldn't carry an inline header:
    • Prose and metadata: README.md, CONTRIBUTING.md, AUTHORS and dev_scripts/semantic-patching/README.md.
    • dev_scripts/codegen/snippets/**: aas-core-codegen inserts these verbatim into the generated code, so a header there would end up in the middle of Verification.java and the types.
    • test_data/** and src/test/java/testgen_rev.txt: JSON can't carry comments, the recorded outputs are compared byte-for-byte, and the update script reads the revision file.
  • LICENSES/MIT.txt adds the license text in the layout REUSE expects. The root LICENSE is unchanged.
  • Generated SDK code: aas-core-codegen doesn't emit headers. dev_scripts/codegen/codegen.py now prepends the header to every Java file in the output directory src/main/java/aas_core/aas3_0. It doesn't rely on the automatically generated by aas-core-codegen marker, because the generated builders in generation/ don't carry it.
  • Semantic patching: PatchVerification re-prints Verification.java with JavaParser. That keeps the header, but drops the empty line after it. update_to_aas_core_meta_codegen.py now restores the header after patching, so Verification.java starts like the other generated files.
  • Meta-model: dev_scripts/codegen/meta_model.py is a verbatim copy from aas-core-meta. It is attributed to 2024 aas-core-meta AUTHORS (as in that repository's LICENSE), and download_aas_core_meta_model.py now prepends that header on download. It skips the prepend if the downloaded file already contains SPDX-License-Identifier:, so the header isn't duplicated once aas-core-meta carries it upstream.
  • A new workflow .github/workflows/reuse.yml runs reuse lint (pinned reuse==6.3.0) on pushes and pull requests to main, so CI catches files added without headers. The existing workflows are unchanged apart from the header.

Verification

  • reuse lint: 13115/13115 files have copyright and license information. The repository is compliant with REUSE 3.3.
  • I regenerated the SDK with aas-core-codegen 9db4f51, the semantic patching and mvn spotless:apply, before and after this change. The diff against the committed files is identical in both runs, apart from the added headers. That leftover diff is a pre-existing difference, not caused by this PR: the current JavaParser drops the trailing automatically generated comment at the end of Verification.java. So the headers survive regeneration and change nothing else.
  • I re-ran download_aas_core_meta_model.py offline against the pinned aas-core-meta commit 11b116c5. The output equals the committed meta_model.py. With an upstream file that already has a header, the header is written only once.
  • mvn spotless:check, mvn test-compile and mvn javadoc:javadoc pass (JDK 17). check_docs_package_version.py --validate passes.
  • The dev scripts precommit (black, mypy, pylint, doctest) passes.
  • I didn't run the full test suite locally, so CI covers it. The changes are comments, plus the small helper additions in dev_scripts/.

Follow-up

The generated tests (src/test/java/Test*.java, Common*.java) come from aas-core3.0-testgen and carry inline headers now. When they are regenerated and copied over, the headers need to be kept or re-added. The REUSE workflow will flag it if they're missing.

@aaronzi
aaronzi merged commit 86e2c3a into main Nov 5, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant