diff --git a/api-client-retrofit2/build.gradle b/api-client-retrofit2/build.gradle index 69fead2..818ad0f 100644 --- a/api-client-retrofit2/build.gradle +++ b/api-client-retrofit2/build.gradle @@ -1,7 +1,5 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile -group 'fi.paytrail.sdk' -version '0.1.0' buildscript { repositories { @@ -19,6 +17,7 @@ apply plugin: 'kotlinx-serialization' apply plugin: 'maven-publish' apply plugin: 'org.jlleitschuh.gradle.ktlint' + ktlint { version.set(libs.versions.ktlint) outputToConsole.set(true) @@ -48,3 +47,14 @@ tasks.withType(KotlinCompile).configureEach { freeCompilerArgs += "-Xopt-in=kotlinx.serialization.ExperimentalSerializationApi" } } + +publishing { + publications { + apiClientRetrofit2(MavenPublication) { + from components.kotlin + groupId "com.github.paytrail" + artifactId "api-client-retrofit2" + version "v0.1.0-alpha" + } + } +} diff --git a/payment-sdk/build.gradle.kts b/payment-sdk/build.gradle.kts index 27b7709..9923c4a 100644 --- a/payment-sdk/build.gradle.kts +++ b/payment-sdk/build.gradle.kts @@ -4,6 +4,7 @@ plugins { alias(libs.plugins.org.jetbrains.kotlin.android) alias(libs.plugins.org.jetbrains.kotlin.parcelize) alias(libs.plugins.jlleitschuh.ktlint) + id("maven-publish") } ktlint { @@ -38,7 +39,7 @@ android { // Flag to enable support for the new language APIs isCoreLibraryDesugaringEnabled = true - // Sets Java compatibility to Java 8 + // Sets Java compatibility to Java 17 sourceCompatibility = JavaVersion.VERSION_17 targetCompatibility = JavaVersion.VERSION_17 } @@ -58,6 +59,26 @@ android { excludes += "/META-INF/{AL2.0,LGPL2.1,LICENSE.md,LICENSE-notice.md}" } } + android { + publishing { + singleVariant("release") { + withSourcesJar() + } + } + } +} +publishing { + publications { + register("release") { + groupId = "com.github.paytrail" + artifactId = "paytrail-android-sdk" + version = "v0.1.0-alpha" + + afterEvaluate { + from(components["release"]) + } + } + } } dependencies {