mirror of
https://github.com/fankes/moshi.git
synced 2025-10-19 16:09:21 +08:00
Modernize build a bit (#1383)
This commit is contained in:
@@ -22,14 +22,15 @@ plugins {
|
||||
kotlin("jvm")
|
||||
kotlin("kapt")
|
||||
id("com.vanniktech.maven.publish")
|
||||
id("com.github.johnrengelman.shadow") version "7.0.0"
|
||||
alias(libs.plugins.mavenShadow)
|
||||
}
|
||||
|
||||
tasks.withType<KotlinCompile>().configureEach {
|
||||
kotlinOptions {
|
||||
@Suppress("SuspiciousCollectionReassignment")
|
||||
freeCompilerArgs += listOf(
|
||||
"-Xopt-in=com.squareup.kotlinpoet.metadata.KotlinPoetMetadataPreview"
|
||||
"-Xopt-in=kotlin.RequiresOptIn",
|
||||
"-Xopt-in=com.squareup.kotlinpoet.metadata.KotlinPoetMetadataPreview",
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -57,38 +58,38 @@ dependencies {
|
||||
// https://youtrack.jetbrains.com/issue/KT-41702
|
||||
api(project(":moshi"))
|
||||
api(kotlin("reflect"))
|
||||
shade(Dependencies.Kotlin.metadata) {
|
||||
shade(libs.kotlinxMetadata) {
|
||||
exclude(group = "org.jetbrains.kotlin", module = "kotlin-stdlib")
|
||||
}
|
||||
api(Dependencies.KotlinPoet.kotlinPoet)
|
||||
shade(Dependencies.KotlinPoet.metadata) {
|
||||
api(libs.kotlinpoet)
|
||||
shade(libs.kotlinpoet.metadata.core) {
|
||||
exclude(group = "org.jetbrains.kotlin")
|
||||
exclude(group = "com.squareup", module = "kotlinpoet")
|
||||
}
|
||||
shade(Dependencies.KotlinPoet.metadataSpecs) {
|
||||
shade(libs.kotlinpoet.metadata.specs) {
|
||||
exclude(group = "org.jetbrains.kotlin")
|
||||
exclude(group = "com.squareup", module = "kotlinpoet")
|
||||
}
|
||||
api(Dependencies.KotlinPoet.elementsClassInspector)
|
||||
shade(Dependencies.KotlinPoet.elementsClassInspector) {
|
||||
api(libs.kotlinpoet.elementsClassInspector)
|
||||
shade(libs.kotlinpoet.elementsClassInspector) {
|
||||
exclude(group = "org.jetbrains.kotlin")
|
||||
exclude(group = "com.squareup", module = "kotlinpoet")
|
||||
exclude(group = "com.google.guava")
|
||||
}
|
||||
api(Dependencies.asm)
|
||||
api(libs.asm)
|
||||
|
||||
api(Dependencies.AutoService.annotations)
|
||||
kapt(Dependencies.AutoService.processor)
|
||||
api(Dependencies.Incap.annotations)
|
||||
kapt(Dependencies.Incap.processor)
|
||||
api(libs.autoService)
|
||||
kapt(libs.autoService.processor)
|
||||
api(libs.incap)
|
||||
kapt(libs.incap.processor)
|
||||
|
||||
// Copy these again as they're not automatically included since they're shaded
|
||||
testImplementation(Dependencies.KotlinPoet.metadata)
|
||||
testImplementation(Dependencies.KotlinPoet.metadataSpecs)
|
||||
testImplementation(Dependencies.KotlinPoet.elementsClassInspector)
|
||||
testImplementation(Dependencies.Testing.junit)
|
||||
testImplementation(Dependencies.Testing.truth)
|
||||
testImplementation(Dependencies.Testing.compileTesting)
|
||||
testImplementation(libs.kotlinpoet.metadata.core)
|
||||
testImplementation(libs.kotlinpoet.metadata.specs)
|
||||
testImplementation(libs.kotlinpoet.elementsClassInspector)
|
||||
testImplementation(libs.junit)
|
||||
testImplementation(libs.truth)
|
||||
testImplementation(libs.kotlinCompileTesting)
|
||||
}
|
||||
|
||||
val relocateShadowJar = tasks.register<ConfigureShadowRelocation>("relocateShadowJar") {
|
||||
|
Reference in New Issue
Block a user