Thorium-android-app/app/build.gradle

198 lines
7.3 KiB
Groovy

plugins {
id 'com.android.application'
id 'kotlin-android'
id 'kotlin-kapt'
id 'dagger.hilt.android.plugin'
id 'kotlin-parcelize'
}
ext.readProperty = { paramName -> readPropertyWithDefault(paramName, null) }
ext.readPropertyWithDefault = { paramName, defaultValue ->
if (project.hasProperty(paramName)) {
return project.getProperties().get(paramName)
} else {
Properties properties = new Properties()
if (project.rootProject.file('local.properties').exists()) {
properties.load(project.rootProject.file('local.properties').newDataInputStream())
}
if (properties.getProperty(paramName) != null) {
return properties.getProperty(paramName)
} else {
return defaultValue
}
}
}
// Try reading secrets from file
def secretsPropertiesFile = rootProject.file("secrets.properties")
def secretProperties = new Properties()
if (secretsPropertiesFile.exists()) {
secretProperties.load(new FileInputStream(secretsPropertiesFile))
}
// Otherwise read from environment variables, this happens in CI
else {
secretProperties.setProperty("signing_keystore_password", "${System.getenv('signing_keystore_password')}")
secretProperties.setProperty("signing_key_password", "${System.getenv('signing_key_password')}")
secretProperties.setProperty("signing_key_alias", "${System.getenv('signing_key_alias')}")
}
android {
compileSdk 32
defaultConfig {
applicationId "net.schueller.peertube"
minSdk 21
targetSdk 32
versionCode 1077
versionName "1.11.0"
buildConfigField "long", "BUILD_TIME", readPropertyWithDefault('buildTimestamp', System.currentTimeMillis()) + 'L'
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
useSupportLibrary true
}
javaCompileOptions {
annotationProcessorOptions {
arguments += ["room.schemaLocation": "$projectDir/schemas".toString()]
}
}
}
signingConfigs {
release {
// You need to specify either an absolute path or include the
// keystore file in the same directory as the build.gradle file.
storeFile file("../android-signing-keystore.jks")
storePassword "${secretProperties['signing_keystore_password']}"
keyAlias "${secretProperties['signing_key_alias']}"
keyPassword "${secretProperties['signing_key_password']}"
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
debug {
minifyEnabled false
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
applicationVariants.all { variant ->
variant.resValue "string", "versionName", variant.versionName
}
kotlinOptions {
jvmTarget = '1.8'
useIR = true
}
buildFeatures {
compose true
}
composeOptions {
kotlinCompilerExtensionVersion compose_version
kotlinCompilerVersion koltin_version
}
packagingOptions {
resources {
excludes += '/META-INF/{AL2.0,LGPL2.1}'
}
}
}
//apply plugin: 'kotlin-kapt'
dependencies {
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.5.0'
implementation "androidx.compose.ui:ui:$compose_version"
implementation "androidx.compose.material:material:$compose_version"
implementation "androidx.compose.material3:material3:1.0.0-alpha10"
implementation "androidx.compose.ui:ui-tooling-preview:$compose_version"
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.4.1'
implementation 'androidx.activity:activity-compose:1.4.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version"
debugImplementation "androidx.compose.ui:ui-tooling:$compose_version"
// Images
implementation "io.coil-kt:coil-compose:1.4.0"
// Time formatting
implementation 'org.ocpsoft.prettytime:prettytime:4.0.4.Final'
// Vide playback
implementation "com.google.android.exoplayer:exoplayer:$exo_player_version"
implementation "com.google.android.exoplayer:exoplayer-core:$exo_player_version"
implementation "com.google.android.exoplayer:exoplayer-hls:$exo_player_version"
implementation "com.google.android.exoplayer:exoplayer-dash:$exo_player_version"
implementation "com.google.android.exoplayer:exoplayer-rtsp:$exo_player_version"
implementation "com.google.android.exoplayer:exoplayer-transformer:$exo_player_version"
implementation "com.google.android.exoplayer:exoplayer-ui:$exo_player_version"
// Compose dependencies
implementation "androidx.lifecycle:lifecycle-viewmodel-compose:2.4.1"
implementation "androidx.navigation:navigation-compose:2.5.0-beta01"
implementation "androidx.constraintlayout:constraintlayout-compose:1.0.0"
implementation "com.google.accompanist:accompanist-flowlayout:0.17.0"
// Paging Compose
implementation "androidx.paging:paging-compose:1.0.0-alpha14"
// Settings compose
implementation "com.github.JamalMulla:ComposePrefs:1.0.2"
implementation "androidx.datastore:datastore-preferences:1.0.0"
// Room Database
implementation "androidx.room:room-ktx:$room_version"
kapt "androidx.room:room-compiler:$room_version"
// Compose support libs until Google implements them directly
implementation 'com.google.accompanist:accompanist-systemuicontroller:0.22.0-rc'
implementation 'com.google.accompanist:accompanist-permissions:0.22.0-rc'
implementation 'com.google.accompanist:accompanist-placeholder-material:0.22.0-rc'
implementation 'com.google.accompanist:accompanist-swiperefresh:0.22.0-rc'
// Coroutines
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.0'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.0'
// Coroutine Lifecycle Scopes
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.1"
implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.4.1"
//Dagger - Hilt
implementation "com.google.dagger:hilt-android:2.40.5"
kapt "com.google.dagger:dagger-compiler:2.40.5"
kapt "com.google.dagger:hilt-android-compiler:2.40.5"
implementation "androidx.hilt:hilt-lifecycle-viewmodel:1.0.0-alpha03"
kapt "androidx.hilt:hilt-compiler:1.0.0"
implementation 'androidx.hilt:hilt-navigation-compose:1.0.0'
// Retrofit
// http client / REST
implementation 'com.squareup.okhttp3:okhttp:5.0.0-alpha.3'
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
implementation "com.squareup.okhttp3:okhttp:5.0.0-alpha.3"
implementation "com.squareup.okhttp3:logging-interceptor:5.0.0-alpha.2"
}
kapt {
correctErrorTypes true
}