Skip to content

Commit 3f6bac9

Browse files
Setup maven publish with Allegro's axion plugin
1 parent e272e42 commit 3f6bac9

File tree

2 files changed

+26
-4
lines changed

2 files changed

+26
-4
lines changed

build.gradle

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// Top-level build file where you can add configuration options common to all sub-projects/modules.
2-
31
buildscript {
42
ext.kotlin_version = '1.3.72'
53
repositories {
@@ -15,10 +13,14 @@ buildscript {
1513
}
1614
}
1715

16+
plugins {
17+
id 'pl.allegro.tech.build.axion-release' version '1.12.0'
18+
}
19+
1820
allprojects {
1921

2022
group 'dev.michallaskowski.mokttp'
21-
version = '0.0.1'
23+
version = scmVersion.version
2224

2325
repositories {
2426
google()

library/build.gradle

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,24 @@ apply plugin: 'maven'
33
apply plugin: 'maven-publish'
44
apply plugin: 'com.android.library'
55

6+
publishing {
7+
publications {
8+
kotlinMultiplatform.artifactId = "mokttp-common"
9+
}
10+
repositories {
11+
maven {
12+
name = "central"
13+
def snapshotRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots"
14+
def stagingRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2"
15+
url = version.endsWith('SNAPSHOT') ? snapshotRepoUrl : stagingRepoUrl
16+
credentials {
17+
username = System.getenv("MAVEN_USERNAME")
18+
password = System.getenv("MAVEN_PASSWORD")
19+
}
20+
}
21+
}
22+
}
23+
624
android {
725
compileSdkVersion 29
826
defaultConfig {
@@ -52,7 +70,9 @@ kotlin {
5270
}
5371
}
5472

55-
fromPreset(presets.android, 'android')
73+
fromPreset(presets.android, 'android') {
74+
publishAllLibraryVariants()
75+
}
5676
}
5777

5878
sourceSets {

0 commit comments

Comments
 (0)