From c4b41e9146e7b7d3d770f47b599109843eccb755 Mon Sep 17 00:00:00 2001 From: Matteo Hausner Date: Sun, 12 Jan 2025 01:29:06 +0100 Subject: [PATCH] build.gradle: replace `new File()` with `file()` --- build.gradle | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index a9ac198b..f46e26d4 100644 --- a/build.gradle +++ b/build.gradle @@ -19,7 +19,7 @@ plugins { id 'org.gradlex.extra-java-module-info' version '1.9' } -def dotGitFile = new File("$projectDir/.git") +def dotGitFile = file "$projectDir/.git" def gitDir if (dotGitFile.isFile()) { def gitDirConfigValue = dotGitFile.readLines().stream().mapMulti { line, downstream -> @@ -181,7 +181,7 @@ extraJavaModuleInfo { tasks.register('generateModuleInfo') { description = "Generates the \'$moduleInfoFile\' source file" doLast { - new File(moduleInfoFile).write """\ + file(moduleInfoFile).write """\ @SuppressWarnings({"requires-automatic", "Java9RedundantRequiresStatement"}) module de.bwravencl.controllerbuddy { exports de.bwravencl.controllerbuddy.gui; @@ -335,7 +335,7 @@ tasks.register('generateConstants') { licensesHtmlStringBuilder.insert(licensesHtmlStringBuilder.lastIndexOf(''), 'SDL_GameControllerDBgamecontrollerdb.txtzlib LicenseShow license agreement') licensesHtmlStringBuilder.insert(licensesHtmlStringBuilder.lastIndexOf(''), '') - def file = new File(constantsFile) + def file = file constantsFile file.getParentFile().mkdirs() file.write("""\ package de.bwravencl.controllerbuddy.constants;\n