From 70b2e80a5330f50de108c3ef91c35e63ccfc85cd Mon Sep 17 00:00:00 2001 From: Aayush Gupta Date: Fri, 21 Nov 2025 18:50:50 +0800 Subject: [PATCH 1/5] Migrate to Kotlin DSL and build version catalog * https://docs.gradle.org/current/userguide/kotlin_dsl.html * https://docs.gradle.org/current/userguide/version_catalogs.html Signed-off-by: Aayush Gupta --- build.gradle | 91 ----------------------------- build.gradle.kts | 94 ++++++++++++++++++++++++++++++ extractor/build.gradle | 71 ---------------------- extractor/build.gradle.kts | 73 +++++++++++++++++++++++ gradle/libs.versions.toml | 35 +++++++++++ settings.gradle | 2 - settings.gradle.kts | 22 +++++++ timeago-generator/build.gradle | 5 -- timeago-generator/build.gradle.kts | 10 ++++ timeago-parser/build.gradle | 3 - timeago-parser/build.gradle.kts | 8 +++ 11 files changed, 242 insertions(+), 172 deletions(-) delete mode 100644 build.gradle create mode 100644 build.gradle.kts delete mode 100644 extractor/build.gradle create mode 100644 extractor/build.gradle.kts create mode 100644 gradle/libs.versions.toml delete mode 100644 settings.gradle create mode 100644 settings.gradle.kts delete mode 100644 timeago-generator/build.gradle create mode 100644 timeago-generator/build.gradle.kts delete mode 100644 timeago-parser/build.gradle create mode 100644 timeago-parser/build.gradle.kts diff --git a/build.gradle b/build.gradle deleted file mode 100644 index 87f3709e41..0000000000 --- a/build.gradle +++ /dev/null @@ -1,91 +0,0 @@ -allprojects { - apply plugin: 'java-library' - apply plugin: 'maven-publish' - - compileJava.options.encoding = 'UTF-8' - compileTestJava.options.encoding = 'UTF-8' - - sourceCompatibility = JavaVersion.VERSION_11 - targetCompatibility = JavaVersion.VERSION_11 - - version 'v0.24.8' - group 'com.github.TeamNewPipe' - - repositories { - mavenCentral() - maven { url "https://jitpack.io" } - } - - afterEvaluate { - publishing { - publications { - mavenJava(MavenPublication) { - from components.java - } - } - } - } - - ext { - nanojsonVersion = "e9d656ddb49a412a5a0a5d5ef20ca7ef09549996" - jsr305Version = "3.0.2" - junitVersion = "5.14.1" - checkstyleVersion = "10.26.1" - } -} - -dependencies { - api project(':extractor') - implementation project(':timeago-parser') -} - -subprojects { - tasks.register('sourcesJar', Jar) { - dependsOn classes - archiveClassifier.set('sources') - from sourceSets.main.allSource - } - - // Protobuf files would uselessly end up in the JAR otherwise, see - // https://github.com/google/protobuf-gradle-plugin/issues/390 - tasks.withType(Jar).configureEach { - exclude '**/*.proto' - includeEmptyDirs false - } - - tasks.withType(Test).configureEach { - testLogging { - events "skipped", "failed" - showStandardStreams = true - exceptionFormat = 'full' - } - } - - artifacts { - archives sourcesJar - } -} - -// https://discuss.gradle.org/t/best-approach-gradle-multi-module-project-generate-just-one-global-javadoc/18657/21 -tasks.register('aggregatedJavadocs', Javadoc) { - destinationDir = layout.buildDirectory.file("docs/javadoc").get().asFile - title = "$project.name $version" - // options.memberLevel = JavadocMemberLevel.PRIVATE - options.links 'https://docs.oracle.com/javase/11/docs/api/' - options.encoding 'UTF-8' - // Fixes unknown tag @implNote; the other two were added precautionary - options.tags = [ - "apiNote:a:API Note:", - "implSpec:a:Implementation Requirements:", - "implNote:a:Implementation Note:" - ] - - subprojects.each { project -> - project.tasks.withType(Javadoc).each { javadocTask -> - source += javadocTask.source - classpath += javadocTask.classpath - excludes += javadocTask.excludes - includes += javadocTask.includes - } - } -} diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 0000000000..a269ef7172 --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,94 @@ +/* + * SPDX-FileCopyrightText: 2025 NewPipe e.V. + * SPDX-License-Identifier: GPL-3.0-or-later + */ + +import org.gradle.api.tasks.testing.logging.TestExceptionFormat +import org.gradle.api.tasks.testing.logging.TestLogEvent + +plugins { + alias(libs.plugins.google.protobuf) apply false +} + +allprojects { + apply(plugin = "java-library") + apply(plugin = "maven-publish") + + tasks.withType { + options.encoding = Charsets.UTF_8.toString() + } + + extensions.configure { + toolchain { + languageVersion.set(JavaLanguageVersion.of(11)) + } + } + + version = "v0.24.8" + group = "com.github.TeamNewPipe" + + afterEvaluate { + extensions.configure("publishing") { + publications { + create("mavenJava") { + from(components["java"]) + } + } + } + } +} + +subprojects { + + // sourcesJar task + val sourcesJar by tasks.registering(Jar::class) { + dependsOn("classes") + archiveClassifier.set("sources") + from(provider { the().sourceSets["main"].allSource }) + } + + // Prevent .proto files ending up in JARs + tasks.withType().configureEach { + exclude("**/*.proto") + includeEmptyDirs = false + } + + // Test logging setup + tasks.withType().configureEach { + testLogging { + events = setOf(TestLogEvent.SKIPPED, TestLogEvent.FAILED) + showStandardStreams = true + exceptionFormat = TestExceptionFormat.FULL + } + } + + // Register sources JAR as artifact + artifacts { + add("archives", sourcesJar) + } +} + +// https://discuss.gradle.org/t/best-approach-gradle-multi-module-project-generate-just-one-global-javadoc/18657/21 +tasks.register("aggregatedJavadocs") { + title = "${project.name} ${project.version}" + setDestinationDir(layout.buildDirectory.dir("docs/javadoc").get().asFile) + + (options as StandardJavadocDocletOptions).apply { + encoding = Charsets.UTF_8.toString() + links = listOf("https://docs.oracle.com/javase/11/docs/api/") + tags = listOf( + "apiNote:a:API Note:", + "implSpec:a:Implementation Requirements:", + "implNote:a:Implementation Note:" + ) + } + + subprojects.forEach { subProject -> + subProject.tasks.withType().forEach { javadocTask -> + source = javadocTask.source + classpath += javadocTask.classpath + excludes += javadocTask.excludes + includes += javadocTask.includes + } + } +} diff --git a/extractor/build.gradle b/extractor/build.gradle deleted file mode 100644 index 22da78a09e..0000000000 --- a/extractor/build.gradle +++ /dev/null @@ -1,71 +0,0 @@ -plugins { - id "checkstyle" - id "com.google.protobuf" version "0.9.6" -} - -test { - // Pass on downloader type to tests for different CI jobs. See DownloaderFactory.java and ci.yml - if (System.properties.containsKey('downloader')) { - systemProperty('downloader', System.getProperty('downloader')) - } - useJUnitPlatform() - dependsOn checkstyleMain // run checkstyle when testing -} - -checkstyle { - getConfigDirectory().set(rootProject.file("checkstyle")) - ignoreFailures false - showViolations true - toolVersion checkstyleVersion -} - -// Exclude Protobuf generated files from Checkstyle -checkstyleMain.exclude("org/schabi/newpipe/extractor/services/youtube/protos") - -checkstyleTest { - enabled false // do not checkstyle test files -} - -ext { - rhinoVersion = '1.8.1' - protobufVersion = '4.33.2' -} - -dependencies { - implementation project(':timeago-parser') - - implementation "com.github.TeamNewPipe:nanojson:$nanojsonVersion" - implementation 'org.jsoup:jsoup:1.21.2' - implementation "com.google.code.findbugs:jsr305:$jsr305Version" - implementation "com.google.protobuf:protobuf-javalite:$protobufVersion" - - implementation "org.mozilla:rhino:$rhinoVersion" - implementation "org.mozilla:rhino-engine:$rhinoVersion" - - checkstyle "com.puppycrawl.tools:checkstyle:$checkstyleVersion" - - testImplementation platform("org.junit:junit-bom:$junitVersion") - testImplementation 'org.junit.jupiter:junit-jupiter-api' - testRuntimeOnly 'org.junit.platform:junit-platform-launcher' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine' - testImplementation 'org.junit.jupiter:junit-jupiter-params' - - testImplementation "com.squareup.okhttp3:okhttp:5.3.2" - testImplementation 'com.google.code.gson:gson:2.13.2' -} - -protobuf { - protoc { - artifact = "com.google.protobuf:protoc:$protobufVersion" - } - - generateProtoTasks { - all().configureEach { task -> - task.builtins { - java { - option "lite" - } - } - } - } -} diff --git a/extractor/build.gradle.kts b/extractor/build.gradle.kts new file mode 100644 index 0000000000..090aec6646 --- /dev/null +++ b/extractor/build.gradle.kts @@ -0,0 +1,73 @@ +/* + * SPDX-FileCopyrightText: 2025 NewPipe e.V. + * SPDX-License-Identifier: GPL-3.0-or-later + */ + +plugins { + alias(libs.plugins.google.protobuf) + checkstyle +} + +tasks.test { + // Pass on downloader type to tests for different CI jobs. + if (System.getProperties().containsKey("downloader")) { + systemProperty("downloader", System.getProperty("downloader")) + } + useJUnitPlatform() + dependsOn(tasks.checkstyleMain) // run checkstyle when testing +} + +checkstyle { + configDirectory = rootProject.file("checkstyle") + isIgnoreFailures = false + isShowViolations = true + toolVersion = libs.versions.checkstyle.get() +} + +// Exclude Protobuf generated files from Checkstyle +tasks.checkstyleMain { + exclude("org/schabi/newpipe/extractor/services/youtube/protos") +} + +tasks.checkstyleTest { + isEnabled = false // do not checkstyle test files +} + +dependencies { + implementation(project(":timeago-parser")) + + implementation(libs.newpipe.nanojson) + implementation(libs.jsoup) + implementation(libs.google.jsr305) + implementation(libs.google.protobuf) + + implementation(libs.mozilla.rhino.core) + implementation(libs.mozilla.rhino.engine) + + checkstyle(libs.puppycrawl.checkstyle) + + testImplementation(platform(libs.junit.bom)) + testImplementation(libs.junit.jupiter.api) + testRuntimeOnly(libs.junit.platform.launcher) + testRuntimeOnly(libs.junit.jupiter.engine) + testImplementation(libs.junit.jupiter.params) + + testImplementation(libs.squareup.okhttp) + testImplementation(libs.google.gson) +} + +protobuf { + protoc { + artifact = "com.google.protobuf:protoc:${libs.versions.protobuf.lib.get()}" + } + + generateProtoTasks { + all().forEach { task -> + task.builtins { + named("java") { + option("lite") + } + } + } + } +} diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 0000000000..770df7cc11 --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,35 @@ +# +# SPDX-FileCopyrightText: 2025 NewPipe e.V. +# SPDX-License-Identifier: GPL-3.0-or-later +# + +[versions] +checkstyle = "10.26.1" +gson = "2.13.2" +jsr305 = "3.0.2" +junit = "5.14.1" +jsoup = "1.21.2" +okhttp = "5.3.2" +protobuf-lib = "4.33.2" +protobuf-plugin = "0.9.6" +rhino = "1.8.1" +teamnewpipe-nanojson = "e9d656ddb49a412a5a0a5d5ef20ca7ef09549996" + +[libraries] +google-jsr305 = { module = "com.google.code.findbugs:jsr305", version.ref = "jsr305" } +google-gson = { module = "com.google.code.gson:gson", version.ref = "gson" } +google-protobuf = { module = "com.google.protobuf:protobuf-javalite", version.ref = "protobuf-lib" } +junit-bom = { module = "org.junit:junit-bom", version.ref = "junit" } +junit-jupiter-api = { module = "org.junit.jupiter:junit-jupiter-api" } +junit-jupiter-engine = { module = "org.junit.jupiter:junit-jupiter-engine" } +junit-jupiter-params = { module = "org.junit.jupiter:junit-jupiter-params" } +junit-platform-launcher = { module = "org.junit.platform:junit-platform-launcher" } +jsoup = { module = "org.jsoup:jsoup", version.ref = "jsoup" } +mozilla-rhino-core = { module = "org.mozilla:rhino", version.ref = "rhino" } +mozilla-rhino-engine = { module = "org.mozilla:rhino-engine", version.ref = "rhino" } +newpipe-nanojson = { module = "com.github.TeamNewPipe:nanojson", version.ref = "teamnewpipe-nanojson" } +puppycrawl-checkstyle = { module = "com.puppycrawl.tools:checkstyle", version.ref = "checkstyle" } +squareup-okhttp = { module = "com.squareup.okhttp3:okhttp", version.ref = "okhttp" } + +[plugins] +google-protobuf = { id = "com.google.protobuf", version.ref = "protobuf-plugin" } diff --git a/settings.gradle b/settings.gradle deleted file mode 100644 index 81908ff580..0000000000 --- a/settings.gradle +++ /dev/null @@ -1,2 +0,0 @@ -include 'extractor', 'timeago-parser', 'timeago-generator' -rootProject.name = 'NewPipeExtractor' \ No newline at end of file diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100644 index 0000000000..9ad111c29c --- /dev/null +++ b/settings.gradle.kts @@ -0,0 +1,22 @@ +/* + * SPDX-FileCopyrightText: 2025 NewPipe e.V. + * SPDX-License-Identifier: GPL-3.0-or-later + */ + +pluginManagement { + repositories { + gradlePluginPortal() + google() + mavenCentral() + } +} +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + google() + mavenCentral() + maven(url = "https://jitpack.io") + } +} +include("extractor", "timeago-parser", "timeago-generator") +rootProject.name = "NewPipeExtractor" diff --git a/timeago-generator/build.gradle b/timeago-generator/build.gradle deleted file mode 100644 index 8e8e73907d..0000000000 --- a/timeago-generator/build.gradle +++ /dev/null @@ -1,5 +0,0 @@ -dependencies { - implementation "com.github.TeamNewPipe:nanojson:$nanojsonVersion" - implementation "com.google.code.findbugs:jsr305:$jsr305Version" - implementation project(":timeago-parser") -} diff --git a/timeago-generator/build.gradle.kts b/timeago-generator/build.gradle.kts new file mode 100644 index 0000000000..a031834ec1 --- /dev/null +++ b/timeago-generator/build.gradle.kts @@ -0,0 +1,10 @@ +/* + * SPDX-FileCopyrightText: 2025 NewPipe e.V. + * SPDX-License-Identifier: GPL-3.0-or-later + */ + +dependencies { + implementation(libs.newpipe.nanojson) + implementation(libs.google.jsr305) + implementation(project(":timeago-parser")) +} diff --git a/timeago-parser/build.gradle b/timeago-parser/build.gradle deleted file mode 100644 index 7e1cbb679d..0000000000 --- a/timeago-parser/build.gradle +++ /dev/null @@ -1,3 +0,0 @@ -dependencies { - implementation "com.google.code.findbugs:jsr305:$jsr305Version" -} diff --git a/timeago-parser/build.gradle.kts b/timeago-parser/build.gradle.kts new file mode 100644 index 0000000000..32926250ac --- /dev/null +++ b/timeago-parser/build.gradle.kts @@ -0,0 +1,8 @@ +/* + * SPDX-FileCopyrightText: 2025 NewPipe e.V. + * SPDX-License-Identifier: GPL-3.0-or-later + */ + +dependencies { + implementation(libs.google.jsr305) +} From 2dc75ed269d1ed756a4d045ffa052ee2224221a1 Mon Sep 17 00:00:00 2001 From: Aayush Gupta Date: Mon, 24 Nov 2025 12:41:49 +0800 Subject: [PATCH 2/5] Configure all javadoc tasks properly Otherwise standard tasks are broken due to missing tags Signed-off-by: Aayush Gupta --- build.gradle.kts | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index a269ef7172..b5b2f3e8ce 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -39,6 +39,18 @@ allprojects { } subprojects { + // Javadoc setup + tasks.withType().configureEach { + (options as StandardJavadocDocletOptions).apply { + encoding = Charsets.UTF_8.toString() + links = listOf("https://docs.oracle.com/javase/11/docs/api/") + tags = listOf( + "apiNote:a:API Note:", + "implSpec:a:Implementation Requirements:", + "implNote:a:Implementation Note:" + ) + } + } // sourcesJar task val sourcesJar by tasks.registering(Jar::class) { @@ -73,16 +85,6 @@ tasks.register("aggregatedJavadocs") { title = "${project.name} ${project.version}" setDestinationDir(layout.buildDirectory.dir("docs/javadoc").get().asFile) - (options as StandardJavadocDocletOptions).apply { - encoding = Charsets.UTF_8.toString() - links = listOf("https://docs.oracle.com/javase/11/docs/api/") - tags = listOf( - "apiNote:a:API Note:", - "implSpec:a:Implementation Requirements:", - "implNote:a:Implementation Note:" - ) - } - subprojects.forEach { subProject -> subProject.tasks.withType().forEach { javadocTask -> source = javadocTask.source From ea597824cae10ff21cd0a157f7f9988bf36d87d0 Mon Sep 17 00:00:00 2001 From: Aayush Gupta Date: Mon, 24 Nov 2025 13:10:29 +0800 Subject: [PATCH 3/5] Use the existing Gradle task to generate sources Signed-off-by: Aayush Gupta --- build.gradle.kts | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index b5b2f3e8ce..b965770846 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -22,6 +22,7 @@ allprojects { toolchain { languageVersion.set(JavaLanguageVersion.of(11)) } + withSourcesJar() } version = "v0.24.8" @@ -52,13 +53,6 @@ subprojects { } } - // sourcesJar task - val sourcesJar by tasks.registering(Jar::class) { - dependsOn("classes") - archiveClassifier.set("sources") - from(provider { the().sourceSets["main"].allSource }) - } - // Prevent .proto files ending up in JARs tasks.withType().configureEach { exclude("**/*.proto") @@ -73,11 +67,6 @@ subprojects { exceptionFormat = TestExceptionFormat.FULL } } - - // Register sources JAR as artifact - artifacts { - add("archives", sourcesJar) - } } // https://discuss.gradle.org/t/best-approach-gradle-multi-module-project-generate-just-one-global-javadoc/18657/21 From 77af12362ed0e73369af4d70697e5302000ca447 Mon Sep 17 00:00:00 2001 From: Aayush Gupta Date: Mon, 24 Nov 2025 21:35:46 +0800 Subject: [PATCH 4/5] Refactor and reconfigure publishing information for extractor * Add missing information in pom file * Add a new local maven repo to access the file easily * Relocate the publishing instructions to extractor module * Use the existing Gradle task to generate javadoc Signed-off-by: Aayush Gupta --- build.gradle.kts | 39 ++--------------------- extractor/build.gradle.kts | 63 +++++++++++++++++++++++++++++++++++++- 2 files changed, 64 insertions(+), 38 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index b965770846..fe66b51fb7 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -12,7 +12,6 @@ plugins { allprojects { apply(plugin = "java-library") - apply(plugin = "maven-publish") tasks.withType { options.encoding = Charsets.UTF_8.toString() @@ -22,25 +21,12 @@ allprojects { toolchain { languageVersion.set(JavaLanguageVersion.of(11)) } - withSourcesJar() - } - - version = "v0.24.8" - group = "com.github.TeamNewPipe" - - afterEvaluate { - extensions.configure("publishing") { - publications { - create("mavenJava") { - from(components["java"]) - } - } - } } } subprojects { - // Javadoc setup + // https://discuss.gradle.org/t/best-approach-gradle-multi-module-project-generate-just-one-global-javadoc/18657/21 + // Fixes unknown tag @implNote; the other two were added precautionary tasks.withType().configureEach { (options as StandardJavadocDocletOptions).apply { encoding = Charsets.UTF_8.toString() @@ -53,12 +39,6 @@ subprojects { } } - // Prevent .proto files ending up in JARs - tasks.withType().configureEach { - exclude("**/*.proto") - includeEmptyDirs = false - } - // Test logging setup tasks.withType().configureEach { testLogging { @@ -68,18 +48,3 @@ subprojects { } } } - -// https://discuss.gradle.org/t/best-approach-gradle-multi-module-project-generate-just-one-global-javadoc/18657/21 -tasks.register("aggregatedJavadocs") { - title = "${project.name} ${project.version}" - setDestinationDir(layout.buildDirectory.dir("docs/javadoc").get().asFile) - - subprojects.forEach { subProject -> - subProject.tasks.withType().forEach { javadocTask -> - source = javadocTask.source - classpath += javadocTask.classpath - excludes += javadocTask.excludes - includes += javadocTask.includes - } - } -} diff --git a/extractor/build.gradle.kts b/extractor/build.gradle.kts index 090aec6646..8ccbee8db0 100644 --- a/extractor/build.gradle.kts +++ b/extractor/build.gradle.kts @@ -6,10 +6,23 @@ plugins { alias(libs.plugins.google.protobuf) checkstyle + `maven-publish` +} + +java { + withSourcesJar() + withJavadocJar() +} + +// Protobuf files would uselessly end up in the JAR otherwise, see +// https://github.com/google/protobuf-gradle-plugin/issues/390 +tasks.jar { + exclude("**/*.proto") + includeEmptyDirs = false } tasks.test { - // Pass on downloader type to tests for different CI jobs. + // Pass on downloader type to tests for different CI jobs. See DownloaderFactory.java and ci.yml if (System.getProperties().containsKey("downloader")) { systemProperty("downloader", System.getProperty("downloader")) } @@ -71,3 +84,51 @@ protobuf { } } } + +// Run "./gradlew publishReleasePublicationToLocalRepository" to generate release JARs locally +publishing { + publications { + create("release") { + groupId = "net.newpipe" + artifactId = "extractor" + version = "v0.24.8" + + afterEvaluate { + from(components["java"]) + } + + pom { + name = "NewPipe Extractor" + description = "A library for extracting data from streaming websites, used in NewPipe" + url = "https://github.com/TeamNewPipe/NewPipeExtractor" + + licenses { + license { + name = "GNU GENERAL PUBLIC LICENSE, Version 3" + url = "https://www.gnu.org/licenses/gpl-3.0.txt" + } + } + + scm { + url = "https://github.com/TeamNewPipe/NewPipeExtractor" + connection = "scm:git:git@github.com:TeamNewPipe/NewPipeExtractor.git" + developerConnection = "scm:git:git@github.com:TeamNewPipe/NewPipeExtractor.git" + } + + developers { + developer { + id = "newpipe" + name = "Team NewPipe" + email = "team@newpipe.net" + } + } + } + } + repositories { + maven { + name = "local" + url = uri(layout.buildDirectory.dir("maven")) + } + } + } +} From 2dc56b6c6e7ce225562975ca65ed5f8eab915afd Mon Sep 17 00:00:00 2001 From: Aayush Gupta Date: Mon, 24 Nov 2025 21:44:03 +0800 Subject: [PATCH 5/5] Relocate testing configuration to extractor Only extractor has actual tests Signed-off-by: Aayush Gupta --- build.gradle.kts | 12 ------------ extractor/build.gradle.kts | 10 ++++++++++ 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index fe66b51fb7..22e20dfdfb 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -3,9 +3,6 @@ * SPDX-License-Identifier: GPL-3.0-or-later */ -import org.gradle.api.tasks.testing.logging.TestExceptionFormat -import org.gradle.api.tasks.testing.logging.TestLogEvent - plugins { alias(libs.plugins.google.protobuf) apply false } @@ -38,13 +35,4 @@ subprojects { ) } } - - // Test logging setup - tasks.withType().configureEach { - testLogging { - events = setOf(TestLogEvent.SKIPPED, TestLogEvent.FAILED) - showStandardStreams = true - exceptionFormat = TestExceptionFormat.FULL - } - } } diff --git a/extractor/build.gradle.kts b/extractor/build.gradle.kts index 8ccbee8db0..3e90d45d79 100644 --- a/extractor/build.gradle.kts +++ b/extractor/build.gradle.kts @@ -3,6 +3,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later */ +import org.gradle.api.tasks.testing.logging.TestExceptionFormat +import org.gradle.api.tasks.testing.logging.TestLogEvent + plugins { alias(libs.plugins.google.protobuf) checkstyle @@ -22,6 +25,13 @@ tasks.jar { } tasks.test { + // Test logging setup + testLogging { + events = setOf(TestLogEvent.SKIPPED, TestLogEvent.FAILED) + showStandardStreams = true + exceptionFormat = TestExceptionFormat.FULL + } + // Pass on downloader type to tests for different CI jobs. See DownloaderFactory.java and ci.yml if (System.getProperties().containsKey("downloader")) { systemProperty("downloader", System.getProperty("downloader"))