// Apply necessary plugins apply plugin: 'com.android.library' apply plugin: 'maven-publish' apply plugin: 'signing' // Define the version and group for the Maven package version = "1.1.5" group = "net.servicestack" if (project.hasProperty('versionSuffix')) { version = "${version}-${versionSuffix}" } // Specify dependencies dependencies { implementation 'com.google.code.gson:gson:2.11.0' implementation 'com.squareup.okhttp3:okhttp:3.14.9' implementation fileTree(include: '*.jar', dir: 'libs') androidTestImplementation 'junit:junit:4.13.2' androidTestImplementation 'com.android.support.test:runner:1.0.2' androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' androidTestImplementation 'com.android.support:support-annotations:28.0.0' } // Android specific configurations android { namespace "net.servicestack.android" compileSdk 34 lintOptions { abortOnError false } defaultConfig { minSdkVersion 15 targetSdkVersion 34 testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner' } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } sourceSets { main.java.srcDirs += 'src/main/kotlin' } } // Configure the publishing block for Maven Central deployment publishing { publications { mavenJava(MavenPublication) { artifact("$buildDir/outputs/aar/${project.name}-release.aar") groupId = group artifactId = 'android' version = version pom { name = 'ServiceStack.Android' description = 'A client library to call your ServiceStack webservices for Android clients.' url = 'https://github.com/ServiceStack/ServiceStack.Java' licenses { license { name = 'The BSD 3-Clause License' url = 'https://servicestack.net/bsd-license.txt' } } developers { developer { id = 'mythz' name = 'Demis Bellot' email = 'team@servicestack.net' } developer { id = 'layoric' name = 'Darren Reid' email = 'team@servicestack.net' } } scm { connection = 'https://github.com/ServiceStack/ServiceStack.Java.git' developerConnection = 'https://github.com/ServiceStack/ServiceStack.Java.git' url = 'https://github.com/ServiceStack/ServiceStack.Java' } } } } repositories { maven { name = 'OSSRH' url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/") credentials { username = project.findProperty("ossrhUsername") ?: System.getenv("OSSRH_USERNAME") password = project.findProperty("ossrhPassword") ?: System.getenv("OSSRH_TOKEN") } } maven { name = 'GitHubPackages' url = uri("https://maven.pkg.github.com/ServiceStack/ServiceStack.Java") credentials { username = project.findProperty("gpr.user") ?: System.getenv("USERNAME_GITHUB") password = project.findProperty("gpr.token") ?: System.getenv("TOKEN_GITHUB") } } } } // Check if the environment variables are set def signingKey = System.getenv('SIGNING_KEY') def signingPassword = System.getenv('SIGNING_PASSWORD') // Conditionally apply the signing plugin and configuration if (signingKey && signingPassword) { println "Signing enabled" signing { useInMemoryPgpKeys(signingKey, signingPassword) sign publishing.publications.mavenJava } } else { println "Signing disabled" }