Skip to content

Commit 4f40f95

Browse files
committed
Setup build to run Apache RAT
1 parent ac1dd29 commit 4f40f95

File tree

6 files changed

+65
-2
lines changed

6 files changed

+65
-2
lines changed

.github/workflows/rat.yml

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: RAT Report
2+
on:
3+
push:
4+
branches:
5+
- '[4-9]+.[0-9]+.x'
6+
- '[3-9]+.[3-9]+.x'
7+
- license-audit
8+
pull_request:
9+
branches:
10+
- '[4-9]+.[0-9]+.x'
11+
- '[3-9]+.[3-9]+.x'
12+
- license-audit
13+
workflow_dispatch:
14+
jobs:
15+
rat-audit:
16+
permissions:
17+
contents: read # to fetch code (actions/checkout)
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: "📥 Checkout repository"
21+
uses: actions/checkout@v4
22+
- name: "☕️ Setup JDK"
23+
uses: actions/setup-java@v4
24+
with:
25+
distribution: liberica
26+
java-version: 17
27+
- name: "🐘 Setup Gradle"
28+
uses: gradle/actions/setup-gradle@v4
29+
with:
30+
develocity-access-key: ${{ secrets.GRAILS_DEVELOCITY_ACCESS_KEY }}
31+
- name: "🧐 Apache License - Release Audit Tool"
32+
run: ./gradlew rat
33+
- name: Upload RAT HTML report
34+
if: always()
35+
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
36+
with:
37+
name: rat-report
38+
path: build/reports/rat/index.html
39+
- name: Publish RAT report in Job Summary
40+
run: |
41+
echo "## 📋 Apache RAT Report" >> $GITHUB_STEP_SUMMARY
42+
# inject raw HTML (it will render as HTML in the summary)
43+
cat build/reports/rat/index.html >> $GITHUB_STEP_SUMMARY

LICENSE

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
Apache License
1+
2+
Apache License
23
Version 2.0, January 2004
3-
https://www.apache.org/licenses/
4+
http://www.apache.org/licenses/
45

56
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
67

NOTICE

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Apache Groovy
2+
Copyright 2003-2025 The Apache Software Foundation
3+
4+
This product includes software developed at
5+
The Apache Software Foundation (http://www.apache.org/).

build.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ tasks.register('clean', Delete).configure {
7979
apply {
8080
from layout.projectDirectory.file('gradle/assemble-root-config.gradle')
8181
from layout.projectDirectory.file('gradle/publish-root-config.gradle')
82+
from layout.projectDirectory.file('gradle/rat-root-config.gradle')
8283
}
8384

8485
// For debugging the gradle task graph: Uncomment to show task dependencies when a task is run

buildSrc/build.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,5 @@ dependencies {
3030
implementation 'org.apache.grails:grails-gradle-plugins'
3131
implementation 'org.asciidoctor:asciidoctor-gradle-jvm'
3232
implementation 'org.springframework.boot:spring-boot-gradle-plugin'
33+
implementation 'org.nosphere.apache.rat:org.nosphere.apache.rat.gradle.plugin:0.8.1'
3334
}

gradle/rat-root-config.gradle

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apply plugin: 'org.nosphere.apache.rat'
2+
3+
tasks.named('rat') {
4+
excludes = [
5+
'.asf.yaml', // ASF metadata for github integration excluded from src zip
6+
'**/build/**', // Gradle generated build directories
7+
'**/.gradle/**', '**/wrapper/**', 'gradlew*', // gradle wrapper files excluded from src zip
8+
'**/*.html', // html files are only in test
9+
'**/resources/*', // exclude test artifacts
10+
'out/**', '*.ipr', '**/*.iml', '*.iws', '.idea/**', // Intellij generated files
11+
]
12+
}

0 commit comments

Comments
 (0)