Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 0 additions & 91 deletions build.gradle

This file was deleted.

38 changes: 38 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* SPDX-FileCopyrightText: 2025 NewPipe e.V. <https://newpipe-ev.de>
* SPDX-License-Identifier: GPL-3.0-or-later
*/

plugins {
alias(libs.plugins.google.protobuf) apply false
}

allprojects {
apply(plugin = "java-library")

tasks.withType<JavaCompile> {
options.encoding = Charsets.UTF_8.toString()
}

extensions.configure<JavaPluginExtension> {
toolchain {
languageVersion.set(JavaLanguageVersion.of(11))
}
}
}

subprojects {
// 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<Javadoc>().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:"
)
}
}
}
71 changes: 0 additions & 71 deletions extractor/build.gradle

This file was deleted.

144 changes: 144 additions & 0 deletions extractor/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
/*
* SPDX-FileCopyrightText: 2025 NewPipe e.V. <https://newpipe-ev.de>
* 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
`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 {
// 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"))
}
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")
}
}
}
}
}

// Run "./gradlew publishReleasePublicationToLocalRepository" to generate release JARs locally
publishing {
publications {
create<MavenPublication>("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:[email protected]:TeamNewPipe/NewPipeExtractor.git"
developerConnection = "scm:git:[email protected]:TeamNewPipe/NewPipeExtractor.git"
}

developers {
developer {
id = "newpipe"
name = "Team NewPipe"
email = "[email protected]"
}
}
}
}
repositories {
maven {
name = "local"
url = uri(layout.buildDirectory.dir("maven"))
}
}
}
}
35 changes: 35 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#
# SPDX-FileCopyrightText: 2025 NewPipe e.V. <https://newpipe-ev.de>
# 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.1"
protobuf-plugin = "0.9.5"
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" }
2 changes: 0 additions & 2 deletions settings.gradle

This file was deleted.

Loading