Add kotlin plugin

This commit is contained in:
Paul Schaub 2023-10-31 11:24:27 +01:00
parent cf1d39643d
commit 4bd4657906
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311

View file

@ -19,6 +19,8 @@ buildscript {
plugins { plugins {
id 'ru.vyarus.animalsniffer' version '1.5.3' id 'ru.vyarus.animalsniffer' version '1.5.3'
id 'org.jetbrains.kotlin.jvm' version "1.8.10"
id 'com.diffplug.spotless' version '6.22.0' apply false
} }
apply from: 'version.gradle' apply from: 'version.gradle'
@ -29,6 +31,8 @@ allprojects {
apply plugin: 'eclipse' apply plugin: 'eclipse'
apply plugin: 'jacoco' apply plugin: 'jacoco'
apply plugin: 'checkstyle' apply plugin: 'checkstyle'
apply plugin: 'kotlin'
apply plugin: 'com.diffplug.spotless'
// For non-cli modules enable android api compatibility check // For non-cli modules enable android api compatibility check
if (it.name.equals('sop-java')) { if (it.name.equals('sop-java')) {
@ -53,6 +57,12 @@ allprojects {
toolVersion = '8.18' toolVersion = '8.18'
} }
spotless {
kotlin {
ktfmt().dropboxStyle()
}
}
group 'org.pgpainless' group 'org.pgpainless'
description = "Stateless OpenPGP Protocol API for Java" description = "Stateless OpenPGP Protocol API for Java"
version = shortVersion version = shortVersion
@ -69,6 +79,13 @@ allprojects {
reproducibleFileOrder = true reproducibleFileOrder = true
} }
// Compatibility of default implementations in kotlin interfaces with Java implementations.
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
kotlinOptions {
freeCompilerArgs += ["-Xjvm-default=all-compatibility"]
}
}
project.ext { project.ext {
rootConfigDir = new File(rootDir, 'config') rootConfigDir = new File(rootDir, 'config')
gitCommit = getGitCommit() gitCommit = getGitCommit()