core/build.gradle.kts
changeset 7 b3b2e88f441f
parent 6 67743d62eda9
child 12 dc48b76fbeb8
equal deleted inserted replaced
6:67743d62eda9 7:b3b2e88f441f
     1 plugins {
     1 plugins {
     2 //    alias(libs.plugins.com.android.application)
       
     3 //    alias(libs.plugins.org.jetbrains.kotlin.android)
       
     4     id("com.android.library")
     2     id("com.android.library")
     5     kotlin("android")
     3     kotlin("android")
     6     id("com.geekorum.build.source-license-checker")
     4     id("com.geekorum.build.source-license-checker")
       
     5     `maven-publish`
     7 }
     6 }
       
     7 
       
     8 group = "com.geekorum.aboutoss"
       
     9 version = "0.0.1"
     8 
    10 
     9 android {
    11 android {
    10     namespace = "com.geekorum.aboutoss.core"
    12     namespace = "com.geekorum.aboutoss.core"
    11     compileSdk = 33
    13     compileSdk = 33
    12 
    14 
    13     defaultConfig {
    15     defaultConfig {
    14         minSdk = 24
    16         minSdk = 24
    15 
    17 
    16         testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
    18         testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
    17         consumerProguardFiles("consumer-rules.pro")
    19         consumerProguardFiles("consumer-rules.pro")
       
    20         aarMetadata {
       
    21             minCompileSdk = 24
       
    22         }
    18     }
    23     }
    19 
    24 
    20     buildTypes {
    25     buildTypes {
    21         release {
    26         release {
    22             isMinifyEnabled = false
    27             isMinifyEnabled = false
    31         targetCompatibility = JavaVersion.VERSION_1_8
    36         targetCompatibility = JavaVersion.VERSION_1_8
    32     }
    37     }
    33     kotlinOptions {
    38     kotlinOptions {
    34         jvmTarget = "1.8"
    39         jvmTarget = "1.8"
    35     }
    40     }
       
    41 
       
    42     publishing {
       
    43         singleVariant("release") {
       
    44             withJavadocJar()
       
    45             withSourcesJar()
       
    46         }
       
    47     }
    36 }
    48 }
    37 
    49 
    38 dependencies {
    50 dependencies {
    39     implementation(libs.okio)
    51     implementation(libs.okio)
    40     implementation(libs.kotlinx.coroutines)
    52     implementation(libs.kotlinx.coroutines)
    41 
    53 
    42     testImplementation(libs.junit)
    54     testImplementation(libs.junit)
    43     androidTestImplementation(libs.androidx.test.ext.junit)
    55     androidTestImplementation(libs.androidx.test.ext.junit)
    44     androidTestImplementation(libs.espresso.core)
    56     androidTestImplementation(libs.espresso.core)
    45 }
    57 }
       
    58 
       
    59 publishing {
       
    60     publications {
       
    61         val pomConfiguration: (MavenPom).() -> Unit = {
       
    62             name.set("core")
       
    63             description.set("A library to retrieve and display opensource licenses in Android applications")
       
    64             licenses {
       
    65                 license {
       
    66                     name.set("GPL-3.0-or-later")
       
    67                     url.set("https://www.gnu.org/licenses/gpl-3.0.html")
       
    68                     distribution.set("repo")
       
    69                 }
       
    70             }
       
    71             inceptionYear.set("2023")
       
    72         }
       
    73 
       
    74         register<MavenPublication>("release") {
       
    75             afterEvaluate {
       
    76                 from(components["release"])
       
    77             }
       
    78             artifactId = "core"
       
    79             pom(pomConfiguration)
       
    80         }
       
    81     }
       
    82 }