From 6b9816362da9fe322bfba2927b6bd0d5f1d35229 Mon Sep 17 00:00:00 2001 From: Inbal Honigman <12940082+InbalHoni@users.noreply.github.com> Date: Sun, 5 Jul 2026 11:34:01 +0300 Subject: [PATCH] fix(build): resolve rat license-check paths against project root MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The :rat task used relative paths, which resolved against the Gradle daemon's working directory rather than the project root — so it scanned the wrong directory and failed to find the report stylesheet, breaking `./gradlew clean assemble`. Anchor the scan directory, report, and stylesheet paths to the project (project.projectDir / project.buildDir). Additionally, add the missing Apache license header to .asf.yaml, which rat flagged as an unknown license. JIRA: https://issues.apache.org/jira/browse/DATAFU-185 --- .asf.yaml | 17 +++++++++++++++++ gradle/rat.gradle | 7 ++++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/.asf.yaml b/.asf.yaml index ab594763..fe71b3d4 100644 --- a/.asf.yaml +++ b/.asf.yaml @@ -1,3 +1,20 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + github: rulesets: - name: "Default Branch Protection" diff --git a/gradle/rat.gradle b/gradle/rat.gradle index 8c8ac5e8..2c3b2a37 100644 --- a/gradle/rat.gradle +++ b/gradle/rat.gradle @@ -28,18 +28,19 @@ class RatTask extends DefaultTask { @Input List excludes - def reportPath = 'build/rat' - def stylesheet = 'gradle/resources/rat-output-to-html.xsl' + def reportPath = "${project.buildDir}/rat" + def stylesheet = "${project.projectDir}/gradle/resources/rat-output-to-html.xsl" def xmlReport = reportPath + '/rat-report.xml' def htmlReport = reportPath + '/rat-report.html' def generateXmlReport(File reportDir) { def antBuilder = services.get(IsolatedAntBuilder) def ratClasspath = project.configurations.rat + def scanDir = project.projectDir antBuilder.withClasspath(ratClasspath).execute { ant.taskdef(resource: 'org/apache/rat/anttasks/antlib.xml') ant.report(format: 'xml', reportFile: xmlReport) { - fileset(dir: ".") { + fileset(dir: scanDir) { patternset { excludes.each { exclude(name: it)