-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'refactor' into Video-description-compose
# Conflicts: # app/src/main/java/org/schabi/newpipe/ktx/Bundle.kt
- Loading branch information
Showing
59 changed files
with
1,562 additions
and
1,090 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
tasks.register('checkDependenciesOrder') { | ||
group = 'verification' | ||
description = 'Checks that each section in libs.versions.toml is sorted alphabetically' | ||
|
||
def tomlFile = file('../gradle/libs.versions.toml') | ||
|
||
doLast { | ||
if (!tomlFile.exists()) { | ||
throw new GradleException('TOML file not found') | ||
} | ||
|
||
def lines = tomlFile.readLines() | ||
def nonSortedBlocks = [] | ||
def currentBlock = [] | ||
def prevLine = '' | ||
def prevIndex = 0 | ||
|
||
lines.eachWithIndex { line, lineIndex -> | ||
if (line.trim() && !line.startsWith('#')) { | ||
if (line.startsWith('[')) { | ||
prevLine = '' | ||
} else { | ||
def currIndex = lineIndex + 1 | ||
if (prevLine > line) { | ||
if (currentBlock && currentBlock[-1] == "${prevIndex}: ${prevLine}") { | ||
currentBlock.add("${currIndex}: ${line}") | ||
} else { | ||
if (!currentBlock.isEmpty()) { | ||
nonSortedBlocks.add(currentBlock) | ||
currentBlock = [] | ||
} | ||
currentBlock.add("${prevIndex}: ${prevLine}") | ||
currentBlock.add("${currIndex}: ${line}") | ||
} | ||
} | ||
prevLine = line | ||
prevIndex = lineIndex + 1 | ||
} | ||
} | ||
} | ||
|
||
if (!currentBlock.isEmpty()) { | ||
nonSortedBlocks.add(currentBlock) | ||
throw new GradleException("The following lines were not sorted:\n" + | ||
nonSortedBlocks.collect { it.join("\n") }.join("\n\n")) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.