2023-01-20 18:39:16 +01:00
|
|
|
import com.android.tools.profgen.ArtProfileKt
|
|
|
|
import com.android.tools.profgen.ArtProfileSerializer
|
|
|
|
import com.android.tools.profgen.DexFile
|
2024-11-25 03:56:13 +01:00
|
|
|
import com.mikepenz.aboutlibraries.plugin.DuplicateMode
|
2023-01-20 18:39:16 +01:00
|
|
|
|
2021-03-15 09:51:51 +01:00
|
|
|
plugins {
|
2024-11-22 20:59:39 +00:00
|
|
|
alias libs.plugins.android.application
|
|
|
|
alias libs.plugins.kotlin.android
|
|
|
|
alias libs.plugins.kotlin.compose
|
|
|
|
alias libs.plugins.kotlin.kapt
|
|
|
|
alias libs.plugins.kotlin.parcelize
|
|
|
|
alias libs.plugins.checkstyle
|
|
|
|
alias libs.plugins.sonarqube
|
|
|
|
alias libs.plugins.hilt
|
2024-11-27 16:20:49 +01:00
|
|
|
alias libs.plugins.aboutlibraries
|
2021-03-15 09:51:51 +01:00
|
|
|
}
|
|
|
|
|
2015-09-04 02:15:03 +02:00
|
|
|
android {
|
2023-10-31 16:31:16 -04:00
|
|
|
compileSdk 34
|
2022-09-17 19:17:03 +05:30
|
|
|
namespace 'org.schabi.newpipe'
|
2015-09-04 02:15:03 +02:00
|
|
|
|
|
|
|
defaultConfig {
|
|
|
|
applicationId "org.schabi.newpipe"
|
2020-02-23 09:46:42 +01:00
|
|
|
resValue "string", "app_name", "NewPipe"
|
2022-07-06 16:30:30 -04:00
|
|
|
minSdk 21
|
2022-11-05 23:44:35 +01:00
|
|
|
targetSdk 33
|
2024-08-11 08:11:50 +05:30
|
|
|
versionCode 999
|
|
|
|
versionName "0.27.2"
|
2017-06-28 07:27:32 +02:00
|
|
|
|
2019-10-04 14:59:08 +02:00
|
|
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
2019-04-28 17:43:52 -03:00
|
|
|
|
|
|
|
javaCompileOptions {
|
|
|
|
annotationProcessorOptions {
|
|
|
|
arguments = ["room.schemaLocation": "$projectDir/schemas".toString()]
|
|
|
|
}
|
|
|
|
}
|
2015-09-04 02:15:03 +02:00
|
|
|
}
|
2018-08-11 19:13:52 +05:30
|
|
|
|
2015-09-04 02:15:03 +02:00
|
|
|
buildTypes {
|
2017-08-07 06:02:30 -07:00
|
|
|
debug {
|
|
|
|
debuggable true
|
2020-02-23 09:46:42 +01:00
|
|
|
|
2020-02-23 20:56:56 +01:00
|
|
|
// suffix the app id and the app name with git branch name
|
2020-03-02 20:50:35 +01:00
|
|
|
def workingBranch = getGitWorkingBranch()
|
2020-09-26 22:32:11 +02:00
|
|
|
def normalizedWorkingBranch = workingBranch.replaceFirst("^[^A-Za-z]+", "").replaceAll("[^0-9A-Za-z]+", "")
|
2020-03-02 20:50:35 +01:00
|
|
|
if (normalizedWorkingBranch.isEmpty() || workingBranch == "master" || workingBranch == "dev") {
|
|
|
|
// default values when branch name could not be determined or is master or dev
|
2020-02-23 09:46:42 +01:00
|
|
|
applicationIdSuffix ".debug"
|
|
|
|
resValue "string", "app_name", "NewPipe Debug"
|
|
|
|
} else {
|
2020-03-02 20:50:35 +01:00
|
|
|
applicationIdSuffix ".debug." + normalizedWorkingBranch
|
2020-02-23 09:46:42 +01:00
|
|
|
resValue "string", "app_name", "NewPipe " + workingBranch
|
2020-03-25 22:47:29 +01:00
|
|
|
archivesBaseName = 'NewPipe_' + normalizedWorkingBranch
|
2020-02-23 09:46:42 +01:00
|
|
|
}
|
2017-08-07 06:02:30 -07:00
|
|
|
}
|
2020-04-11 22:17:39 +02:00
|
|
|
|
|
|
|
release {
|
2021-09-12 20:19:45 +02:00
|
|
|
if (System.properties.containsKey('packageSuffix')) {
|
|
|
|
applicationIdSuffix System.getProperty('packageSuffix')
|
|
|
|
resValue "string", "app_name", "NewPipe " + System.getProperty('packageSuffix')
|
|
|
|
archivesBaseName = 'NewPipe_' + System.getProperty('packageSuffix')
|
|
|
|
}
|
2020-04-11 22:17:39 +02:00
|
|
|
minifyEnabled true
|
2020-07-23 21:19:21 +02:00
|
|
|
shrinkResources false // disabled to fix F-Droid's reproducible build
|
2020-04-11 22:17:39 +02:00
|
|
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
|
|
|
archivesBaseName = 'app'
|
|
|
|
}
|
2015-09-04 02:15:03 +02:00
|
|
|
}
|
2015-12-24 14:55:33 +01:00
|
|
|
|
2022-01-21 16:25:11 -05:00
|
|
|
lint {
|
2015-12-01 21:31:10 +01:00
|
|
|
checkReleaseBuilds false
|
|
|
|
// Or, if you prefer, you can continue to check for errors in release builds,
|
|
|
|
// but continue the build even when errors are found:
|
|
|
|
abortOnError false
|
2021-04-19 19:26:15 +05:30
|
|
|
// suppress false warning ("Resource IDs will be non-final in Android Gradle Plugin version
|
|
|
|
// 5.0, avoid using them in switch case statements"), which affects only library projects
|
|
|
|
disable 'NonConstantResourceId'
|
2015-12-01 21:31:10 +01:00
|
|
|
}
|
2018-08-11 19:13:52 +05:30
|
|
|
|
2016-02-05 17:09:29 +01:00
|
|
|
compileOptions {
|
2020-06-25 16:42:59 +05:30
|
|
|
// Flag to enable support for the new language APIs
|
|
|
|
coreLibraryDesugaringEnabled true
|
|
|
|
|
2023-04-20 11:31:45 +02:00
|
|
|
sourceCompatibility JavaVersion.VERSION_17
|
|
|
|
targetCompatibility JavaVersion.VERSION_17
|
2020-04-13 23:40:44 +03:00
|
|
|
encoding 'utf-8'
|
2016-02-05 17:09:29 +01:00
|
|
|
}
|
2019-04-28 17:43:54 -03:00
|
|
|
|
2020-09-13 17:20:29 +05:30
|
|
|
kotlinOptions {
|
2023-04-20 11:31:45 +02:00
|
|
|
jvmTarget = JavaVersion.VERSION_17
|
2020-09-13 17:20:29 +05:30
|
|
|
}
|
|
|
|
|
2020-03-07 14:46:32 -03:00
|
|
|
sourceSets {
|
|
|
|
androidTest.assets.srcDirs += files("$projectDir/schemas".toString())
|
|
|
|
}
|
2020-10-31 10:07:18 +05:30
|
|
|
|
|
|
|
buildFeatures {
|
|
|
|
viewBinding true
|
2024-02-28 00:33:46 +05:30
|
|
|
compose true
|
2024-10-22 21:40:16 +02:00
|
|
|
buildConfig true
|
2020-10-31 10:07:18 +05:30
|
|
|
}
|
2023-04-04 17:42:34 +02:00
|
|
|
|
|
|
|
packagingOptions {
|
2023-04-20 10:24:19 +02:00
|
|
|
resources {
|
|
|
|
// remove two files which belong to jsoup
|
|
|
|
// no idea how they ended up in the META-INF dir...
|
2023-11-17 16:58:30 -05:00
|
|
|
excludes += ['META-INF/README.md', 'META-INF/CHANGES',
|
|
|
|
// 'COPYRIGHT' belongs to RxJava...
|
|
|
|
'META-INF/COPYRIGHT']
|
2023-04-20 10:24:19 +02:00
|
|
|
}
|
2023-04-04 17:42:34 +02:00
|
|
|
}
|
2015-09-04 02:15:03 +02:00
|
|
|
}
|
|
|
|
|
2020-06-28 14:59:44 +02:00
|
|
|
configurations {
|
|
|
|
checkstyle
|
2020-10-31 21:55:45 +01:00
|
|
|
ktlint
|
2020-06-28 14:59:44 +02:00
|
|
|
}
|
|
|
|
|
2020-03-27 20:45:26 +01:00
|
|
|
checkstyle {
|
2022-03-18 19:58:59 +01:00
|
|
|
getConfigDirectory().set(rootProject.file("checkstyle"))
|
2020-03-27 20:45:26 +01:00
|
|
|
ignoreFailures false
|
|
|
|
showViolations true
|
2024-11-22 20:59:39 +00:00
|
|
|
toolVersion = libs.versions.checkstyle.get()
|
2020-03-27 20:45:26 +01:00
|
|
|
}
|
|
|
|
|
2023-10-31 21:28:24 -04:00
|
|
|
tasks.register('runCheckstyle', Checkstyle) {
|
2020-03-27 20:45:26 +01:00
|
|
|
source 'src'
|
|
|
|
include '**/*.java'
|
|
|
|
exclude '**/gen/**'
|
|
|
|
exclude '**/R.java'
|
|
|
|
exclude '**/BuildConfig.java'
|
|
|
|
exclude 'main/java/us/shandian/giga/**'
|
|
|
|
|
2020-06-28 14:59:44 +02:00
|
|
|
classpath = configurations.checkstyle
|
2020-03-27 20:45:26 +01:00
|
|
|
|
|
|
|
showViolations true
|
|
|
|
|
|
|
|
reports {
|
2021-07-06 12:16:20 -04:00
|
|
|
xml.getRequired().set(true)
|
|
|
|
html.getRequired().set(true)
|
2020-03-27 20:45:26 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-10-31 21:55:45 +01:00
|
|
|
def outputDir = "${project.buildDir}/reports/ktlint/"
|
|
|
|
def inputFiles = project.fileTree(dir: "src", include: "**/*.kt")
|
|
|
|
|
2023-10-31 21:28:24 -04:00
|
|
|
tasks.register('runKtlint', JavaExec) {
|
2020-10-31 21:55:45 +01:00
|
|
|
inputs.files(inputFiles)
|
|
|
|
outputs.dir(outputDir)
|
2021-07-06 12:16:20 -04:00
|
|
|
getMainClass().set("com.pinterest.ktlint.Main")
|
2020-10-31 21:55:45 +01:00
|
|
|
classpath = configurations.ktlint
|
|
|
|
args "src/**/*.kt"
|
2023-04-25 18:37:04 +02:00
|
|
|
jvmArgs("--add-opens", "java.base/java.lang=ALL-UNNAMED")
|
2020-10-31 21:55:45 +01:00
|
|
|
}
|
|
|
|
|
2023-10-31 21:28:24 -04:00
|
|
|
tasks.register('formatKtlint', JavaExec) {
|
2020-10-31 21:55:45 +01:00
|
|
|
inputs.files(inputFiles)
|
|
|
|
outputs.dir(outputDir)
|
2021-07-06 12:16:20 -04:00
|
|
|
getMainClass().set("com.pinterest.ktlint.Main")
|
2020-10-31 21:55:45 +01:00
|
|
|
classpath = configurations.ktlint
|
|
|
|
args "-F", "src/**/*.kt"
|
2023-04-25 18:37:04 +02:00
|
|
|
jvmArgs("--add-opens", "java.base/java.lang=ALL-UNNAMED")
|
2020-10-31 21:55:45 +01:00
|
|
|
}
|
2020-05-01 20:09:52 +02:00
|
|
|
|
2024-11-26 18:32:44 +00:00
|
|
|
apply from: 'check-dependencies.gradle'
|
|
|
|
|
2020-04-20 17:01:36 +02:00
|
|
|
afterEvaluate {
|
2021-08-06 18:11:22 +02:00
|
|
|
if (!System.properties.containsKey('skipFormatKtlint')) {
|
|
|
|
preDebugBuild.dependsOn formatKtlint
|
|
|
|
}
|
2024-11-26 18:32:44 +00:00
|
|
|
preDebugBuild.dependsOn runCheckstyle, runKtlint, checkDependenciesOrder
|
2020-04-20 17:01:36 +02:00
|
|
|
}
|
2020-03-27 20:45:26 +01:00
|
|
|
|
2022-11-29 11:20:31 -05:00
|
|
|
sonar {
|
2021-03-15 09:51:51 +01:00
|
|
|
properties {
|
|
|
|
property "sonar.projectKey", "TeamNewPipe_NewPipe"
|
|
|
|
property "sonar.organization", "teamnewpipe"
|
|
|
|
property "sonar.host.url", "https://sonarcloud.io"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-10-22 00:47:26 +05:30
|
|
|
kapt {
|
|
|
|
correctErrorTypes true
|
|
|
|
}
|
|
|
|
|
2024-11-25 03:56:13 +01:00
|
|
|
aboutLibraries {
|
|
|
|
// note: offline mode prevents the plugin from fetching licenses at build time, which would be
|
|
|
|
// harmful for reproducible builds
|
|
|
|
offlineMode = true
|
|
|
|
duplicationMode = DuplicateMode.MERGE
|
|
|
|
}
|
|
|
|
|
2015-09-04 02:15:03 +02:00
|
|
|
dependencies {
|
2021-03-31 11:49:55 -04:00
|
|
|
/** Desugaring **/
|
2024-11-22 20:59:39 +00:00
|
|
|
coreLibraryDesugaring libs.desugar.jdk.libs.nio
|
2020-06-25 16:42:59 +05:30
|
|
|
|
2021-03-31 11:49:55 -04:00
|
|
|
/** NewPipe libraries **/
|
2024-11-22 20:59:39 +00:00
|
|
|
implementation libs.teamnewpipe.nanojson
|
|
|
|
implementation libs.teamnewpipe.newpipe.extractor
|
|
|
|
implementation libs.teamnewpipe.nononsense.filepicker
|
2020-05-01 16:06:02 +02:00
|
|
|
|
2021-03-31 11:49:55 -04:00
|
|
|
/** Checkstyle **/
|
2024-11-22 20:59:39 +00:00
|
|
|
checkstyle libs.tools.checkstyle
|
|
|
|
ktlint libs.tools.ktlint
|
2017-06-28 07:27:32 +02:00
|
|
|
|
2021-03-31 11:49:55 -04:00
|
|
|
/** Kotlin **/
|
2024-11-22 20:59:39 +00:00
|
|
|
implementation libs.kotlin.stdlib
|
2017-03-27 16:34:37 -03:00
|
|
|
|
2021-03-31 11:49:55 -04:00
|
|
|
/** AndroidX **/
|
2024-11-22 20:59:39 +00:00
|
|
|
implementation libs.androidx.appcompat
|
|
|
|
implementation libs.androidx.cardview
|
|
|
|
implementation libs.androidx.constraintlayout
|
|
|
|
implementation libs.androidx.core.ktx
|
|
|
|
implementation libs.androidx.documentfile
|
|
|
|
implementation libs.androidx.fragment.compose
|
|
|
|
implementation libs.androidx.lifecycle.livedata
|
|
|
|
implementation libs.androidx.lifecycle.viewmodel
|
|
|
|
implementation libs.androidx.localbroadcastmanager
|
|
|
|
implementation libs.androidx.media
|
|
|
|
implementation libs.androidx.preference
|
|
|
|
implementation libs.androidx.recyclerview
|
|
|
|
implementation libs.androidx.room.runtime
|
|
|
|
implementation libs.androidx.room.rxjava3
|
|
|
|
kapt libs.androidx.room.compiler
|
|
|
|
implementation libs.androidx.swiperefreshlayout
|
2021-10-19 17:31:59 -04:00
|
|
|
// Newer version specified to prevent accessibility regressions with RecyclerView, see:
|
|
|
|
// https://developer.android.com/jetpack/androidx/releases/viewpager2#1.1.0-alpha01
|
2024-11-22 20:59:39 +00:00
|
|
|
implementation libs.androidx.viewpager2
|
|
|
|
implementation libs.androidx.work.runtime
|
|
|
|
implementation libs.androidx.work.rxjava3
|
|
|
|
implementation libs.androidx.material
|
2017-04-26 16:32:20 -03:00
|
|
|
|
2021-03-31 11:49:55 -04:00
|
|
|
/** Third-party libraries **/
|
|
|
|
// Instance state boilerplate elimination
|
2024-11-22 20:59:39 +00:00
|
|
|
implementation libs.livefront.bridge
|
|
|
|
implementation libs.android.state
|
|
|
|
kapt libs.android.state.processor
|
2020-10-16 13:27:04 +02:00
|
|
|
|
2021-03-31 11:49:55 -04:00
|
|
|
// HTML parser
|
2024-11-22 20:59:39 +00:00
|
|
|
implementation libs.jsoup
|
2017-04-26 16:32:20 -03:00
|
|
|
|
2021-03-31 11:49:55 -04:00
|
|
|
// HTTP client
|
2024-11-22 20:59:39 +00:00
|
|
|
implementation libs.okhttp
|
2018-03-29 18:24:30 -07:00
|
|
|
|
2021-03-31 11:49:55 -04:00
|
|
|
// Media player
|
2024-11-22 20:59:39 +00:00
|
|
|
implementation libs.exoplayer.core
|
|
|
|
implementation libs.exoplayer.dash
|
|
|
|
implementation libs.exoplayer.database
|
|
|
|
implementation libs.exoplayer.datasource
|
|
|
|
implementation libs.exoplayer.hls
|
|
|
|
implementation libs.exoplayer.smoothstreaming
|
|
|
|
implementation libs.exoplayer.ui
|
|
|
|
implementation libs.extension.mediasession
|
2017-08-07 06:02:30 -07:00
|
|
|
|
2021-03-31 11:49:55 -04:00
|
|
|
// Metadata generator for service descriptors
|
2024-11-22 20:59:39 +00:00
|
|
|
compileOnly libs.auto.service
|
|
|
|
kapt libs.auto.service.kapt
|
2020-07-28 11:02:01 +02:00
|
|
|
|
2021-03-31 11:49:55 -04:00
|
|
|
// Manager for complex RecyclerView layouts
|
2024-11-22 20:59:39 +00:00
|
|
|
implementation libs.lisawray.groupie
|
|
|
|
implementation libs.lisawray.groupie.viewbinding
|
2018-06-16 11:55:57 +02:00
|
|
|
|
2021-03-31 11:49:55 -04:00
|
|
|
// Image loading
|
2024-11-22 20:59:39 +00:00
|
|
|
implementation libs.coil.compose
|
2020-02-08 09:56:37 +01:00
|
|
|
|
2021-03-31 11:49:55 -04:00
|
|
|
// Markdown library for Android
|
2024-11-22 20:59:39 +00:00
|
|
|
implementation libs.markwon.core
|
|
|
|
implementation libs.markwon.linkify
|
2020-05-01 16:06:02 +02:00
|
|
|
|
2021-03-31 11:49:55 -04:00
|
|
|
// Crash reporting
|
2024-11-22 20:59:39 +00:00
|
|
|
implementation libs.acra.core
|
2020-05-01 16:06:02 +02:00
|
|
|
|
2021-09-06 20:47:44 +02:00
|
|
|
// Properly restarting
|
2024-11-22 20:59:39 +00:00
|
|
|
implementation libs.process.phoenix
|
2021-09-06 20:47:44 +02:00
|
|
|
|
2021-03-31 11:49:55 -04:00
|
|
|
// Reactive extensions for Java VM
|
2024-11-22 20:59:39 +00:00
|
|
|
implementation libs.rxjava3.rxjava
|
|
|
|
implementation libs.rxjava3.rxandroid
|
2021-03-31 11:49:55 -04:00
|
|
|
// RxJava binding APIs for Android UI widgets
|
2024-11-22 20:59:39 +00:00
|
|
|
implementation libs.rxbinding4.rxbinding
|
2020-05-01 16:06:02 +02:00
|
|
|
|
2021-03-31 11:49:55 -04:00
|
|
|
// Date and time formatting
|
2024-11-22 20:59:39 +00:00
|
|
|
implementation libs.prettytime
|
2020-11-22 13:49:09 +01:00
|
|
|
|
2024-02-28 00:33:46 +05:30
|
|
|
// Jetpack Compose
|
2024-11-22 20:59:39 +00:00
|
|
|
implementation(platform(libs.androidx.compose.bom))
|
|
|
|
implementation libs.androidx.compose.material3
|
|
|
|
implementation libs.androidx.compose.adaptive
|
|
|
|
implementation libs.androidx.activity.compose
|
|
|
|
implementation libs.androidx.compose.ui.tooling.preview
|
|
|
|
implementation libs.androidx.lifecycle.viewmodel.compose
|
|
|
|
implementation libs.androidx.compose.ui.text // Needed for parsing HTML to AnnotatedString
|
|
|
|
implementation libs.androidx.compose.material.icons.extended
|
2024-10-22 00:47:26 +05:30
|
|
|
|
|
|
|
// Jetpack Compose related dependencies
|
2024-11-22 20:59:39 +00:00
|
|
|
implementation libs.androidx.paging.compose
|
|
|
|
implementation libs.androidx.navigation.compose
|
2024-02-28 00:33:46 +05:30
|
|
|
|
2024-08-23 19:51:32 +05:30
|
|
|
// Coroutines interop
|
2024-11-22 20:59:39 +00:00
|
|
|
implementation libs.kotlinx.coroutines.rx3
|
2024-02-28 00:33:46 +05:30
|
|
|
|
2024-08-23 14:05:50 +05:30
|
|
|
// Library loading for About screen
|
2024-11-27 16:20:49 +01:00
|
|
|
implementation libs.aboutlibraries.compose.m3
|
2024-08-23 14:05:50 +05:30
|
|
|
|
2024-10-22 00:47:26 +05:30
|
|
|
// Hilt
|
2024-11-22 20:59:39 +00:00
|
|
|
implementation libs.hilt.android
|
|
|
|
kapt(libs.hilt.compiler)
|
2024-10-22 00:47:26 +05:30
|
|
|
|
|
|
|
// Scroll
|
2024-11-22 20:59:39 +00:00
|
|
|
implementation libs.lazycolumnscrollbar
|
2024-10-22 00:47:26 +05:30
|
|
|
|
2021-03-31 11:49:55 -04:00
|
|
|
/** Debugging **/
|
|
|
|
// Memory leak detection
|
2024-11-22 20:59:39 +00:00
|
|
|
debugImplementation libs.leakcanary.object.watcher
|
|
|
|
debugImplementation libs.leakcanary.plumber.android
|
|
|
|
debugImplementation libs.leakcanary.android.core
|
2021-03-31 11:49:55 -04:00
|
|
|
// Debug bridge for Android
|
2024-11-22 20:59:39 +00:00
|
|
|
debugImplementation libs.stetho
|
|
|
|
debugImplementation libs.stetho.okhttp3
|
2021-03-31 11:49:55 -04:00
|
|
|
|
2024-02-28 00:33:46 +05:30
|
|
|
// Jetpack Compose
|
2024-11-22 20:59:39 +00:00
|
|
|
debugImplementation libs.androidx.compose.ui.tooling
|
2024-02-28 00:33:46 +05:30
|
|
|
|
2021-03-31 11:49:55 -04:00
|
|
|
/** Testing **/
|
2024-11-22 20:59:39 +00:00
|
|
|
testImplementation libs.junit
|
|
|
|
testImplementation libs.mockito.core
|
2020-11-22 13:49:09 +01:00
|
|
|
|
2024-11-22 20:59:39 +00:00
|
|
|
androidTestImplementation libs.androidx.junit
|
|
|
|
androidTestImplementation libs.androidx.runner
|
|
|
|
androidTestImplementation libs.androidx.room.testing
|
|
|
|
androidTestImplementation libs.assertj.core
|
2015-09-04 02:15:03 +02:00
|
|
|
}
|
2020-03-13 20:10:37 -03:00
|
|
|
|
|
|
|
static String getGitWorkingBranch() {
|
|
|
|
try {
|
|
|
|
def gitProcess = "git rev-parse --abbrev-ref HEAD".execute()
|
|
|
|
gitProcess.waitFor()
|
|
|
|
if (gitProcess.exitValue() == 0) {
|
|
|
|
return gitProcess.text.trim()
|
|
|
|
} else {
|
|
|
|
// not a git repository
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
} catch (IOException ignored) {
|
|
|
|
// git was not found
|
|
|
|
return ""
|
|
|
|
}
|
2020-03-27 20:45:26 +01:00
|
|
|
}
|
2023-01-20 18:39:16 +01:00
|
|
|
|
2023-04-04 17:42:34 +02:00
|
|
|
// fix reproducible builds
|
2023-01-20 18:39:16 +01:00
|
|
|
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, "")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|