From 64f5b83215545b57a19e59ccdc5e0b545b7ee9bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0brahim=20S=C3=BCren?= Date: Sun, 7 Nov 2021 21:17:33 +0300 Subject: [PATCH] add maven publish plugin --- jitpack.yml | 4 +++- lib/build.gradle | 17 +++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/jitpack.yml b/jitpack.yml index 46c8529..8a96b14 100644 --- a/jitpack.yml +++ b/jitpack.yml @@ -1,2 +1,4 @@ jdk: - - openjdk11 \ No newline at end of file + - openjdk11 +install: + - ./gradlew build :lib:publishToMavenLocal \ No newline at end of file diff --git a/lib/build.gradle b/lib/build.gradle index 4cf7939..cdac76b 100644 --- a/lib/build.gradle +++ b/lib/build.gradle @@ -2,6 +2,7 @@ apply plugin: 'com.android.library' apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' apply plugin: 'kotlin-parcelize' +apply plugin: 'maven-publish' android { compileSdkVersion 31 @@ -36,6 +37,22 @@ android { } } +task androidSourcesJar(type: Jar) { + classifier 'sources' + from android.sourceSets.main.java.srcDirs +} + +project.afterEvaluate { + publishing { + publications { + release(MavenPublication) { + from components.release + artifact androidSourcesJar + } + } + } +} + dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib:1.5.31" implementation 'androidx.core:core-ktx:1.7.0'