|
| 1 | +import buildsrc.config.excludeGeneratedGradleDsl |
| 2 | + |
| 3 | +plugins { |
| 4 | + base |
| 5 | + id("me.qoomon.git-versioning") version "5.1.2" |
| 6 | + idea |
| 7 | + buildsrc.convention.`kotlin-jvm` |
| 8 | + kotlin("plugin.serialization") |
| 9 | + id("org.jetbrains.kotlinx.knit") |
| 10 | +} |
| 11 | + |
| 12 | + |
| 13 | +project.group = "dev.adamko" |
| 14 | +project.version = "0.0.0-SNAPSHOT" |
| 15 | +gitVersioning.apply { |
| 16 | + refs { |
| 17 | + branch(".+") { version = "\${ref}-SNAPSHOT" } |
| 18 | + tag("v(?<version>.*)") { version = "\${ref.version}" } |
| 19 | + } |
| 20 | + |
| 21 | + // optional fallback configuration in case of no matching ref configuration |
| 22 | + rev { version = "\${commit}" } |
| 23 | +} |
| 24 | + |
| 25 | + |
| 26 | +tasks.wrapper { |
| 27 | + gradleVersion = "7.4" |
| 28 | + distributionType = Wrapper.DistributionType.ALL |
| 29 | +} |
| 30 | + |
| 31 | +idea { |
| 32 | + module { |
| 33 | + isDownloadSources = true |
| 34 | + isDownloadJavadoc = true |
| 35 | + excludeGeneratedGradleDsl(layout) |
| 36 | + excludeDirs = excludeDirs + layout.files( |
| 37 | + ".idea", |
| 38 | + "gradle/kotlin-js-store", |
| 39 | + "gradle/wrapper", |
| 40 | + ) |
| 41 | + } |
| 42 | +} |
| 43 | + |
| 44 | + |
| 45 | +val kotlinxSerializationVersion = "1.3.2" |
| 46 | + |
| 47 | +dependencies { |
| 48 | + implementation(projects.modules.kxsTsGenCore) |
| 49 | + |
| 50 | + implementation(platform("org.jetbrains.kotlinx:kotlinx-serialization-bom:${kotlinxSerializationVersion}")) |
| 51 | + implementation("org.jetbrains.kotlinx:kotlinx-serialization-core") |
| 52 | + implementation("org.jetbrains.kotlinx:kotlinx-serialization-json") |
| 53 | + |
| 54 | + testImplementation(kotlin("test")) |
| 55 | + |
| 56 | + testImplementation("org.jetbrains.kotlinx:kotlinx-knit-test:0.3.0") |
| 57 | +} |
| 58 | + |
| 59 | +tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> { |
| 60 | + kotlinOptions.freeCompilerArgs += listOf( |
| 61 | + "-opt-in=kotlinx.serialization.ExperimentalSerializationApi", |
| 62 | + ) |
| 63 | +} |
| 64 | + |
| 65 | +sourceSets.test { |
| 66 | + java.srcDirs("docs/example", "docs/test") |
| 67 | +} |
| 68 | + |
| 69 | +//knit { |
| 70 | +// rootDir = layout.projectDirectory.asFile |
| 71 | +// files = rootProject.fileTree("docs") |
| 72 | +//} |
| 73 | + |
| 74 | +tasks.test { |
| 75 | + dependsOn(tasks.knit) |
| 76 | +} |
| 77 | + |
| 78 | +tasks.compileKotlin { mustRunAfter(tasks.knit) } |
0 commit comments