Skip to content

Commit a1c008d

Browse files
Merge pull request #576 from kotlin-orm/dev
Release 4.1.1
2 parents f258717 + a028e14 commit a1c008d

File tree

18 files changed

+86
-88
lines changed

18 files changed

+86
-88
lines changed

PACKAGES.md

Lines changed: 0 additions & 52 deletions
This file was deleted.

build.gradle.kts

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,11 @@
22
group = "org.ktorm"
33
version = file("ktorm.version").readLines()[0]
44

5-
task("printClasspath") {
6-
doLast {
7-
val jars = subprojects
8-
.map { it.configurations["compileClasspath"] }
9-
.flatMap { it.files }
10-
.filterNotTo(HashSet()) { it.name.contains("ktorm") }
11-
.onEach { println(it.name) }
5+
plugins {
6+
id("ktorm.dokka")
7+
}
128

13-
val file = file("build/ktorm.classpath")
14-
file.parentFile.mkdirs()
15-
file.writeText(jars.joinToString(File.pathSeparator) { it.absolutePath })
16-
println("Classpath written to build/ktorm.classpath")
17-
}
9+
repositories {
10+
mavenCentral()
11+
gradlePluginPortal()
1812
}

buildSrc/build.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ repositories {
1010

1111
dependencies {
1212
api("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.23")
13+
api("org.jetbrains.dokka:dokka-gradle-plugin:1.9.20")
14+
api("org.jetbrains.dokka:dokka-base:1.9.20")
1315
api("org.moditect:moditect:1.0.0.RC1")
1416
api("io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.23.6")
1517
}

buildSrc/src/main/kotlin/ktorm.base.gradle.kts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,12 @@ java {
3030
}
3131

3232
tasks {
33+
// Lifecycle task for code generation.
34+
val codegen by registering { /* do nothing */ }
35+
3336
compileKotlin {
37+
dependsOn(codegen)
38+
3439
kotlinOptions {
3540
jvmTarget = "1.8"
3641
allWarningsAsErrors = true
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
2+
plugins {
3+
id("org.jetbrains.dokka")
4+
}
5+
6+
tasks.named<org.jetbrains.dokka.gradle.DokkaMultiModuleTask>("dokkaHtmlMultiModule") {
7+
val tmplDir = System.getProperty("dokka.templatesDir")
8+
if (!tmplDir.isNullOrEmpty()) {
9+
pluginConfiguration<org.jetbrains.dokka.base.DokkaBase, org.jetbrains.dokka.base.DokkaBaseConfiguration> {
10+
templatesDir = File(tmplDir)
11+
}
12+
}
13+
}
14+
15+
subprojects {
16+
apply(plugin = "org.jetbrains.dokka")
17+
18+
tasks.dokkaJavadoc {
19+
dependsOn("codegen")
20+
21+
dokkaSourceSets.named("main") {
22+
suppressGeneratedFiles.set(false)
23+
}
24+
}
25+
26+
tasks.named<org.jetbrains.dokka.gradle.DokkaTaskPartial>("dokkaHtmlPartial") {
27+
dependsOn("codegen")
28+
29+
val tmplDir = System.getProperty("dokka.templatesDir")
30+
if (!tmplDir.isNullOrEmpty()) {
31+
pluginConfiguration<org.jetbrains.dokka.base.DokkaBase, org.jetbrains.dokka.base.DokkaBaseConfiguration> {
32+
templatesDir = File(tmplDir)
33+
}
34+
}
35+
36+
dokkaSourceSets.named("main") {
37+
suppressGeneratedFiles.set(false)
38+
sourceLink {
39+
localDirectory.set(file("src/main/kotlin"))
40+
remoteUrl.set(java.net.URL("https://github.com/kotlin-orm/ktorm/blob/master/${project.name}/src/main/kotlin"))
41+
remoteLineSuffix.set("#L")
42+
}
43+
}
44+
}
45+
}

buildSrc/src/main/kotlin/ktorm.publish.gradle.kts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,18 @@ plugins {
33
id("kotlin")
44
id("signing")
55
id("maven-publish")
6+
id("org.jetbrains.dokka")
67
}
78

89
val jarSources by tasks.registering(Jar::class) {
9-
archiveClassifier.set("sources")
10+
dependsOn("codegen")
1011
from(sourceSets.main.map { it.allSource })
12+
archiveClassifier.set("sources")
1113
}
1214

1315
val jarJavadoc by tasks.registering(Jar::class) {
16+
dependsOn(tasks.dokkaJavadoc)
17+
from(tasks.dokkaJavadoc.flatMap { it.outputDirectory })
1418
archiveClassifier.set("javadoc")
1519
}
1620

buildSrc/src/main/kotlin/ktorm.tuples-codegen.gradle.kts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -348,10 +348,7 @@ val generateTuples by tasks.registering {
348348
}
349349

350350
tasks {
351-
compileKotlin {
352-
dependsOn(generateTuples)
353-
}
354-
"jarSources" {
351+
"codegen" {
355352
dependsOn(generateTuples)
356353
}
357354
}

detekt.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ style:
402402
active: true
403403
maxJumpCount: 2
404404
MagicNumber:
405-
active: true
405+
active: false
406406
ignoreNumbers: ['-1', '0', '1', '2', '3', '60']
407407
ignoreHashCodeFunction: true
408408
ignorePropertyDeclaration: false

ktorm-core/src/main/kotlin/org/ktorm/schema/SqlTypes.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,6 @@ public fun BaseTable<*>.yearMonth(name: String): Column<YearMonth> {
450450
/**
451451
* [SqlType] implementation used to save [YearMonth] instances, formatting them to strings with pattern `yyyy-MM`.
452452
*/
453-
@Suppress("MagicNumber")
454453
public object YearMonthSqlType : SqlType<YearMonth>(Types.VARCHAR, "varchar") {
455454
private val formatter = DateTimeFormatterBuilder()
456455
.appendValue(ChronoField.YEAR, 4, 10, SignStyle.EXCEEDS_PAD)

ktorm-jackson/ktorm-jackson.gradle.kts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,7 @@ val generatePackageVersion by tasks.registering(Copy::class) {
2323
}
2424

2525
tasks {
26-
compileKotlin {
27-
dependsOn(generatePackageVersion)
28-
}
29-
"jarSources" {
26+
codegen {
3027
dependsOn(generatePackageVersion)
3128
}
3229
}

0 commit comments

Comments
 (0)