Skip to content

Commit 3329786

Browse files
authored
Add dependency report generation (#55)
* 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
1 parent a75600f commit 3329786

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

.github/workflows/main.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ jobs:
5353
uses: gradle/gradle-build-action@v2
5454
with:
5555
arguments: jpackageImageZip
56+
- if: ${{ matrix.os == 'macos-latest' }}
57+
name: Generate dependency report
58+
uses: gradle/gradle-build-action@v2
59+
with:
60+
arguments: downloadLicenses
5661
- if: ${{ matrix.os == 'macos-latest' }}
5762
name: Upload Mac pkg
5863
uses: actions/upload-artifact@v2
@@ -69,6 +74,14 @@ jobs:
6974
path: ./build/jpackage/*.msi
7075
if-no-files-found: error
7176
retention-days: 3
77+
- if: ${{ matrix.os == 'macos-latest' }}
78+
name: Upload Mac pkg
79+
uses: actions/upload-artifact@v2
80+
with:
81+
name: dependency-report
82+
path: ./build/reports/license/dependency-license*
83+
if-no-files-found: error
84+
retention-days: 3
7285
upload:
7386
name: Create release
7487
needs: build
@@ -85,5 +98,6 @@ jobs:
8598
files: |
8699
windows-package/*.msi
87100
macos-package/*.zip
101+
dependency-report/*
88102
draft: true
89103
fail_on_unmatched_files: true

build.gradle

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ plugins {
44
id 'application'
55
id 'org.openjfx.javafxplugin' version '0.0.10'
66
id 'org.beryx.runtime' version '1.12.5'
7+
id "com.github.hierynomus.license-report" version "0.16.1"
78
}
89

910
version = '2.0.0'
@@ -146,3 +147,26 @@ runtime {
146147
from layout.buildDirectory.dir("jpackage")
147148
}
148149
}
150+
151+
downloadLicenses {
152+
includeProjectDependencies = true
153+
dependencyConfiguration = 'runtimeClasspath'
154+
licenses = [
155+
// See https://github.com/Unidata/netcdf-java/blob/v5.3.3/LICENSE
156+
(group('edu.ucar')): license('The 3-Clause BSD License', 'https://opensource.org/license/bsd-3-clause/'),
157+
// See https://github.com/openjdk/jfx/blob/17%2B2/LICENSE
158+
(group('org.openjfx')): license('GNU General Public License version 2 with Classpath Exception', 'https://openjdk.org/legal/gplv2+ce.html'),
159+
// See https://github.com/javaee/jaxb-v2/blob/2.3.0/LICENSE
160+
(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'),
161+
// See https://github.com/openpnp/opencv/blob/v3.4.2-0/LICENSE
162+
(group('org.openpnp')): license('The 3-Clause BSD License', 'https://opensource.org/license/bsd-3-clause/'),
163+
]
164+
aliases = [
165+
(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'],
166+
(license('GNU Lesser General Public License version 2.1', 'https://opensource.org/license/lgpl-2-1/')) : ['GNU Lesser General Public License v2.1+'],
167+
(license('GNU General Public License version 2', 'https://opensource.org/license/gpl-2/')) : ['GNU General Public License v2+'],
168+
(license('The 2-Clause BSD License', 'https://opensource.org/license/bsd-2-clause/')) : ['Simplified BSD License', 'The BSD License', 'New BSD License'],
169+
(license('The 3-Clause BSD License', 'https://opensource.org/license/bsd-3-clause/')) : ['The BSD 3-Clause License (BSD3)', '3-Clause BSD License'],
170+
(license('The MIT License', 'https://opensource.org/license/mit/')) : ['MIT License', 'MIT']
171+
]
172+
}

0 commit comments

Comments
 (0)