Skip to content

Commit f59e406

Browse files
Merge pull request #550 from kotlin-orm/dev
Release 4.0.0
2 parents fc31beb + 7d34fa6 commit f59e406

File tree

181 files changed

+5366
-281
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

181 files changed

+5366
-281
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
strategy:
1515
fail-fast: true
1616
matrix:
17-
java: [8, 11, 17, 19]
17+
java: [8, 11, 17, 20]
1818
steps:
1919
- name: Checkout Code
2020
uses: actions/checkout@v3

buildSrc/build.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
plugins {
3-
id("org.gradle.kotlin.kotlin-dsl") version "2.4.1"
3+
`kotlin-dsl`
44
}
55

66
repositories {
@@ -9,7 +9,7 @@ repositories {
99
}
1010

1111
dependencies {
12-
api("org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.22")
12+
api("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.0")
1313
api("org.moditect:moditect-gradle-plugin:1.0.0-rc3")
14-
api("io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.20.0")
14+
api("io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.23.1")
1515
}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
2+
group = rootProject.group
3+
version = rootProject.version
4+
5+
plugins {
6+
id("kotlin")
7+
id("org.gradle.jacoco")
8+
id("io.gitlab.arturbosch.detekt")
9+
}
10+
11+
repositories {
12+
mavenCentral()
13+
}
14+
15+
dependencies {
16+
api(kotlin("stdlib"))
17+
api(kotlin("reflect"))
18+
testImplementation(kotlin("test-junit"))
19+
detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:${detekt.toolVersion}")
20+
}
21+
22+
detekt {
23+
source.setFrom("src/main/kotlin")
24+
config.setFrom("${project.rootDir}/detekt.yml")
25+
}
26+
27+
java {
28+
sourceCompatibility = JavaVersion.VERSION_1_8
29+
targetCompatibility = JavaVersion.VERSION_1_8
30+
}
31+
32+
tasks {
33+
compileKotlin {
34+
kotlinOptions {
35+
jvmTarget = "1.8"
36+
allWarningsAsErrors = true
37+
freeCompilerArgs = listOf("-Xexplicit-api=strict")
38+
}
39+
}
40+
41+
compileTestKotlin {
42+
kotlinOptions {
43+
jvmTarget = "1.8"
44+
}
45+
}
46+
47+
jacocoTestReport {
48+
reports {
49+
csv.required.set(true)
50+
xml.required.set(true)
51+
html.required.set(true)
52+
}
53+
}
54+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
2+
plugins {
3+
id("kotlin")
4+
id("org.moditect.gradleplugin")
5+
}
6+
7+
moditect {
8+
// Generate a multi-release jar, the module descriptor will be located at META-INF/versions/9/module-info.class
9+
addMainModuleInfo {
10+
jvmVersion.set("9")
11+
overwriteExistingFiles.set(true)
12+
module {
13+
moduleInfoFile = file("src/main/moditect/module-info.java")
14+
}
15+
}
16+
17+
// Let kotlin compiler know the module descriptor.
18+
if (JavaVersion.current() >= JavaVersion.VERSION_1_9) {
19+
sourceSets.main {
20+
kotlin.srcDir("src/main/moditect")
21+
}
22+
}
23+
24+
// Workaround to avoid circular task dependencies, see https://github.com/moditect/moditect-gradle-plugin/issues/14
25+
afterEvaluate {
26+
val compileJava = tasks.compileJava.get()
27+
val addDependenciesModuleInfo = tasks.addDependenciesModuleInfo.get()
28+
compileJava.setDependsOn(compileJava.dependsOn - addDependenciesModuleInfo)
29+
}
30+
}

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

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

buildSrc/src/main/kotlin/ktorm.source-header-check.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ plugins {
55

66
val licenseHeaderText = """
77
/*
8-
* Copyright 2018-2023 the original author or authors.
8+
* Copyright 2018-2024 the original author or authors.
99
*
1010
* Licensed under the Apache License, Version 2.0 (the "License");
1111
* you may not use this file except in compliance with the License.

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ plugins {
33
id("kotlin")
44
}
55

6-
val generatedSourceDir = "${project.buildDir.absolutePath}/generated/source/main/kotlin"
6+
val generatedSourceDir = "${project.layout.buildDirectory.asFile.get()}/generated/source/main/kotlin"
77
val maxTupleNumber = 9
88

99
fun generateTuple(writer: java.io.Writer, tupleNumber: Int) {
@@ -282,7 +282,7 @@ val generateTuples by tasks.registering {
282282
outputFile.bufferedWriter().use { writer ->
283283
writer.write("""
284284
/*
285-
* Copyright 2018-2023 the original author or authors.
285+
* Copyright 2018-2024 the original author or authors.
286286
*
287287
* Licensed under the Apache License, Version 2.0 (the "License");
288288
* you may not use this file except in compliance with the License.

detekt.yml

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,14 @@ complexity:
5252
active: true
5353
threshold: 12
5454
includeStaticDeclarations: false
55-
ComplexMethod:
55+
CyclomaticComplexMethod:
5656
active: true
5757
threshold: 20
5858
ignoreSingleWhenExpression: true
5959
ignoreSimpleWhenEntries: true
6060
LabeledExpression:
6161
active: true
62-
ignoredLabels: ""
62+
ignoredLabels: []
6363
LargeClass:
6464
active: true
6565
threshold: 600
@@ -72,7 +72,7 @@ complexity:
7272
constructorThreshold: 6
7373
ignoreDefaultParameters: true
7474
MethodOverloading:
75-
active: true
75+
active: false
7676
threshold: 7
7777
NestedBlockDepth:
7878
active: true
@@ -131,7 +131,7 @@ exceptions:
131131
active: true
132132
ExceptionRaisedInUnexpectedLocation:
133133
active: true
134-
methodNames: 'toString,hashCode,equals,finalize'
134+
methodNames: ['toString', 'hashCode', 'equals', 'finalize']
135135
InstanceOfCheckForException:
136136
active: true
137137
NotImplementedDeclaration:
@@ -144,14 +144,14 @@ exceptions:
144144
active: true
145145
SwallowedException:
146146
active: true
147-
ignoredExceptionTypes: 'InterruptedException,NumberFormatException,ParseException,MalformedURLException'
147+
ignoredExceptionTypes: ['InterruptedException', 'NumberFormatException', 'ParseException', 'MalformedURLException']
148148
ThrowingExceptionFromFinally:
149149
active: true
150150
ThrowingExceptionInMain:
151151
active: true
152152
ThrowingExceptionsWithoutMessageOrCause:
153153
active: true
154-
exceptions: 'IllegalArgumentException,IllegalStateException,IOException'
154+
exceptions: ['IllegalArgumentException', 'IllegalStateException', 'IOException']
155155
ThrowingNewInstanceOfSameException:
156156
active: true
157157
TooGenericExceptionCaught:
@@ -195,7 +195,6 @@ formatting:
195195
active: true
196196
autoCorrect: false
197197
indentSize: 4
198-
continuationIndentSize: 4
199198
MaximumLineLength:
200199
active: false
201200
maxLineLength: 120
@@ -284,7 +283,7 @@ naming:
284283
enumEntryPattern: '^[A-Z][_a-zA-Z0-9]*'
285284
ForbiddenClassName:
286285
active: false
287-
forbiddenName: ''
286+
forbiddenName: []
288287
FunctionMaxLength:
289288
active: true
290289
maximumFunctionNameLength: 64
@@ -295,12 +294,10 @@ naming:
295294
active: true
296295
functionPattern: '^([a-z$][a-zA-Z$0-9]*)|(`.*`)$'
297296
excludeClassPattern: '$^'
298-
ignoreOverridden: true
299297
FunctionParameterNaming:
300298
active: true
301299
parameterPattern: '[a-z][A-Za-z0-9]*'
302300
excludeClassPattern: '$^'
303-
ignoreOverridden: true
304301
MatchingDeclarationName:
305302
active: true
306303
MemberNameEqualsClassName:
@@ -330,7 +327,6 @@ naming:
330327
variablePattern: '[a-z][A-Za-z0-9]*'
331328
privateVariablePattern: '(_)?[a-z][A-Za-z0-9]*'
332329
excludeClassPattern: '$^'
333-
ignoreOverridden: true
334330

335331
performance:
336332
active: true
@@ -345,8 +341,6 @@ performance:
345341

346342
potential-bugs:
347343
active: true
348-
DuplicateCaseInWhenExpression:
349-
active: true
350344
EqualsAlwaysReturnsTrueOrFalse:
351345
active: true
352346
EqualsWithHashCodeExist:
@@ -382,7 +376,7 @@ style:
382376
active: true
383377
DataClassContainsFunctions:
384378
active: false
385-
conversionFunctionPrefix: 'as'
379+
conversionFunctionPrefix: ['as']
386380
EqualsNullCall:
387381
active: true
388382
EqualsOnSignatureLine:
@@ -394,31 +388,33 @@ style:
394388
includeLineWrapping: false
395389
ForbiddenComment:
396390
active: true
397-
values: 'TODO:,FIXME:,STOPSHIP:'
391+
comments: ['FIXME:', 'STOPSHIP:', 'TODO:']
398392
ForbiddenImport:
399393
active: false
400-
imports: ''
394+
imports: []
401395
ForbiddenVoid:
402396
active: true
403397
FunctionOnlyReturningConstant:
404398
active: true
405399
ignoreOverridableFunction: true
406-
excludedFunctions: 'describeContents'
400+
excludedFunctions: ['describeContents']
407401
LoopWithTooManyJumpStatements:
408402
active: true
409403
maxJumpCount: 2
410404
MagicNumber:
411405
active: true
412-
ignoreNumbers: '-1,0,1,2,3,60'
406+
ignoreNumbers: ['-1', '0', '1', '2', '3', '60']
413407
ignoreHashCodeFunction: true
414408
ignorePropertyDeclaration: false
415409
ignoreConstantDeclaration: true
416410
ignoreCompanionObjectPropertyDeclaration: true
417411
ignoreAnnotation: false
418412
ignoreNamedArgument: true
419413
ignoreEnums: false
420-
MandatoryBracesIfStatements:
414+
BracesOnIfStatements:
421415
active: true
416+
singleLine: 'never'
417+
multiLine: 'always'
422418
MaxLineLength:
423419
active: true
424420
maxLineLength: 120
@@ -439,8 +435,10 @@ style:
439435
active: true
440436
OptionalUnit:
441437
active: true
442-
OptionalWhenBraces:
438+
BracesOnWhenStatements:
443439
active: false
440+
singleLine: 'never'
441+
multiLine: 'necessary'
444442
PreferToOverPairSyntax:
445443
active: false
446444
ProtectedMemberInFinalClass:
@@ -450,7 +448,7 @@ style:
450448
ReturnCount:
451449
active: false
452450
max: 2
453-
excludedFunctions: "equals"
451+
excludedFunctions: ["equals"]
454452
excludeLabeled: false
455453
excludeReturnFromLambda: true
456454
SafeCast:
@@ -496,4 +494,4 @@ style:
496494
active: true
497495
WildcardImport:
498496
active: false
499-
excludeImports: 'java.util.*,kotlinx.android.synthetic.*'
497+
excludeImports: ['java.util.*', 'kotlinx.android.synthetic.*']
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)