Skip to content

Commit

Permalink
feat: 更新 gradle publish 配置
Browse files Browse the repository at this point in the history
  • Loading branch information
limuyang2 committed May 30, 2023
1 parent 1e36367 commit af15cef
Showing 1 changed file with 29 additions and 7 deletions.
36 changes: 29 additions & 7 deletions library/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
plugins {
id("com.android.library")
id("kotlin-android")
id 'maven-publish'
}

var verName = '3.0.13'

group = 'com.github.CymChad'
version = verName

android {
compileSdkVersion 30
Expand All @@ -26,16 +34,30 @@ android {
kotlinOptions {
jvmTarget = '1.8'
}
publishing {
singleVariant('release') {
withSourcesJar()
}
}
}

// 打包源码jar
task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
archiveClassifier = 'sources'
}

dependencies {
implementation 'androidx.annotation:annotation:1.5.0'
implementation 'androidx.databinding:databinding-runtime:8.0.1'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
}

afterEvaluate {
publishing {
publications {
// Creates a Maven publication called "release".
release(MavenPublication) {
from components.release
groupId = 'com.github.CymChad'
artifactId = 'BaseRecyclerViewAdapterHelper'
version = verName
}
}
}
}

0 comments on commit af15cef

Please sign in to comment.