Thorium-android-app/app/build.gradle

176 lines
6.4 KiB
Groovy
Raw Normal View History

plugins {
id 'com.android.application'
id 'kotlin-android'
id 'kotlin-parcelize'
id 'kotlin-kapt'
}
2018-03-03 01:10:13 +01:00
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
}
}
}
2020-08-29 22:33:23 +02:00
// 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')}")
}
2021-10-04 09:42:35 +02:00
apply plugin: 'kotlin-kapt'
2018-03-03 01:10:13 +01:00
android {
2022-01-01 01:53:43 +01:00
compileSdkVersion 32
2021-11-21 21:02:12 +01:00
buildToolsVersion "30.0.2"
2021-01-13 21:31:05 +01:00
2018-03-03 01:10:13 +01:00
defaultConfig {
applicationId "net.schueller.peertube"
minSdkVersion 21
2022-01-01 01:53:43 +01:00
targetSdkVersion 32
versionCode 1079
versionName "1.12.1"
2020-07-08 12:31:30 +02:00
buildConfigField "long", "BUILD_TIME", readPropertyWithDefault('buildTimestamp', System.currentTimeMillis()) + 'L'
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
2021-01-13 21:31:05 +01:00
2020-06-21 17:01:15 +02:00
javaCompileOptions {
annotationProcessorOptions {
arguments = [
"room.schemaLocation" : "$projectDir/schemas".toString(),
"room.incremental" : "true",
"room.expandProjection": "true"]
}
}
2018-03-03 01:10:13 +01:00
}
2020-08-29 22:33:23 +02:00
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']}"
}
}
2018-03-03 01:10:13 +01:00
buildTypes {
release {
minifyEnabled false
2020-08-29 22:33:23 +02:00
testCoverageEnabled false
2018-03-03 01:10:13 +01:00
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
2020-08-29 22:33:23 +02:00
signingConfig signingConfigs.release
2018-03-03 01:10:13 +01:00
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
2018-11-10 17:48:09 +01:00
applicationVariants.all { variant ->
variant.resValue "string", "versionName", variant.versionName
}
buildFeatures{
2021-12-26 14:59:46 +01:00
viewBinding true
}
2018-03-03 01:10:13 +01:00
}
2022-01-01 01:53:43 +01:00
def room_version = "2.4.0"
def lifecycleVersion = '2.4.0'
def exoplayer = '2.16.1'
def fragment_version = "1.4.0"
2021-01-13 21:31:05 +01:00
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
2020-06-21 17:01:15 +02:00
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
2021-01-13 21:31:05 +01:00
// Layouts and design
2022-01-01 01:53:43 +01:00
implementation 'androidx.constraintlayout:constraintlayout:2.1.2'
implementation 'androidx.appcompat:appcompat:1.4.0'
2021-10-04 09:42:35 +02:00
implementation 'com.google.android.material:material:1.4.0'
2021-01-13 21:31:05 +01:00
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"
implementation "androidx.fragment:fragment-ktx:$fragment_version"
2021-01-13 21:31:05 +01:00
2021-01-24 00:31:51 +01:00
implementation 'de.hdodenhof:circleimageview:3.1.0'
2021-01-13 21:31:05 +01:00
// font awesome
2021-01-24 00:31:51 +01:00
implementation 'com.mikepenz:iconics-core:5.2.4'
implementation 'com.mikepenz:fontawesome-typeface:5.9.0.2-kotlin@aar'
2021-01-13 21:31:05 +01:00
// http client / REST
2022-01-01 01:53:43 +01:00
implementation 'com.squareup.okhttp3:okhttp:4.9.2'
2021-01-13 21:31:05 +01:00
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
// image downloading and caching library
implementation 'com.squareup.picasso:picasso:2.71828'
// json decoder/encoder
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
// Torrents and WebRTC
implementation 'com.github.TorrentStream:TorrentStream-Android:2.7.0'
// implementation "com.github.TorrentStream:TorrentStreamServer-Android:1.0.1"
// implementation 'org.webrtc:google-webrtc:1.0.+'
// video player repo:jcenter()
implementation "com.google.android.exoplayer:exoplayer-core:$exoplayer"
implementation "com.google.android.exoplayer:exoplayer-dash:$exoplayer"
implementation "com.google.android.exoplayer:exoplayer-ui:$exoplayer"
implementation "com.google.android.exoplayer:exoplayer-hls:$exoplayer"
implementation "com.google.android.exoplayer:exoplayer-smoothstreaming:$exoplayer"
implementation "com.google.android.exoplayer:extension-mediasession:$exoplayer"
implementation "com.google.android.exoplayer:extension-okhttp:$exoplayer"
// date formatter, do not update past 4.0.4 https://github.com/sschueller/peertube-android/issues/262
implementation 'org.ocpsoft.prettytime:prettytime:4.0.4.Final'
2021-01-13 21:31:05 +01:00
// Version comparison
2021-01-24 00:31:51 +01:00
implementation 'org.apache.maven:maven-artifact:3.6.3'
2020-06-21 17:01:15 +02:00
// database lib
implementation "androidx.room:room-runtime:$room_version"
implementation "androidx.room:room-ktx:$room_version"
kapt "androidx.room:room-compiler:$room_version"
2020-06-21 17:01:15 +02:00
// Lifecycle components
2021-10-04 09:42:35 +02:00
kapt "androidx.lifecycle:lifecycle-common-java8:$lifecycleVersion"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycleVersion"
implementation "androidx.lifecycle:lifecycle-runtime-ktx:$lifecycleVersion"
implementation "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycleVersion"
implementation 'androidx.preference:preference-ktx:1.1.1'
2021-01-13 21:31:05 +01:00
// testing
2021-01-24 00:31:51 +01:00
testImplementation 'junit:junit:4.13.1'
2021-10-04 09:42:35 +02:00
androidTestImplementation 'androidx.test:runner:1.4.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
androidTestImplementation "androidx.room:room-testing:$room_version"
2018-12-17 18:11:41 +01:00
}
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions {
jvmTarget = "1.8"
}
2021-01-31 23:35:16 +01:00
}