mirror of
https://github.com/TeamNewPipe/NewPipe.git
synced 2025-12-05 01:10:43 +00:00
Compare commits
5 Commits
f4032e5fdd
...
1aea83798c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1aea83798c | ||
|
|
0ffe80e6ec | ||
|
|
d9a4f0ca6a | ||
|
|
ec8ac3fecc | ||
|
|
6ece67e551 |
40
.editorconfig
Normal file
40
.editorconfig
Normal file
@@ -0,0 +1,40 @@
|
||||
#
|
||||
# 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_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_max-line-length = 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
|
||||
@@ -12,8 +12,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() }
|
||||
@@ -24,6 +22,14 @@ java {
|
||||
}
|
||||
}
|
||||
|
||||
kotlin {
|
||||
compilerOptions {
|
||||
freeCompilerArgs.addAll(
|
||||
"-Xannotation-default-target=param-property"
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdk = 36
|
||||
namespace = "org.schabi.newpipe"
|
||||
@@ -159,7 +165,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")
|
||||
}
|
||||
|
||||
@@ -168,10 +174,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")) {
|
||||
|
||||
@@ -9,5 +9,5 @@ package org.schabi.newpipe.database.history.dao
|
||||
import org.schabi.newpipe.database.BasicDAO
|
||||
|
||||
interface HistoryDAO<T> : BasicDAO<T> {
|
||||
val latestEntry: T
|
||||
val latestEntry: T?
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ import org.schabi.newpipe.database.history.model.SearchHistoryEntry
|
||||
interface SearchHistoryDAO : HistoryDAO<SearchHistoryEntry> {
|
||||
|
||||
@get:Query("SELECT * FROM search_history WHERE id = (SELECT MAX(id) FROM search_history)")
|
||||
override val latestEntry: SearchHistoryEntry
|
||||
override val latestEntry: SearchHistoryEntry?
|
||||
|
||||
@Query("DELETE FROM search_history")
|
||||
override fun deleteAll(): Int
|
||||
|
||||
12
buildSrc/build.gradle.kts
Normal file
12
buildSrc/build.gradle.kts
Normal 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()
|
||||
}
|
||||
@@ -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") }
|
||||
)
|
||||
@@ -4,47 +4,47 @@
|
||||
#
|
||||
|
||||
[versions]
|
||||
acra = "5.11.3"
|
||||
acra = "5.13.1"
|
||||
agp = "8.13.0"
|
||||
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.1"
|
||||
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.7.1"
|
||||
leakcanary = "2.14"
|
||||
lifecycle = "2.9.4"
|
||||
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.0"
|
||||
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"
|
||||
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"
|
||||
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"
|
||||
|
||||
[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" }
|
||||
|
||||
Reference in New Issue
Block a user