Skip to content

Commit

Permalink
🔨 Build: verify on check that all dependencies have compatible licenses
Browse files Browse the repository at this point in the history
Includes a comprehensive-ish list of licenses compatible with AGPL-3.0.
  • Loading branch information
berlix committed Jul 2, 2024
1 parent a7a786d commit 2d67848
Show file tree
Hide file tree
Showing 4 changed files with 104 additions and 4 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ jobs:
- name: Get tags for versioning the app
run: git fetch --tags -f

- name: Lint and test
run: ./gradlew lintRelease test --stacktrace
- name: Lint and check
run: ./gradlew lintRelease check --stacktrace

- name: Publish reports
uses: actions/upload-artifact@v1
with:
name: test-reports
name: reports
path: integration-test-app/build/reports

- name: Build APK
Expand Down
2 changes: 1 addition & 1 deletion git-hooks/pre-push
Original file line number Diff line number Diff line change
@@ -1 +1 @@
./gradlew lintDebug test
./gradlew lintDebug check
89 changes: 89 additions & 0 deletions integration-test-app/allowed-licenses.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
{
"allowedLicenses": [
{ "moduleLicense": "MIT" },
{ "moduleLicense": "MIT License" },
{ "moduleLicense": "The MIT License" },

{ "moduleLicense": "BSD-2-Clause" },
{ "moduleLicense": "BSD 2-Clause" },
{ "moduleLicense": "The BSD 2-Clause License" },

{ "moduleLicense": "BSD-3-Clause" },
{ "moduleLicense": "BSD 3-Clause" },
{ "moduleLicense": "The BSD 3-Clause License" },

{ "moduleLicense": "Apache-2.0" },
{ "moduleLicense": "Apache 2.0" },
{ "moduleLicense": "The Apache Software License, Version 2.0" },
{ "moduleLicense": "The Apache License, Version 2.0" },
{ "moduleLicense": "Apache License, Version 2.0" },

{ "moduleLicense": "GPL-3.0" },
{ "moduleLicense": "GPL 3.0" },
{ "moduleLicense": "GPLv3" },
{ "moduleLicense": "GPL 3" },
{ "moduleLicense": "GNU General Public License, version 3 (GPLv3)" },
{ "moduleLicense": "GNU General Public License, Version 3" },
{ "moduleLicense": "GNU General Public License v3.0" },

{ "moduleLicense": "GPL-3.0-only" },
{ "moduleLicense": "GNU General Public License v3.0 only" },

{ "moduleLicense": "GPL-3.0-or-later" },
{ "moduleLicense": "GPL-3.0+" },
{ "moduleLicense": "GNU General Public License v3.0 or later" },

{ "moduleLicense": "GPL-2.0-or-later" },
{ "moduleLicense": "GPL-2.0+" },
{ "moduleLicense": "GNU General Public License v2.0 or later" },

{ "moduleLicense": "GPL-1.0-or-later" },
{ "moduleLicense": "GPL-1.0+" },
{ "moduleLicense": "GNU General Public License v1.0 or later" },

{ "moduleLicense": "LGPL-3.0" },
{ "moduleLicense": "LGPL 3.0" },
{ "moduleLicense": "LGPLv3" },
{ "moduleLicense": "LGPL 3" },
{ "moduleLicense": "GNU Lesser General Public License, version 3 (GPLv3)" },
{ "moduleLicense": "GNU Lesser General Public License, Version 3" },
{ "moduleLicense": "GNU Lesser General Public License v3.0" },

{ "moduleLicense": "LGPL-3.0-only" },
{ "moduleLicense": "GNU Lesser General Public License v3.0 only" },

{ "moduleLicense": "LGPL-3.0-or-later" },
{ "moduleLicense": "LGPL-3.0+" },
{ "moduleLicense": "GNU Lesser General Public License v3.0 or later" },

{ "moduleLicense": "LGPL-2.1-or-later" },
{ "moduleLicense": "LGPL-2.1+" },
{ "moduleLicense": "GNU Lesser General Public License v2.1 or later" },

{ "moduleLicense": "LGPL-2.0-or-later" },
{ "moduleLicense": "LGPL-2.0+" },
{ "moduleLicense": "GNU Library General Public License v2.0 or later" },

{ "moduleLicense": "AGPL-3.0" },
{ "moduleLicense": "AGPL 3.0" },
{ "moduleLicense": "AGPLv3" },
{ "moduleLicense": "AGPL 3" },
{ "moduleLicense": "GNU Affero General Public License, version 3 (GPLv3)" },
{ "moduleLicense": "GNU Affero General Public License, Version 3" },
{ "moduleLicense": "GNU Affero General Public License v3.0" },

{ "moduleLicense": "AGPL-3.0-only" },
{ "moduleLicense": "GNU Affero General Public License v3.0 only" },

{ "moduleLicense": "AGPL-3.0-or-later" },
{ "moduleLicense": "AGPL-3.0+" },
{ "moduleLicense": "GNU Affero General Public License v3.0 or later" },

{ "moduleLicense": "AGPL-1.0-or-later" },
{ "moduleLicense": "AGPL-1.0+" },
{ "moduleLicense": "Affero General Public License v1.0 or later" },

{ "moduleLicense": "Zlib" },
{ "moduleLicense": "zlib License" }
]
}
11 changes: 11 additions & 0 deletions integration-test-app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,17 @@ android {

licenseReport {
renderers = arrayOf<ReportRenderer>(FullJsonReportRenderer())
allowedLicensesFile = File("$projectDir/allowed-licenses.json")
}

tasks.named("checkLicense") {
// The checkLicense task does not declare this input itself, so we do it here. This ensures
// that a modification of the file causes the checkLicense task to be re-evaluated.
inputs.file("$projectDir/allowed-licenses.json")
}

tasks.named("check") {
dependsOn("checkLicense")
}

dependencies {
Expand Down

0 comments on commit 2d67848

Please sign in to comment.