80 lines
2.3 KiB
Groovy
80 lines
2.3 KiB
Groovy
plugins {
|
|
id 'com.android.library'
|
|
id 'kotlin-android'
|
|
id 'maven-publish'
|
|
}
|
|
|
|
android {
|
|
compileSdk 31
|
|
|
|
defaultConfig {
|
|
minSdk 21
|
|
targetSdk 31
|
|
|
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
consumerProguardFiles "consumer-rules.pro"
|
|
}
|
|
|
|
buildTypes {
|
|
release {
|
|
minifyEnabled 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'
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
implementation 'androidx.core:core-ktx:1.5.0'
|
|
testImplementation 'junit:junit:4.+'
|
|
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
|
|
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
|
|
}
|
|
|
|
|
|
ext {
|
|
PUBLISH_GROUP_ID = "io.github.shinyshine90" //项目包名
|
|
PUBLISH_ARTIFACT_ID = 'keyboard-aware-layout' //项目名
|
|
PUBLISH_VERSION = '0.0.4' //版本号
|
|
}
|
|
apply from: "${rootProject.projectDir}/script/publish-mavencentral.gradle"
|
|
|
|
afterEvaluate {
|
|
/*publishing {
|
|
repositories {
|
|
maven {
|
|
def releasesRepoUrl = file("/Users/shawn/temp/repos/release")
|
|
def snapshotsRepoUrl = file("/Users/shawn/temp/repos/snapshot")
|
|
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
|
|
}
|
|
}
|
|
publications {
|
|
// Creates a Maven publication called "release".
|
|
release(MavenPublication) {
|
|
// Applies the component for the release build variant.
|
|
from components.release
|
|
|
|
// You can then customize attributes of the publication as shown below.
|
|
groupId = 'cn.candy.uikit'
|
|
artifactId = 'keyboard-aware-layout'
|
|
version = '0.0.1'
|
|
}
|
|
// Creates a Maven publication called “debug”.
|
|
debug(MavenPublication) {
|
|
// Applies the component for the debug build variant.
|
|
from components.debug
|
|
|
|
groupId = 'cn.candy.uikit'
|
|
artifactId = 'keyboard-aware-layout'
|
|
version = '0.0.1-SNAPSHOT'
|
|
}
|
|
}
|
|
}*/
|
|
}
|