Files
coco 723ce1af5c a
2026-07-03 15:12:48 +08:00

122 lines
3.9 KiB
Kotlin

import com.vanniktech.maven.publish.AndroidSingleVariantLibrary
import com.vanniktech.maven.publish.SonatypeHost
plugins {
id("com.android.library")
id("org.jetbrains.kotlin.android")
id("kotlin-parcelize")
id("org.jetbrains.dokka") version "1.9.20"
id("com.vanniktech.maven.publish") version "0.28.0"
}
android {
namespace = "com.rajat.pdfviewer"
compileSdk = 34
defaultConfig {
minSdk = 21
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles("consumer-rules.pro")
}
buildTypes {
release {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
}
kotlin {
jvmToolchain(17)
}
buildFeatures {
viewBinding = true
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = "1.5.4"
}
}
dependencies {
val kotlin_version = "1.9.21"
implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar"))))
implementation("org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version")
implementation("androidx.core:core-ktx:1.12.0")
implementation("androidx.appcompat:appcompat:1.6.1")
implementation("androidx.recyclerview:recyclerview:1.3.2")
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3")
implementation("com.google.android.material:material:1.11.0")
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
// ViewModel
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2")
implementation("androidx.activity:activity-ktx:1.8.1")
// compose
implementation(platform("androidx.compose:compose-bom:2023.10.01"))
androidTestImplementation(platform("androidx.compose:compose-bom:2023.10.01"))
implementation("androidx.compose.ui:ui:1.6.4")
// Android Studio Preview support
implementation("androidx.compose.ui:ui-tooling-preview:1.6.4")
debugImplementation("androidx.compose.ui:ui-tooling:1.6.4")
// UI Tests
androidTestImplementation("androidx.compose.ui:ui-test-junit4")
debugImplementation("androidx.compose.ui:ui-test-manifest")
implementation("androidx.activity:activity-compose:1.8.2")
}
mavenPublishing {
configure(
AndroidSingleVariantLibrary(
// the published variant
variant = "release",
// whether to publish a sources jar
sourcesJar = true,
)
)
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL)
signAllPublications()
coordinates("io.github.afreakyelf", "Pdf-Viewer", "2.1.1")
pom {
name.set("PDF Viewer")
description.set("A PDF viewing library for Android")
url.set("https://github.com/afreakyelf/pdfviewer")
licenses {
license {
name.set("MIT License")
url.set("https://opensource.org/licenses/MIT")
}
}
developers {
developer {
id.set("afreakyelf")
name.set("Rajat Mittal")
email.set("rjmittal07@gmail.com")
}
}
scm {
connection.set("scm:git:git://github.com/afreakyelf/pdfviewer.git")
developerConnection.set("scm:git:ssh://github.com/afreakyelf/pdfviewer.git")
url.set("https://github.com/afreakyelf/pdfviewer")
}
}
}