From b11712fd51eb4fd878c53a18c060cd054446d2cf Mon Sep 17 00:00:00 2001 From: w3stling Date: Sun, 27 Apr 2025 08:05:41 +0200 Subject: [PATCH] Add jar manifest attributes --- .github/workflows/codeql-analysis.yml | 12 ++++-------- build.gradle | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index efe8c5d..b2b2202 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -30,9 +30,6 @@ jobs: steps: - name: Checkout repository âš™ī¸ uses: actions/checkout@v4 - with: - # Disabling shallow clone is recommended for improving relevancy of reporting - fetch-depth: 0 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL @@ -46,8 +43,8 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v3 + #- name: Autobuild + # uses: github/codeql-action/autobuild@v3 # â„šī¸ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl @@ -56,9 +53,8 @@ jobs: # and modify them (or add more) to build your code if your project # uses a compiled language - #- run: | - # make bootstrap - # make release + - name: Autobuild + run: ./gradlew clean build -x test - name: Perform CodeQL analysis uses: github/codeql-action/analyze@v3 diff --git a/build.gradle b/build.gradle index db38e38..fe9cfbc 100644 --- a/build.gradle +++ b/build.gradle @@ -3,6 +3,7 @@ plugins { id 'jacoco' id 'signing' id 'maven-publish' + id 'biz.aQute.bnd.builder' version '7.1.0' id 'io.github.gradle-nexus.publish-plugin' version '2.0.0' id 'org.sonarqube' version '6.1.0.5360' id 'me.champeau.gradle.jmh' version '0.5.3' @@ -59,6 +60,24 @@ jacocoTestReport { } } +jar { + manifest { + attributes( + "Build-Jdk-Spec": java.targetCompatibility, + "Implementation-Title": "Insynsregistret", + "Implementation-Version": version, + "Specification-Title": "Insynsregistret", + "Specification-Version": version.replace("-SNAPSHOT", ""), + "Automatic-Module-Name": moduleName, + "Bundle-SymbolicName": moduleName, + "Bundle-Description": "Java library for extracting data from the Financial Supervisory Authority (Finansinspektionen) insider registry", + "Bundle-License": "https://opensource.org/licenses/MIT", + "Bundle-Name": "Insynsregistret", + "Export-Package": "*;-split-package:=merge-first;-noimport:=true", + ) + } +} + nexusPublishing { repositories { sonatype {