Skip to content

Commit

Permalink
feat: Make library buildable by jitpack.io
Browse files Browse the repository at this point in the history
  • Loading branch information
Aviortheking committed Jan 10, 2023
1 parent 99d4a33 commit 8756d17
Showing 1 changed file with 41 additions and 4 deletions.
45 changes: 41 additions & 4 deletions library/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,19 +1,55 @@
plugins {
id("com.android.library")
`maven-publish`
kotlin("android")
}

val artifact = "charts"
group = "com.dzeio"
val projectVersion = project.findProperty("version") as String? ?: "0.1.0"
version = projectVersion

publishing {
publications {
register<MavenPublication>("release") {
groupId = group as String?
artifactId = artifact
version = projectVersion

afterEvaluate {
from(components["release"])
}
}
}
}

android {
namespace = "${group}.${artifact}"
compileSdk = 33
buildToolsVersion = "33.0.0"

defaultConfig {
minSdk = 21
targetSdk = 33
aarMetadata {
minCompileSdk = 21
}

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles("consumer-rules.pro")
}

testFixtures {
enable = true
}

publishing {
singleVariant("release") {
withSourcesJar()
withJavadocJar()
}
}

buildTypes {
release {
isMinifyEnabled = true
Expand All @@ -23,12 +59,13 @@ android {
)
}
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}

kotlinOptions {
jvmTarget = "1.8"
jvmTarget = "11"
}
namespace = "com.dzeio.charts"
}

0 comments on commit 8756d17

Please # to comment.