build.gradle 1.93 KB
plugins {
    id 'com.android.library'
    id 'kotlin-android'
    id 'maven'
}

android {
    compileSdkVersion var.compileSdkVersion

    defaultConfig {
        minSdkVersion var.minSdkVersion
        targetSdkVersion var.targetSdkVersion
        versionCode var.versionCode
        versionName var.versionName

        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        consumerProguardFiles "consumer-rules.pro"

        buildConfigField "String", "API_VERSION", "\"${requestVersion}\""

        javaCompileOptions {
            annotationProcessorOptions {
                arguments = [AROUTER_MODULE_NAME: project.getName()]
            }
        }
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    // 自定义AAR包名
    android.libraryVariants.all { variant ->
        variant.outputs.all {
            if (outputFileName != null && outputFileName.endsWith(".aar")) {
                def fileName = "${project.name}-${buildType.name}-v${var.aar_version}.aar"
                outputFileName = fileName
            }
        }
    }
}

dependencies {
    api 'com.alibaba:arouter-api:1.5.2'
    api 'com.squareup.okhttp3:okhttp:4.8.0'
    implementation project(path: ':wdbean')
}

uploadArchives {
    repositories {
        mavenDeployer {
            repository(url: "https://packages.aliyun.com/6708d221eef79c23d7b02189/maven/repo-higom/") {
                authentication(userName: '6708d1cf6f4c940bd257c88d', password: 'Wm51gc4rARyr')
            }
            pom.project {
                artifactId 'wdinterface'
                version '1.0.3'
                groupId 'com.wd'
                packaging 'aar'
            }
        }
    }
}