thorium-fork/app/build.gradle

152 lines
5.8 KiB
Groovy
Raw Normal View History

2018-03-02 16:10:13 -08:00
apply plugin: 'com.android.application'
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 13:33:23 -07: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')}")
}
2018-03-02 16:10:13 -08:00
android {
2020-06-21 08:01:15 -07:00
compileSdkVersion 29
2021-01-13 12:31:05 -08:00
buildToolsVersion "29.0.3"
2018-03-02 16:10:13 -08:00
defaultConfig {
applicationId "net.schueller.peertube"
minSdkVersion 21
2020-06-21 08:01:15 -07:00
targetSdkVersion 29
2020-08-29 13:33:23 -07:00
versionCode Integer.valueOf(System.getenv("VERSION_CODE") ?: 1)
versionName System.getenv("VERSION_NAME") + "-" + System.getenv("VERSION_SHA")
2020-07-08 03:31:30 -07:00
buildConfigField "long", "BUILD_TIME", readPropertyWithDefault('buildTimestamp', System.currentTimeMillis()) + 'L'
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
2021-01-13 12:31:05 -08:00
2020-06-21 08:01:15 -07:00
javaCompileOptions {
annotationProcessorOptions {
arguments = [
"room.schemaLocation" : "$projectDir/schemas".toString(),
"room.incremental" : "true",
"room.expandProjection": "true"]
}
}
2018-03-02 16:10:13 -08:00
}
2020-08-29 13:33:23 -07: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-02 16:10:13 -08:00
buildTypes {
release {
minifyEnabled false
2020-08-29 13:33:23 -07:00
testCoverageEnabled false
2018-03-02 16:10:13 -08:00
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
2020-08-29 13:33:23 -07:00
signingConfig signingConfigs.release
2018-03-02 16:10:13 -08:00
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
2018-11-10 08:48:09 -08:00
applicationVariants.all { variant ->
variant.resValue "string", "versionName", variant.versionName
}
2018-03-02 16:10:13 -08:00
}
2021-01-13 12:31:05 -08:00
def room_version = "2.2.6"
def lifecycleVersion = '2.2.0'
def exoplayer = '2.12.3'
2021-01-13 12:31:05 -08:00
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
2020-06-21 08:01:15 -07:00
2021-01-13 12:31:05 -08:00
// Layouts and design
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
2020-08-29 13:33:23 -07:00
implementation 'androidx.appcompat:appcompat:1.2.0'
2021-01-13 12:31:05 -08:00
implementation 'com.google.android.material:material:1.2.1'
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"
implementation 'de.hdodenhof:circleimageview:3.0.0'
// font awesome
implementation "com.mikepenz:iconics-core:3.1.0"
implementation 'com.mikepenz:fontawesome-typeface:5.3.1.1@aar'
// http client / REST
implementation 'com.squareup.okhttp3:okhttp:4.9.0'
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
implementation 'org.ocpsoft.prettytime:prettytime:4.0.4.Final'
// Version comparison
implementation 'org.apache.maven:maven-artifact:3.5.0'
2020-06-21 08:01:15 -07:00
// database lib
implementation "androidx.room:room-runtime:$room_version"
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
annotationProcessor "androidx.room:room-compiler:$room_version"
androidTestImplementation "androidx.room:room-testing:$room_version"
// Lifecycle components
2021-01-13 12:31:05 -08:00
implementation "androidx.lifecycle:lifecycle-extensions:$lifecycleVersion"
annotationProcessor "androidx.lifecycle:lifecycle-common-java8:$lifecycleVersion"
2020-06-21 08:01:15 -07:00
implementation 'androidx.preference:preference:1.1.1'
2021-01-13 12:31:05 -08:00
// testing
testImplementation 'junit:junit:4.13'
androidTestImplementation 'androidx.test:runner:1.3.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
2018-12-17 09:11:41 -08:00
}