|
| 1 | +/* |
| 2 | + * Copyright 2018 Readium Foundation. All rights reserved. |
| 3 | + * Use of this source code is governed by the BSD-style license |
| 4 | + * available in the top-level LICENSE file of the project. |
| 5 | + */ |
| 6 | + |
| 7 | +plugins { |
| 8 | + id("com.android.library") |
| 9 | + id("kotlin-android") |
| 10 | + id("kotlin-parcelize") |
| 11 | + id("kotlin-kapt") |
| 12 | + id("maven-publish") |
| 13 | + id("org.jetbrains.dokka") |
| 14 | +} |
| 15 | + |
| 16 | +android { |
| 17 | + |
| 18 | + compileSdk = 31 |
| 19 | + defaultConfig { |
| 20 | + minSdk = 21 |
| 21 | + targetSdk = 31 |
| 22 | + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" |
| 23 | + } |
| 24 | + compileOptions { |
| 25 | + sourceCompatibility = JavaVersion.VERSION_1_8 |
| 26 | + targetCompatibility = JavaVersion.VERSION_1_8 |
| 27 | + } |
| 28 | + kotlinOptions { |
| 29 | + jvmTarget = "1.8" |
| 30 | + freeCompilerArgs = freeCompilerArgs + "-Xopt-in=kotlin.RequiresOptIn" |
| 31 | + allWarningsAsErrors = true |
| 32 | + } |
| 33 | + buildTypes { |
| 34 | + getByName("release") { |
| 35 | + isMinifyEnabled = false |
| 36 | + proguardFiles(getDefaultProguardFile("proguard-android.txt")) |
| 37 | + } |
| 38 | + } |
| 39 | +} |
| 40 | + |
| 41 | +afterEvaluate { |
| 42 | + publishing { |
| 43 | + publications { |
| 44 | + create<MavenPublication>("release") { |
| 45 | + from(components.getByName("release")) |
| 46 | + groupId = "com.github.readium" |
| 47 | + artifactId = "readium-lcp" |
| 48 | + artifact(tasks.findByName("sourcesJar")) |
| 49 | + artifact(tasks.findByName("javadocsJar")) |
| 50 | + } |
| 51 | + } |
| 52 | + } |
| 53 | +} |
| 54 | + |
| 55 | +dependencies { |
| 56 | + implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar")))) |
| 57 | + |
| 58 | + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2") |
| 59 | + |
| 60 | + api(project(":readium:shared")) |
| 61 | + |
| 62 | + implementation("androidx.constraintlayout:constraintlayout:2.1.2") |
| 63 | + implementation("androidx.core:core-ktx:1.7.0") |
| 64 | + implementation("com.google.android.material:material:1.4.0") |
| 65 | + implementation("com.jakewharton.timber:timber:5.0.1") |
| 66 | + implementation("com.mcxiaoke.koi:async:0.5.5") { |
| 67 | + exclude(module = "support-v4") |
| 68 | + } |
| 69 | + implementation("com.mcxiaoke.koi:core:0.5.5") { |
| 70 | + exclude(module = "support-v4") |
| 71 | + } |
| 72 | + implementation("joda-time:joda-time:2.10.13") |
| 73 | + implementation("org.zeroturnaround:zt-zip:1.14") |
| 74 | + implementation("androidx.browser:browser:1.4.0") |
| 75 | + |
| 76 | + // Room database |
| 77 | + val roomVersion = "2.4.0" |
| 78 | + implementation("androidx.room:room-runtime:$roomVersion") |
| 79 | + implementation("androidx.room:room-ktx:$roomVersion") |
| 80 | + kapt("androidx.room:room-compiler:$roomVersion") |
| 81 | + |
| 82 | + // Tests |
| 83 | + testImplementation("junit:junit:4.13.2") |
| 84 | + androidTestImplementation("androidx.test.ext:junit:1.1.3") |
| 85 | + androidTestImplementation("androidx.test.espresso:espresso-core:3.4.0") |
| 86 | +} |
0 commit comments