Compare commits

...

8 Commits

Author SHA1 Message Date
Stypox
18f1cf2075 Merge pull request #12776 from TeamNewPipe/depUpdate 2025-11-26 12:53:06 +01:00
Aayush Gupta
03e963952c Ignore Kotlin compiler generated files
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
2025-11-21 20:09:57 +08:00
Aayush Gupta
e5ed0b529f Bump ktlint to latest stable release and maven coordinate
Disable all new rules to avoid massive file-changes. All new rules should be
enabled one by one as per requirements in separate commit to make review easier.

Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
2025-11-21 20:08:26 +08:00
Aayush Gupta
0131bb227f Silence warnings regarding new annotation property behavior
Ref: https://kotlinlang.org/docs/annotations.html#defaults-when-no-use-site-targets-are-specified

Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
2025-11-21 20:08:26 +08:00
Aayush Gupta
b06b7c35ca Relocate toml lint task to buildSrc and extend against default task
Fixes build errors after Gradle 9.x upgrade

Ref: https://docs.gradle.org/current/userguide/implementing_custom_tasks.html

Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
2025-11-21 20:08:26 +08:00
Aayush Gupta
0a0f28e801 Bump dependencies to possible stable releases
androidx has bumped minSdk to API 23 which makes us unable to use latest version of:
* room
* workmanager

Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
2025-11-21 20:08:22 +08:00
Aayush Gupta
4a8592c5ba Enable Gradle configuration cache
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
2025-11-21 20:08:12 +08:00
Aayush Gupta
8f91f21f27 Bump Gradle to latest stable release
Also update the wrapper using the ./gradlew wrapper command

Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
2025-11-21 20:08:12 +08:00
11 changed files with 156 additions and 71 deletions

44
.editorconfig Normal file
View File

@@ -0,0 +1,44 @@
#
# SPDX-FileCopyrightText: 2025 NewPipe e.V. <https://newpipe-ev.de>
# SPDX-License-Identifier: GPL-3.0-or-later
#
root = true
[*.{kt,kts}]
ktlint_standard_annotation = disabled
ktlint_standard_argument-list-wrapping = disabled
ktlint_standard_backing-property-naming = disabled
ktlint_standard_blank-line-before-declaration = disabled
ktlint_standard_blank-line-between-when-conditions = disabled
ktlint_standard_chain-method-continuation = disabled
ktlint_standard_class-signature = disabled
ktlint_standard_comment-wrapping = disabled
ktlint_standard_enum-wrapping = disabled
ktlint_standard_function-expression-body = disabled
ktlint_standard_function-literal = disabled
ktlint_standard_function-signature = disabled
ktlint_standard_indent = disabled
ktlint_standard_kdoc = disabled
ktlint_standard_max-line-length = disabled
ktlint_standard_mixed-condition-operators = disabled
ktlint_standard_multiline-expression-wrapping = disabled
ktlint_standard_multiline-if-else = disabled
ktlint_standard_no-blank-line-in-list = disabled
ktlint_standard_no-consecutive-comments = disabled
ktlint_standard_no-empty-first-line-in-class-body = disabled
ktlint_standard_no-empty-first-line-in-method-block = disabled
ktlint_standard_no-line-break-after-else = disabled
ktlint_standard_no-semi = disabled
ktlint_standard_no-single-line-block-comment = disabled
ktlint_standard_package-name = disabled
ktlint_standard_parameter-list-wrapping = disabled
ktlint_standard_property-naming = disabled
ktlint_standard_spacing-between-declarations-with-annotations = disabled
ktlint_standard_spacing-between-declarations-with-comments = disabled
ktlint_standard_statement-wrapping = disabled
ktlint_standard_string-template-indent = disabled
ktlint_standard_trailing-comma-on-call-site = disabled
ktlint_standard_trailing-comma-on-declaration-site = disabled
ktlint_standard_try-catch-finally-spacing = disabled
ktlint_standard_when-entry-bracing = disabled

1
.gitignore vendored
View File

@@ -7,6 +7,7 @@ captures/
*.iml
*~
.weblate
.kotlin
*.class
app/debug/
app/release/

View File

@@ -13,8 +13,6 @@ plugins {
checkstyle
}
apply(from = "check-dependencies.gradle.kts")
val gitWorkingBranch = providers.exec {
commandLine("git", "rev-parse", "--abbrev-ref", "HEAD")
}.standardOutput.asText.map { it.trim() }
@@ -25,6 +23,15 @@ java {
}
}
kotlin {
compilerOptions {
// TODO: Drop annotation default target when it is stable
freeCompilerArgs.addAll(
"-Xannotation-default-target=param-property"
)
}
}
android {
compileSdk = 36
namespace = "org.schabi.newpipe"
@@ -160,7 +167,7 @@ tasks.register<JavaExec>("runKtlint") {
outputs.dir(outputDir)
mainClass.set("com.pinterest.ktlint.Main")
classpath = configurations.getByName("ktlint")
args = listOf("src/**/*.kt")
args = listOf("--editorconfig=../.editorconfig", "src/**/*.kt")
jvmArgs = listOf("--add-opens", "java.base/java.lang=ALL-UNNAMED")
}
@@ -169,10 +176,14 @@ tasks.register<JavaExec>("formatKtlint") {
outputs.dir(outputDir)
mainClass.set("com.pinterest.ktlint.Main")
classpath = configurations.getByName("ktlint")
args = listOf("-F", "src/**/*.kt")
args = listOf("--editorconfig=../.editorconfig", "-F", "src/**/*.kt")
jvmArgs = listOf("--add-opens", "java.base/java.lang=ALL-UNNAMED")
}
tasks.register<CheckDependenciesOrder>("checkDependenciesOrder") {
tomlFile = layout.projectDirectory.file("../gradle/libs.versions.toml")
}
afterEvaluate {
tasks.named("preDebugBuild").configure {
if (!System.getProperties().containsKey("skipFormatKtlint")) {

12
buildSrc/build.gradle.kts Normal file
View File

@@ -0,0 +1,12 @@
/*
* SPDX-FileCopyrightText: 2025 NewPipe e.V. <https://newpipe-ev.de>
* SPDX-License-Identifier: GPL-3.0-or-later
*/
plugins {
`kotlin-dsl`
}
repositories {
gradlePluginPortal()
}

View File

@@ -4,18 +4,27 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
tasks.register("checkDependenciesOrder") {
group = "verification"
description = "Checks that each section in libs.versions.toml is sorted alphabetically"
import org.gradle.api.DefaultTask
import org.gradle.api.file.RegularFileProperty
import org.gradle.api.tasks.InputFile
import org.gradle.api.tasks.TaskAction
val tomlFile = file("../gradle/libs.versions.toml")
abstract class CheckDependenciesOrder : DefaultTask() {
doLast {
if (!tomlFile.exists()) {
throw GradleException("TOML file not found")
}
@get:InputFile
abstract val tomlFile: RegularFileProperty
val lines = tomlFile.readLines()
init {
group = "verification"
description = "Checks that each section in libs.versions.toml is sorted alphabetically"
}
@TaskAction
fun run() {
val file = tomlFile.get().asFile
if (!file.exists()) error("TOML file not found")
val lines = file.readLines()
val nonSortedBlocks = mutableListOf<List<String>>()
var currentBlock = mutableListOf<String>()
var prevLine = ""
@@ -50,7 +59,7 @@ tasks.register("checkDependenciesOrder") {
}
if (nonSortedBlocks.isNotEmpty()) {
throw GradleException(
error(
"The following lines were not sorted:\n" +
nonSortedBlocks.joinToString("\n\n") { it.joinToString("\n") }
)

View File

@@ -4,3 +4,6 @@ android.nonTransitiveRClass=true
android.useAndroidX=true
org.gradle.jvmargs=-Xmx2048M --add-opens jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED
systemProp.file.encoding=utf-8
# https://docs.gradle.org/current/userguide/configuration_cache.html
org.gradle.configuration-cache=true

View File

@@ -4,47 +4,47 @@
#
[versions]
acra = "5.11.3"
agp = "8.13.0"
acra = "5.13.1"
agp = "8.13.1"
appcompat = "1.7.1"
assertj = "3.24.2"
assertj = "3.27.6"
autoservice = "1.1.1"
bridge = "v2.0.2"
cardview = "1.0.0"
checkstyle = "10.26.1"
constraintlayout = "2.1.4"
core = "1.12.0"
desugar = "2.0.4"
documentfile = "1.0.1"
exoplayer = "2.18.7"
fragment = "1.6.2"
checkstyle = "12.1.2"
constraintlayout = "2.2.1"
core = "1.17.0"
desugar = "2.1.5"
documentfile = "1.1.0"
exoplayer = "2.19.1"
fragment = "1.8.9"
groupie = "2.10.1"
jsoup = "1.21.2"
junit = "4.13.2"
junit-ext = "1.1.5"
kotlin = "1.9.25"
ksp = "1.9.25-1.0.20"
ktlint = "0.45.2"
leakcanary = "2.12"
lifecycle = "2.6.2"
junit-ext = "1.3.0"
kotlin = "2.2.21"
ksp = "2.3.2"
ktlint = "1.8.0"
leakcanary = "2.14"
lifecycle = "2.9.4" # Newer versions require minSdk >= 23
localbroadcastmanager = "1.1.0"
markwon = "4.6.2"
material = "1.11.0"
material = "1.13.0"
media = "1.7.1"
mockitoCore = "5.6.0"
okhttp = "4.12.0"
phoenix = "2.1.2"
mockitoCore = "5.20.0"
okhttp = "5.3.2"
phoenix = "3.0.0"
#noinspection NewerVersionAvailable,GradleDependency --> 2.8 is the last version, not 2.71828!
picasso = "2.8"
preference = "1.2.1"
prettytime = "5.0.8.Final"
recyclerview = "1.3.2"
room = "2.6.1"
runner = "1.5.2"
recyclerview = "1.4.0"
room = "2.7.2" # Newer versions require minSdk >= 23
runner = "1.7.0"
rxandroid = "3.0.2"
rxbinding = "4.0.0"
rxjava = "3.1.12"
sonarqube = "4.0.0.2929"
sonarqube = "7.0.1.6134"
statesaver = "1.4.1" # TODO: Drop because it is deprecated and incompatible with KSP2
stetho = "1.6.0"
swiperefreshlayout = "1.1.0"
@@ -60,8 +60,8 @@ teamnewpipe-nanojson = "e9d656ddb49a412a5a0a5d5ef20ca7ef09549996"
# to cause jitpack to regenerate the artifact.
teamnewpipe-newpipe-extractor = "3af73262cc60cf555fd5f1d691f6c58e2db38ef5"
viewpager2 = "1.1.0"
webkit = "1.9.0"
work = "2.8.1"
webkit = "1.14.0"
work = "2.10.5" # Newer versions require minSdk >= 23
[libraries]
acra-core = { module = "ch.acra:acra-core", version.ref = "acra" }
@@ -87,7 +87,7 @@ androidx-runner = { module = "androidx.test:runner", version.ref = "runner" }
androidx-swiperefreshlayout = { module = "androidx.swiperefreshlayout:swiperefreshlayout", version.ref = "swiperefreshlayout" }
androidx-viewpager2 = { module = "androidx.viewpager2:viewpager2", version.ref = "viewpager2" }
androidx-webkit = { module = "androidx.webkit:webkit", version.ref = "webkit" }
androidx-work-runtime = { module = "androidx.work:work-runtime-ktx", version.ref = "work" }
androidx-work-runtime = { module = "androidx.work:work-runtime", version.ref = "work" }
androidx-work-rxjava3 = { module = "androidx.work:work-rxjava3", version.ref = "work" }
assertj-core = { module = "org.assertj:assertj-core", version.ref = "assertj" }
evernote-statesaver-compiler = { module = "com.evernote:android-state-processor", version.ref = "statesaver" }
@@ -119,7 +119,7 @@ newpipe-nanojson = { module = "com.github.TeamNewPipe:nanojson", version.ref = "
noties-markwon-core = { module = "io.noties.markwon:core", version.ref = "markwon" }
noties-markwon-linkify = { module = "io.noties.markwon:linkify", version.ref = "markwon" }
ocpsoft-prettytime = { module = "org.ocpsoft.prettytime:prettytime", version.ref = "prettytime" }
pinterest-ktlint = { module = "com.pinterest:ktlint", version.ref = "ktlint" }
pinterest-ktlint = { module = "com.pinterest.ktlint:ktlint-cli", version.ref = "ktlint" }
puppycrawl-checkstyle = { module = "com.puppycrawl.tools:checkstyle", version.ref = "checkstyle" }
reactivex-rxandroid = { module = "io.reactivex.rxjava3:rxandroid", version.ref = "rxandroid" }
reactivex-rxjava = { module = "io.reactivex.rxjava3:rxjava", version.ref = "rxjava" }

Binary file not shown.

View File

@@ -1,7 +1,8 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionSha256Sum=20f1b1176237254a6fc204d8434196fa11a4cfb387567519c61556e8710aed78
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
distributionSha256Sum=72f44c9f8ebcb1af43838f45ee5c4aa9c5444898b3468ab3f4af7b6076c5bc3f
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

33
gradlew vendored
View File

@@ -1,7 +1,7 @@
#!/bin/sh
#
# Copyright © 2015-2021 the original authors.
# Copyright © 2015 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#
##############################################################################
#
@@ -55,7 +57,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
@@ -83,7 +85,8 @@ done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
@@ -111,7 +114,6 @@ case "$( uname )" in #(
NONSTOP* ) nonstop=true ;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
@@ -130,10 +132,13 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi
# Increase the maximum file descriptors if we can.
@@ -141,7 +146,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
@@ -149,7 +154,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
@@ -166,7 +171,6 @@ fi
# For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
JAVACMD=$( cygpath --unix "$JAVACMD" )
@@ -198,16 +202,15 @@ fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
"$@"
# Stop when "xargs" is not available.

25
gradlew.bat vendored
View File

@@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@@ -43,11 +45,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail
@@ -57,22 +59,21 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
:end
@rem End local scope for the variables with windows NT shell