Skip to content

Commit

Permalink
Add dependency report generation (#55)
Browse files Browse the repository at this point in the history
* Add Gradle license plugin allowing to generate dependency report

* Add dependency report generation to the GitHub workflow

Upload the dependency report artifact a build artifacts and release
assets

* Only declare com.github.hierynomus.dependency-report plugin
  • Loading branch information
sbesson authored Feb 16, 2024
1 parent a75600f commit 3329786
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ jobs:
uses: gradle/gradle-build-action@v2
with:
arguments: jpackageImageZip
- if: ${{ matrix.os == 'macos-latest' }}
name: Generate dependency report
uses: gradle/gradle-build-action@v2
with:
arguments: downloadLicenses
- if: ${{ matrix.os == 'macos-latest' }}
name: Upload Mac pkg
uses: actions/upload-artifact@v2
Expand All @@ -69,6 +74,14 @@ jobs:
path: ./build/jpackage/*.msi
if-no-files-found: error
retention-days: 3
- if: ${{ matrix.os == 'macos-latest' }}
name: Upload Mac pkg
uses: actions/upload-artifact@v2
with:
name: dependency-report
path: ./build/reports/license/dependency-license*
if-no-files-found: error
retention-days: 3
upload:
name: Create release
needs: build
Expand All @@ -85,5 +98,6 @@ jobs:
files: |
windows-package/*.msi
macos-package/*.zip
dependency-report/*
draft: true
fail_on_unmatched_files: true
24 changes: 24 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ plugins {
id 'application'
id 'org.openjfx.javafxplugin' version '0.0.10'
id 'org.beryx.runtime' version '1.12.5'
id "com.github.hierynomus.license-report" version "0.16.1"
}

version = '2.0.0'
Expand Down Expand Up @@ -146,3 +147,26 @@ runtime {
from layout.buildDirectory.dir("jpackage")
}
}

downloadLicenses {
includeProjectDependencies = true
dependencyConfiguration = 'runtimeClasspath'
licenses = [
// See https://github.com/Unidata/netcdf-java/blob/v5.3.3/LICENSE
(group('edu.ucar')): license('The 3-Clause BSD License', 'https://opensource.org/license/bsd-3-clause/'),
// See https://github.com/openjdk/jfx/blob/17%2B2/LICENSE
(group('org.openjfx')): license('GNU General Public License version 2 with Classpath Exception', 'https://openjdk.org/legal/gplv2+ce.html'),
// See https://github.com/javaee/jaxb-v2/blob/2.3.0/LICENSE
(group('javax.xml.bind')): license('Common Development and Distribution License 1.1 and GNU General Public License version 2 with Classpath Exception', 'https://oss.oracle.com/licenses/CDDL+GPL-1.1'),
// See https://github.com/openpnp/opencv/blob/v3.4.2-0/LICENSE
(group('org.openpnp')): license('The 3-Clause BSD License', 'https://opensource.org/license/bsd-3-clause/'),
]
aliases = [
(license('Apache License, Version 2.0', 'http://www.apache.org/licenses/LICENSE-2.0')) : ['The Apache Software License, Version 2.0', 'Apache 2', 'Apache License Version 2.0', 'Apache License 2.0', 'The Apache License, Version 2.0', 'Apache 2.0', 'Apache-2.0'],
(license('GNU Lesser General Public License version 2.1', 'https://opensource.org/license/lgpl-2-1/')) : ['GNU Lesser General Public License v2.1+'],
(license('GNU General Public License version 2', 'https://opensource.org/license/gpl-2/')) : ['GNU General Public License v2+'],
(license('The 2-Clause BSD License', 'https://opensource.org/license/bsd-2-clause/')) : ['Simplified BSD License', 'The BSD License', 'New BSD License'],
(license('The 3-Clause BSD License', 'https://opensource.org/license/bsd-3-clause/')) : ['The BSD 3-Clause License (BSD3)', '3-Clause BSD License'],
(license('The MIT License', 'https://opensource.org/license/mit/')) : ['MIT License', 'MIT']
]
}

0 comments on commit 3329786

Please sign in to comment.