sdk/build.gradle
2022-12-02 19:29:59 +00:00

169 lines
4.8 KiB
Groovy

plugins {
id 'org.jetbrains.kotlin.jvm' version '1.7.22' apply false
id "org.jlleitschuh.gradle.ktlint" version "11.0.0"
id "io.github.gradle-nexus.publish-plugin" version "1.1.0"
id "org.jetbrains.kotlin.plugin.serialization" version "1.7.20"
id "com.google.devtools.ksp" version "1.7.20-1.0.7" apply false
}
ext {
PUBLISH_VERSION = '1.8.2-SNAPSHOT'
SITE_URL = 'https://github.com/wulkanowy/sdk'
GIT_URL = 'https://github.com/wulkanowy/sdk.git'
jspoon = "1.3.2"
jsoup = "1.15.3"
okhttp3 = "4.10.0"
retrofit = "2.9.0"
slf4j = "2.0.5"
moshi = "1.13.0"
coroutines = "1.6.4"
}
version = PUBLISH_VERSION
group = "io.github.wulkanowy"
nexusPublishing {
repositories {
sonatype {
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
username = System.getenv("MAVEN_USERNAME")
password = System.getenv("MAVEN_PASSWORD")
}
}
}
allprojects {
apply plugin: 'java'
apply plugin: 'kotlin'
apply plugin: 'maven-publish'
apply plugin: 'signing'
apply plugin: "org.jlleitschuh.gradle.ktlint"
apply plugin: 'kotlinx-serialization'
repositories {
mavenCentral()
maven { url "https://jitpack.io" }
}
dependencies {
implementation "org.slf4j:slf4j-api:$slf4j"
testImplementation "org.slf4j:slf4j-simple:$slf4j"
implementation platform("com.squareup.okhttp3:okhttp-bom:$okhttp3")
}
java {
withJavadocJar()
withSourcesJar()
}
publishing {
publications {
sdk(MavenPublication) {
from components.java
version = rootProject.version
pom {
name = 'VULCAN UONET+ SDK'
description = 'Unified way of retrieving data from the UONET+ register through mobile api and scraping api'
url = 'https://github.com/wulkanowy/sdk'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'https://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'mklkj'
name = 'Mikołaj Pich'
email = 'm.pich@outlook.com'
}
}
scm {
connection = 'https://github.com/wulkanowy/sdk.git'
developerConnection = 'git@github.com:wulkanowy/sdk.git'
url = 'https://github.com/wulkanowy/sdk'
}
}
}
}
if (System.getenv("MAVEN_SIGNING_KEY")) {
signing {
def signingKey = System.getenv("MAVEN_SIGNING_KEY") ?: ""
def signingPassword = System.getenv("MAVEN_SIGNING_PASSWORD")
useInMemoryPgpKeys(new String(signingKey.decodeBase64()), signingPassword)
sign publishing.publications.sdk
}
}
javadoc {
if (JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
}
}
}
subprojects {
apply plugin: 'jacoco'
ktlint {
additionalEditorconfigFile = file(".editorconfig")
disabledRules = [
"no-wildcard-imports",
"import-ordering",
"max-line-length"
]
}
sourceCompatibility = 11
compileKotlin {
kotlinOptions {
jvmTarget = "11"
javaParameters = true
}
}
compileTestKotlin {
kotlinOptions.jvmTarget = "11"
}
dependencies {
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines"
implementation "com.squareup.okhttp3:logging-interceptor"
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.4.1"
testImplementation "junit:junit:4.13.2"
testImplementation "com.squareup.okhttp3:mockwebserver"
testImplementation "com.squareup.retrofit2:retrofit-mock:$retrofit"
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutines"
}
jacocoTestReport {
reports {
xml.enabled true
}
}
jacoco {
toolVersion "0.8.8"
}
test {
testLogging.showStandardStreams = false
}
group = "io.github.wulkanowy.sdk"
}
dependencies {
api project(":sdk")
api project(":sdk-mobile")
api project(":sdk-scrapper")
api "com.squareup.okhttp3:okhttp"
}