Skip to content

Commit

Permalink
Merge pull request #9711 from TeamNewPipe/release-0.25.0
Browse files Browse the repository at this point in the history
Release v0.25.0 (992)
  • Loading branch information
Stypox authored Feb 8, 2023
2 parents a95a5ed + d2f8f31 commit 831f36e
Show file tree
Hide file tree
Showing 534 changed files with 10,198 additions and 3,016 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,4 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: ./gradlew build sonarqube --info
run: ./gradlew build sonar --info
6 changes: 4 additions & 2 deletions .github/workflows/image-minimizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ module.exports = async ({github, context}) => {
return match;
}

let probeAspectRatio = 0;
let shouldModify = false;
try {
console.log(`Probing ${g2}`);
Expand All @@ -76,7 +77,8 @@ module.exports = async ({github, context}) => {
}
console.log(`Probing resulted in ${probeResult.width}x${probeResult.height}px`);

shouldModify = probeResult.height > IMG_MAX_HEIGHT_PX && (probeResult.width / probeResult.height) < MIN_ASPECT_RATIO;
probeAspectRatio = probeResult.width / probeResult.height;
shouldModify = probeResult.height > IMG_MAX_HEIGHT_PX && probeAspectRatio < MIN_ASPECT_RATIO;
} catch(e) {
console.log('Probing failed:', e);
// Immediately abort
Expand All @@ -86,7 +88,7 @@ module.exports = async ({github, context}) => {
if (shouldModify) {
wasMatchModified = true;
console.log(`Modifying match '${match}'`);
return `<img alt="${g1}" src="${g2}" height=${IMG_MAX_HEIGHT_PX} />`;
return `<img alt="${g1}" src="${g2}" width=${Math.min(600, (IMG_MAX_HEIGHT_PX * probeAspectRatio).toFixed(0))} />`;
}

console.log(`Match '${match}' is ok/will not be modified`);
Expand Down
49 changes: 37 additions & 12 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
import com.android.tools.profgen.ArtProfileKt
import com.android.tools.profgen.ArtProfileSerializer
import com.android.tools.profgen.DexFile

plugins {
id "com.android.application"
id "kotlin-android"
id "kotlin-kapt"
id "kotlin-parcelize"
id "checkstyle"
id "org.sonarqube" version "3.3"
id "org.sonarqube" version "3.5.0.2730"
}

android {
compileSdk 32
compileSdk 33
namespace 'org.schabi.newpipe'

defaultConfig {
applicationId "org.schabi.newpipe"
resValue "string", "app_name", "NewPipe"
minSdk 21
targetSdk 29
versionCode 991
versionName "0.24.1"
targetSdk 33
versionCode 992
versionName "0.25.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

Expand Down Expand Up @@ -107,7 +111,7 @@ ext {
groupieVersion = '2.10.1'
markwonVersion = '4.6.2'

leakCanaryVersion = '2.5'
leakCanaryVersion = '2.9.1'
stethoVersion = '1.6.0'
mockitoVersion = '4.0.0'
assertJVersion = '3.23.1'
Expand Down Expand Up @@ -169,7 +173,7 @@ afterEvaluate {
preDebugBuild.dependsOn runCheckstyle, runKtlint
}

sonarqube {
sonar {
properties {
property "sonar.projectKey", "TeamNewPipe_NewPipe"
property "sonar.organization", "teamnewpipe"
Expand All @@ -179,15 +183,15 @@ sonarqube {

dependencies {
/** Desugaring **/
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.6'
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.2'

/** NewPipe libraries **/
// You can use a local version by uncommenting a few lines in settings.gradle
// Or you can use a commit you pushed to GitHub by just replacing TeamNewPipe with your GitHub
// name and the commit hash with the commit hash of the (pushed) commit you want to test
// This works thanks to JitPack: https://jitpack.io/
implementation 'com.github.TeamNewPipe:nanojson:1d9e1aea9049fc9f85e68b43ba39fe7be1c1f751'
implementation 'com.github.TeamNewPipe:NewPipeExtractor:eb07d70a2ce03bee3cc74fc33b2e4173e1c21436'
implementation 'com.github.TeamNewPipe:NewPipeExtractor:7e793c11aec46358ccbfd8bcfcf521105f4f093a'
implementation 'com.github.TeamNewPipe:NoNonsense-FilePicker:5.0.0'

/** Checkstyle **/
Expand Down Expand Up @@ -259,14 +263,14 @@ dependencies {
implementation "io.noties.markwon:linkify:${markwonVersion}"

// Crash reporting
implementation "ch.acra:acra-core:5.9.3"
implementation "ch.acra:acra-core:5.9.7"

// Properly restarting
implementation 'com.jakewharton:process-phoenix:2.1.2'

// Reactive extensions for Java VM
implementation "io.reactivex.rxjava3:rxjava:3.0.13"
implementation "io.reactivex.rxjava3:rxandroid:3.0.0"
implementation "io.reactivex.rxjava3:rxjava:3.1.5"
implementation "io.reactivex.rxjava3:rxandroid:3.0.2"
// RxJava binding APIs for Android UI widgets
implementation "com.jakewharton.rxbinding4:rxbinding:4.0.0"

Expand Down Expand Up @@ -308,3 +312,24 @@ static String getGitWorkingBranch() {
return ""
}
}

project.afterEvaluate {
tasks.compileReleaseArtProfile.doLast {
outputs.files.each { file ->
if (file.toString().endsWith(".profm")) {
println("Sorting ${file} ...")
def version = ArtProfileSerializer.valueOf("METADATA_0_0_2")
def profile = ArtProfileKt.ArtProfile(file)
def keys = new ArrayList(profile.profileData.keySet())
def sortedData = new LinkedHashMap()
Collections.sort keys, new DexFile.Companion()
keys.each { key -> sortedData[key] = profile.profileData[key] }
new FileOutputStream(file).with {
write(version.magicBytes$profgen)
write(version.versionBytes$profgen)
version.write$profgen(it, sortedData, "")
}
}
}
}
}
Loading

0 comments on commit 831f36e

Please sign in to comment.