Skip to content

Commit

Permalink
Switch to com.github.dcendents.android-maven plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
3cky committed Jan 6, 2020
1 parent 1e18120 commit e4b24bc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 21 deletions.
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.3'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
29 changes: 8 additions & 21 deletions lib/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
apply plugin: 'com.android.library'
apply plugin: 'maven-publish'
apply plugin: 'com.github.dcendents.android-maven'

project.archivesBaseName='usb-i2c-android'
group='com.github.3cky'
def artifactId='usb-i2c-android'
version='1.0'

android {
compileSdkVersion 29
Expand All @@ -11,8 +12,6 @@ android {
minSdkVersion 19
targetSdkVersion 29

versionName "1.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

Expand All @@ -22,7 +21,6 @@ android {
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}

}

dependencies {
Expand All @@ -36,22 +34,11 @@ dependencies {
implementation 'org.jetbrains:annotations-java5:15.0'
}

project.afterEvaluate {
publishing {
publications {
library(MavenPublication) {
setGroupId group
setArtifactId artifactId
version android.defaultConfig.versionName

artifact bundleReleaseAar
artifact androidSourcesJar
}
}
}
}

task androidSourcesJar(type: Jar) {
classifier 'sources'
from android.sourceSets.main.java.srcDirs
}
}

artifacts {
archives androidSourcesJar
}

0 comments on commit e4b24bc

Please sign in to comment.