Skip to content

Commit

Permalink
Merge pull request #550 from kotlin-orm/dev
Browse files Browse the repository at this point in the history
Release 4.0.0
  • Loading branch information
vincentlauvlwj authored May 13, 2024
2 parents fc31beb + 7d34fa6 commit f59e406
Show file tree
Hide file tree
Showing 181 changed files with 5,366 additions and 281 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: true
matrix:
java: [8, 11, 17, 19]
java: [8, 11, 17, 20]
steps:
- name: Checkout Code
uses: actions/checkout@v3
Expand Down
6 changes: 3 additions & 3 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

plugins {
id("org.gradle.kotlin.kotlin-dsl") version "2.4.1"
`kotlin-dsl`
}

repositories {
Expand All @@ -9,7 +9,7 @@ repositories {
}

dependencies {
api("org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.22")
api("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.0")
api("org.moditect:moditect-gradle-plugin:1.0.0-rc3")
api("io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.20.0")
api("io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.23.1")
}
54 changes: 54 additions & 0 deletions buildSrc/src/main/kotlin/ktorm.base.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@

group = rootProject.group
version = rootProject.version

plugins {
id("kotlin")
id("org.gradle.jacoco")
id("io.gitlab.arturbosch.detekt")
}

repositories {
mavenCentral()
}

dependencies {
api(kotlin("stdlib"))
api(kotlin("reflect"))
testImplementation(kotlin("test-junit"))
detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:${detekt.toolVersion}")
}

detekt {
source.setFrom("src/main/kotlin")
config.setFrom("${project.rootDir}/detekt.yml")
}

java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

tasks {
compileKotlin {
kotlinOptions {
jvmTarget = "1.8"
allWarningsAsErrors = true
freeCompilerArgs = listOf("-Xexplicit-api=strict")
}
}

compileTestKotlin {
kotlinOptions {
jvmTarget = "1.8"
}
}

jacocoTestReport {
reports {
csv.required.set(true)
xml.required.set(true)
html.required.set(true)
}
}
}
30 changes: 30 additions & 0 deletions buildSrc/src/main/kotlin/ktorm.modularity.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

plugins {
id("kotlin")
id("org.moditect.gradleplugin")
}

moditect {
// Generate a multi-release jar, the module descriptor will be located at META-INF/versions/9/module-info.class
addMainModuleInfo {
jvmVersion.set("9")
overwriteExistingFiles.set(true)
module {
moduleInfoFile = file("src/main/moditect/module-info.java")
}
}

// Let kotlin compiler know the module descriptor.
if (JavaVersion.current() >= JavaVersion.VERSION_1_9) {
sourceSets.main {
kotlin.srcDir("src/main/moditect")
}
}

// Workaround to avoid circular task dependencies, see https://github.com/moditect/moditect-gradle-plugin/issues/14
afterEvaluate {
val compileJava = tasks.compileJava.get()
val addDependenciesModuleInfo = tasks.addDependenciesModuleInfo.get()
compileJava.setDependsOn(compileJava.dependsOn - addDependenciesModuleInfo)
}
}
78 changes: 0 additions & 78 deletions buildSrc/src/main/kotlin/ktorm.module.gradle.kts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {

val licenseHeaderText = """
/*
* Copyright 2018-2023 the original author or authors.
* Copyright 2018-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
4 changes: 2 additions & 2 deletions buildSrc/src/main/kotlin/ktorm.tuples-codegen.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
id("kotlin")
}

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

fun generateTuple(writer: java.io.Writer, tupleNumber: Int) {
Expand Down Expand Up @@ -282,7 +282,7 @@ val generateTuples by tasks.registering {
outputFile.bufferedWriter().use { writer ->
writer.write("""
/*
* Copyright 2018-2023 the original author or authors.
* Copyright 2018-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
42 changes: 20 additions & 22 deletions detekt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ complexity:
active: true
threshold: 12
includeStaticDeclarations: false
ComplexMethod:
CyclomaticComplexMethod:
active: true
threshold: 20
ignoreSingleWhenExpression: true
ignoreSimpleWhenEntries: true
LabeledExpression:
active: true
ignoredLabels: ""
ignoredLabels: []
LargeClass:
active: true
threshold: 600
Expand All @@ -72,7 +72,7 @@ complexity:
constructorThreshold: 6
ignoreDefaultParameters: true
MethodOverloading:
active: true
active: false
threshold: 7
NestedBlockDepth:
active: true
Expand Down Expand Up @@ -131,7 +131,7 @@ exceptions:
active: true
ExceptionRaisedInUnexpectedLocation:
active: true
methodNames: 'toString,hashCode,equals,finalize'
methodNames: ['toString', 'hashCode', 'equals', 'finalize']
InstanceOfCheckForException:
active: true
NotImplementedDeclaration:
Expand All @@ -144,14 +144,14 @@ exceptions:
active: true
SwallowedException:
active: true
ignoredExceptionTypes: 'InterruptedException,NumberFormatException,ParseException,MalformedURLException'
ignoredExceptionTypes: ['InterruptedException', 'NumberFormatException', 'ParseException', 'MalformedURLException']
ThrowingExceptionFromFinally:
active: true
ThrowingExceptionInMain:
active: true
ThrowingExceptionsWithoutMessageOrCause:
active: true
exceptions: 'IllegalArgumentException,IllegalStateException,IOException'
exceptions: ['IllegalArgumentException', 'IllegalStateException', 'IOException']
ThrowingNewInstanceOfSameException:
active: true
TooGenericExceptionCaught:
Expand Down Expand Up @@ -195,7 +195,6 @@ formatting:
active: true
autoCorrect: false
indentSize: 4
continuationIndentSize: 4
MaximumLineLength:
active: false
maxLineLength: 120
Expand Down Expand Up @@ -284,7 +283,7 @@ naming:
enumEntryPattern: '^[A-Z][_a-zA-Z0-9]*'
ForbiddenClassName:
active: false
forbiddenName: ''
forbiddenName: []
FunctionMaxLength:
active: true
maximumFunctionNameLength: 64
Expand All @@ -295,12 +294,10 @@ naming:
active: true
functionPattern: '^([a-z$][a-zA-Z$0-9]*)|(`.*`)$'
excludeClassPattern: '$^'
ignoreOverridden: true
FunctionParameterNaming:
active: true
parameterPattern: '[a-z][A-Za-z0-9]*'
excludeClassPattern: '$^'
ignoreOverridden: true
MatchingDeclarationName:
active: true
MemberNameEqualsClassName:
Expand Down Expand Up @@ -330,7 +327,6 @@ naming:
variablePattern: '[a-z][A-Za-z0-9]*'
privateVariablePattern: '(_)?[a-z][A-Za-z0-9]*'
excludeClassPattern: '$^'
ignoreOverridden: true

performance:
active: true
Expand All @@ -345,8 +341,6 @@ performance:

potential-bugs:
active: true
DuplicateCaseInWhenExpression:
active: true
EqualsAlwaysReturnsTrueOrFalse:
active: true
EqualsWithHashCodeExist:
Expand Down Expand Up @@ -382,7 +376,7 @@ style:
active: true
DataClassContainsFunctions:
active: false
conversionFunctionPrefix: 'as'
conversionFunctionPrefix: ['as']
EqualsNullCall:
active: true
EqualsOnSignatureLine:
Expand All @@ -394,31 +388,33 @@ style:
includeLineWrapping: false
ForbiddenComment:
active: true
values: 'TODO:,FIXME:,STOPSHIP:'
comments: ['FIXME:', 'STOPSHIP:', 'TODO:']
ForbiddenImport:
active: false
imports: ''
imports: []
ForbiddenVoid:
active: true
FunctionOnlyReturningConstant:
active: true
ignoreOverridableFunction: true
excludedFunctions: 'describeContents'
excludedFunctions: ['describeContents']
LoopWithTooManyJumpStatements:
active: true
maxJumpCount: 2
MagicNumber:
active: true
ignoreNumbers: '-1,0,1,2,3,60'
ignoreNumbers: ['-1', '0', '1', '2', '3', '60']
ignoreHashCodeFunction: true
ignorePropertyDeclaration: false
ignoreConstantDeclaration: true
ignoreCompanionObjectPropertyDeclaration: true
ignoreAnnotation: false
ignoreNamedArgument: true
ignoreEnums: false
MandatoryBracesIfStatements:
BracesOnIfStatements:
active: true
singleLine: 'never'
multiLine: 'always'
MaxLineLength:
active: true
maxLineLength: 120
Expand All @@ -439,8 +435,10 @@ style:
active: true
OptionalUnit:
active: true
OptionalWhenBraces:
BracesOnWhenStatements:
active: false
singleLine: 'never'
multiLine: 'necessary'
PreferToOverPairSyntax:
active: false
ProtectedMemberInFinalClass:
Expand All @@ -450,7 +448,7 @@ style:
ReturnCount:
active: false
max: 2
excludedFunctions: "equals"
excludedFunctions: ["equals"]
excludeLabeled: false
excludeReturnFromLambda: true
SafeCast:
Expand Down Expand Up @@ -496,4 +494,4 @@ style:
active: true
WildcardImport:
active: false
excludeImports: 'java.util.*,kotlinx.android.synthetic.*'
excludeImports: ['java.util.*', 'kotlinx.android.synthetic.*']
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit f59e406

Please sign in to comment.