1
mirror of https://github.com/TeamNewPipe/NewPipe synced 2024-11-24 20:17:16 +01:00

Use 'tasks.register' for Gradle tasks

This commit is contained in:
TacoTheDank 2023-10-31 21:28:24 -04:00 committed by Stypox
parent 4a7fda95ae
commit 0f81a0504c
No known key found for this signature in database
GPG Key ID: 4BDF1B40A49FDD23

View File

@ -132,7 +132,7 @@ checkstyle {
toolVersion = checkstyleVersion
}
task runCheckstyle(type: Checkstyle) {
tasks.register('runCheckstyle', Checkstyle) {
source 'src'
include '**/*.java'
exclude '**/gen/**'
@ -153,7 +153,7 @@ task runCheckstyle(type: Checkstyle) {
def outputDir = "${project.buildDir}/reports/ktlint/"
def inputFiles = project.fileTree(dir: "src", include: "**/*.kt")
task runKtlint(type: JavaExec) {
tasks.register('runKtlint', JavaExec) {
inputs.files(inputFiles)
outputs.dir(outputDir)
getMainClass().set("com.pinterest.ktlint.Main")
@ -162,7 +162,7 @@ task runKtlint(type: JavaExec) {
jvmArgs("--add-opens", "java.base/java.lang=ALL-UNNAMED")
}
task formatKtlint(type: JavaExec) {
tasks.register('formatKtlint', JavaExec) {
inputs.files(inputFiles)
outputs.dir(outputDir)
getMainClass().set("com.pinterest.ktlint.Main")