diff --git a/.github/workflows/android_pre_hook.yml b/.github/workflows/android_pre_hook.yml index 2afa101d..60d9fd09 100644 --- a/.github/workflows/android_pre_hook.yml +++ b/.github/workflows/android_pre_hook.yml @@ -13,10 +13,10 @@ jobs: steps: - uses: actions/checkout@v2 - - name: set up JDK 11 + - name: set up JDK 17 uses: actions/setup-java@v2 with: - java-version: '11' + java-version: '17' distribution: 'adopt' cache: gradle diff --git a/build.gradle b/build.gradle index 4d0643cf..7e714638 100755 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,8 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.kotlin_version = '1.7.10' + ext.kotlin_version = '1.9.21' + ext.groupName = 'com.github.SchwarzIT' repositories { google() mavenCentral() @@ -10,10 +11,9 @@ buildscript { } } dependencies { - classpath 'com.android.tools.build:gradle:4.2.2' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath "org.jlleitschuh.gradle:ktlint-gradle:10.2.0" - classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' + classpath 'com.android.tools.build:gradle:8.0.1' + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.21" + classpath "org.jlleitschuh.gradle:ktlint-gradle:11.5.1" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } @@ -21,6 +21,7 @@ buildscript { subprojects { apply plugin: "org.jlleitschuh.gradle.ktlint" + apply plugin: 'maven-publish' repositories { mavenCentral() @@ -38,9 +39,24 @@ subprojects { "no-wildcard-imports" ] } + +} + +def versionName() { + + if (!hasProperty("version")) { + // don't care + return "dummy" + } + + return property("version") } + allprojects { + version = versionName() + group = groupName + repositories { google() mavenCentral() diff --git a/crystal-map-api/build.gradle b/crystal-map-api/build.gradle index 9020d542..1b0dff43 100644 --- a/crystal-map-api/build.gradle +++ b/crystal-map-api/build.gradle @@ -1,5 +1,6 @@ apply plugin: 'kotlin' -apply plugin: 'maven' +apply plugin: 'maven-publish' +apply plugin: 'java' dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) @@ -8,39 +9,21 @@ dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" } -task sourcesJar(type: Jar, dependsOn: classes) { - classifier = 'sources' - from sourceSets.main.allSource -} +sourceCompatibility = JavaVersion.VERSION_17 +targetCompatibility = JavaVersion.VERSION_17 -task javadocJar(type: Jar, dependsOn: javadoc) { - classifier = 'javadoc' - from javadoc.destinationDir +java { + withSourcesJar() + withJavadocJar() } -artifacts { - archives sourcesJar - archives javadocJar -} -buildscript { - ext.kotlin_version = '1.7.0' - repositories { - mavenCentral() - } - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" +publishing { + publications { + maven(MavenPublication) { + groupId project.group + artifactId project.name + version project.version + from components.java + } } -} -repositories { - mavenCentral() -} -compileKotlin { - kotlinOptions { - jvmTarget = "1.8" - } -} -compileTestKotlin { - kotlinOptions { - jvmTarget = "1.8" - } -} +} \ No newline at end of file diff --git a/crystal-map-api/src/main/java/com/schwarz/crystalapi/schema/DefaultSchemaValidator.kt b/crystal-map-api/src/main/java/com/schwarz/crystalapi/schema/DefaultSchemaValidator.kt index 58a686e2..90700766 100644 --- a/crystal-map-api/src/main/java/com/schwarz/crystalapi/schema/DefaultSchemaValidator.kt +++ b/crystal-map-api/src/main/java/com/schwarz/crystalapi/schema/DefaultSchemaValidator.kt @@ -16,9 +16,7 @@ open class DefaultSchemaValidator : SchemaValidator { } protected open fun validateModelLevel(current: EntitySchema?, released: EntitySchema, logger: SchemaValidationLogger): Boolean { - current?.let { - released.docId?.let { if (current.docId?.scheme != it.scheme) { logger.error(released, "forbidden DocId Schema change") diff --git a/crystal-map-api/src/main/java/com/schwarz/crystalapi/util/CrystalWrap.kt b/crystal-map-api/src/main/java/com/schwarz/crystalapi/util/CrystalWrap.kt index 0cee6d54..05617ad4 100644 --- a/crystal-map-api/src/main/java/com/schwarz/crystalapi/util/CrystalWrap.kt +++ b/crystal-map-api/src/main/java/com/schwarz/crystalapi/util/CrystalWrap.kt @@ -97,7 +97,9 @@ object CrystalWrap { PersistenceConfig.onTypeConversionError( com.schwarz.crystalapi.TypeConversionErrorWrapper( ex, - fieldName, value, clazz + fieldName, + value, + clazz ) ) null @@ -117,7 +119,9 @@ object CrystalWrap { PersistenceConfig.onTypeConversionError( com.schwarz.crystalapi.TypeConversionErrorWrapper( ex, - fieldName, value, clazz + fieldName, + value, + clazz ) ) null diff --git a/crystal-map-api/src/main/java/com/schwarz/crystalapi/util/MapifyUtil.kt b/crystal-map-api/src/main/java/com/schwarz/crystalapi/util/SerializableMapifyable.kt similarity index 83% rename from crystal-map-api/src/main/java/com/schwarz/crystalapi/util/MapifyUtil.kt rename to crystal-map-api/src/main/java/com/schwarz/crystalapi/util/SerializableMapifyable.kt index ffebed56..596bfc70 100644 --- a/crystal-map-api/src/main/java/com/schwarz/crystalapi/util/MapifyUtil.kt +++ b/crystal-map-api/src/main/java/com/schwarz/crystalapi/util/SerializableMapifyable.kt @@ -2,8 +2,11 @@ package com.schwarz.crystalapi.util import com.schwarz.crystalapi.mapify.IMapifyable import org.apache.commons.codec.binary.Base64 -import java.io.* -import java.util.* +import java.io.ByteArrayInputStream +import java.io.ByteArrayOutputStream +import java.io.ObjectInputStream +import java.io.ObjectOutputStream +import java.io.Serializable class SerializableMapifyable : IMapifyable { override fun fromMap(map: Map): T? = (map.get("serial") as? String)?.let { serializableFromMapValue(it) } diff --git a/crystal-map-couchbase-connector/build.gradle b/crystal-map-couchbase-connector/build.gradle index beda5f62..27cf058f 100644 --- a/crystal-map-couchbase-connector/build.gradle +++ b/crystal-map-couchbase-connector/build.gradle @@ -1,13 +1,14 @@ apply plugin: 'com.android.library' -apply plugin: 'com.github.dcendents.android-maven' +apply plugin: 'maven-publish' apply plugin: 'kotlin-android' android { - compileSdkVersion 33 + namespace "com.schwarz.crystalcouchbaseconnector" defaultConfig { minSdkVersion 21 targetSdkVersion 33 + compileSdk = 33 versionCode 1 versionName "1.0" @@ -22,36 +23,24 @@ android { } } compileOptions { - sourceCompatibility = 1.8 - targetCompatibility = 1.8 + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 } } -group = 'com.github.SchwarzIT' -task sourcesJar(type: Jar) { - classifier = 'sources' - from android.sourceSets.main.java.sourceFiles -} - -task javadoc(type: Javadoc) { - source = android.sourceSets.main.java.sourceFiles - classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) -} - -task javadocJar(type: Jar, dependsOn: javadoc) { - classifier = 'javadoc' - from javadoc.destinationDir -} -task classesJar(type: Jar) { - from "$buildDir/intermediates/classes/release" -} - -artifacts { - archives classesJar - archives javadocJar - archives sourcesJar +afterEvaluate { + publishing { + publications { + maven(MavenPublication) { + groupId groupName + artifactId project.name + version project.version + from components.release + } + } + } } dependencies { diff --git a/crystal-map-couchbase-connector/src/main/java/com/schwarz/crystalcouchbaseconnector/Couchbase2Connector.kt b/crystal-map-couchbase-connector/src/main/java/com/schwarz/crystalcouchbaseconnector/Couchbase2Connector.kt index 0cbc6d2f..6f884f4d 100644 --- a/crystal-map-couchbase-connector/src/main/java/com/schwarz/crystalcouchbaseconnector/Couchbase2Connector.kt +++ b/crystal-map-couchbase-connector/src/main/java/com/schwarz/crystalcouchbaseconnector/Couchbase2Connector.kt @@ -99,7 +99,6 @@ abstract class Couchbase2Connector : PersistenceConfig.Connector { onlyInclude: List? ): List> { try { - val builder = QueryBuilder.select(SelectResult.expression(Meta.id), SelectResult.all()) .from(DataSource.database(getDatabase(dbName))) @@ -131,11 +130,9 @@ abstract class Couchbase2Connector : PersistenceConfig.Connector { } private fun parseExpressions(queryParams: Map): Expression? { - var result: Expression? = null for (queryParam in queryParams) { - val equalTo = Expression.property(queryParam.key).equalTo( Expression.value(queryParam.value) ) diff --git a/crystal-map-processor/build.gradle b/crystal-map-processor/build.gradle index 71a339c3..dc59d0bf 100644 --- a/crystal-map-processor/build.gradle +++ b/crystal-map-processor/build.gradle @@ -1,8 +1,9 @@ apply plugin: 'kotlin' -apply plugin: 'maven' +apply plugin: 'maven-publish' apply plugin: 'jacoco' apply plugin: 'pmd' apply plugin: 'kotlin-kapt' +apply plugin: 'java' dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) @@ -12,9 +13,9 @@ dependencies { implementation 'org.apache.commons:commons-lang3:3.4' implementation "com.fasterxml.jackson.module:jackson-module-kotlin:2.13.3" implementation 'com.j2html:j2html:1.4.0' - testImplementation 'com.google.testing.compile:compile-testing:0.19' + testImplementation 'com.google.testing.compile:compile-testing:0.21.0' testImplementation 'junit:junit:4.12' - testImplementation 'com.github.tschuchortdev:kotlin-compile-testing:1.4.9' + testImplementation 'dev.zacsweers.kctfork:core:0.4.0' testImplementation 'org.mockito:mockito-core:1.10.19' testImplementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.0' implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" @@ -23,17 +24,40 @@ dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" } -targetCompatibility = '1.8' -sourceCompatibility = '1.8' +targetCompatibility = JavaVersion.VERSION_17 +sourceCompatibility = JavaVersion.VERSION_17 -task sourcesJar(type: Jar, dependsOn: classes) { - classifier = 'sources' - from sourceSets.main.allSource +java { + withSourcesJar() + withJavadocJar() } -task javadocJar(type: Jar, dependsOn: javadoc) { - classifier = 'javadoc' - from javadoc.destinationDir +if (JavaVersion.current() >= JavaVersion.VERSION_16) { + test { + jvmArgs( + "--add-opens=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED", + "--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED", + "--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED", + "--add-opens=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED", + "--add-opens=jdk.compiler/com.sun.tools.javac.jvm=ALL-UNNAMED", + "--add-opens=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED", + "--add-opens=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED", + "--add-opens=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED", + "--add-opens=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED", + "--add-opens=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED", + ) + } +} + +publishing { + publications { + maven(MavenPublication) { + groupId project.group + artifactId project.name + version project.version + from components.java + } + } } jacoco { @@ -46,24 +70,12 @@ jacocoTestReport { reports { - xml.enabled = true - html.enabled = false - } -} - -artifacts { - archives sourcesJar - archives javadocJar -} - -compileKotlin { - kotlinOptions { - jvmTarget = "1.8" - } -} -compileTestKotlin { - kotlinOptions { - jvmTarget = "1.8" + xml{ + enabled true + } + html{ + enabled false + } } } diff --git a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/CoachBaseBinderProcessor.kt b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/CoachBaseBinderProcessor.kt index c6961fec..2e707cb4 100644 --- a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/CoachBaseBinderProcessor.kt +++ b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/CoachBaseBinderProcessor.kt @@ -19,7 +19,7 @@ import javax.annotation.processing.* import javax.lang.model.SourceVersion import javax.lang.model.element.TypeElement -@SupportedSourceVersion(SourceVersion.RELEASE_8) +@SupportedSourceVersion(SourceVersion.RELEASE_17) @AutoService(Processor::class) @SupportedOptions(KAPT_KOTLIN_GENERATED_OPTION_NAME, FRAMEWORK_USE_SUSPEND_OPTION_NAME, FRAMEWORK_DOCUMENTATION_PATH_OPTION_NAME, FRAMEWORK_DOCUMENTATION_FILENAME_OPTION_NAME, FRAMEWORK_SCHEMA_PATH_OPTION_NAME, FRAMEWORK_SCHEMA_FILENAME_OPTION_NAME) class CoachBaseBinderProcessor : AbstractProcessor() { diff --git a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/Extension.kt b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/Extension.kt index 05152c2f..17c95102 100644 --- a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/Extension.kt +++ b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/Extension.kt @@ -14,6 +14,9 @@ fun TypeName.javaToKotlinType(): TypeName = if (this is ParameterizedTypeName) { } else { val className = JavaToKotlinClassMap.INSTANCE .mapJavaToKotlin(FqName(toString()))?.asSingleFqName()?.asString() - if (className == null) this - else ClassName.bestGuess(className) + if (className == null) { + this + } else { + ClassName.bestGuess(className) + } } diff --git a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/ProcessingContext.kt b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/ProcessingContext.kt index ed5785ae..95809bda 100644 --- a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/ProcessingContext.kt +++ b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/ProcessingContext.kt @@ -56,7 +56,9 @@ object ProcessingContext { fun asFullTypeName(): TypeName? = asTypeName()?.let { if (it is ClassName && typeParams.isNotEmpty()) { it.parameterizedBy(typeParams.mapNotNull { if (it.isTypeVar()) TypeVariableName(it.name) else it.asFullTypeName() }) - } else it + } else { + it + } } fun hasEmptyConstructor() = (typeMirror as? Type.ClassType?)?.let { diff --git a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/documentation/DocumentationGenerator.kt b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/documentation/DocumentationGenerator.kt index 103e2ca3..078606a8 100644 --- a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/documentation/DocumentationGenerator.kt +++ b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/documentation/DocumentationGenerator.kt @@ -74,9 +74,15 @@ class DocumentationGenerator(path: String, fileName: String) { val btnWithSectionLink = "" docuEntitySegments[entityHolder.sourceClazzSimpleName] = div().withId(entityHolder.sourceClazzSimpleName).with( - h1(entityHolder.sourceClazzSimpleName), rawHtml(btnWithSectionLink), evaluateAvailableTypes(entityHolder.sourceElement), br(), *buildComment(entityHolder.comment), br(), + h1(entityHolder.sourceClazzSimpleName), + rawHtml(btnWithSectionLink), + evaluateAvailableTypes(entityHolder.sourceElement), + br(), + *buildComment(entityHolder.comment), + br(), table( - attrs(".table"), thead(*createTableHead()), + attrs(".table"), + thead(*createTableHead()), tbody( each(entityHolder.fields) { field -> tr( diff --git a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/generation/CodeGenerator.kt b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/generation/CodeGenerator.kt index f3201e55..d402a132 100644 --- a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/generation/CodeGenerator.kt +++ b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/generation/CodeGenerator.kt @@ -15,7 +15,6 @@ class CodeGenerator(private val filer: Filer) { @Throws(IOException::class) fun generate(entityToGenerate: FileSpec, processingEnvironment: ProcessingEnvironment) { - ClassName(entityToGenerate.packageName, entityToGenerate.name)?.apply { ProcessingContext.createdQualifiedClazzNames.add(this) } diff --git a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/generation/mapper/MapperGeneration.kt b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/generation/mapper/MapperGeneration.kt index a6cec34f..55a63682 100644 --- a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/generation/mapper/MapperGeneration.kt +++ b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/generation/mapper/MapperGeneration.kt @@ -18,7 +18,6 @@ import java.util.* class MapperGeneration { fun generate(holder: MapperHolder): FileSpec { - val mapperTypeParam = holder.declaringName.asFullTypeName() ?: holder.sourceClazzTypeName val typeSpec = TypeSpec.classBuilder(holder.targetMapperSimpleName) @@ -53,9 +52,7 @@ class MapperGeneration { val addedHelpers = mutableSetOf() for (fieldWithTypeParam in holder.fields.values.filter { it.typeHandleMode == MapifyHolder.TypeHandleMode.MAPPER && it.declaringName.typeParams.isNotEmpty() }) { - for (mapifyHelper in fieldWithTypeParam.declaringName.typeParams) { - val helperClazzName = buildHelperClazzName(mapifyHelper) if (addedHelpers.contains(helperClazzName)) { @@ -94,7 +91,6 @@ class MapperGeneration { } for (field in holder.fields.values) { - typeSpec.addProperties(field.reflectionProperties(holder.sourceClazzTypeName)) typeSpec.addProperty( @@ -148,7 +144,6 @@ class MapperGeneration { @Throws(Exception::class) private fun resolveDeclaringName(name: ProcessingContext.DeclaringName, resolverParam: ResolverParam, accessorName: String, typeParams: List) { - if (name.isProcessingType()) { resolverParam.fromMapBuilder.addStatement("%T.Mapper().fromMap(it as %T)", name.asTypeName()!!, TypeUtil.mapStringAny()) @@ -166,7 +161,6 @@ class MapperGeneration { } if (name.isTypeVar()) { - typeParams.indexOfFirst { it.name == name.name }?.let { resolverParam.fromMapBuilder.addStatement("typeParam$it.fromMap(it as %T)", TypeUtil.mapStringAny()) resolverParam.toMapBuilder.addStatement("typeParam$it.toMap(it)") diff --git a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/generation/model/CblConstantGeneration.kt b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/generation/model/CblConstantGeneration.kt index 409daa8b..c6ae5925 100644 --- a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/generation/model/CblConstantGeneration.kt +++ b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/generation/model/CblConstantGeneration.kt @@ -9,12 +9,10 @@ import com.squareup.kotlinpoet.KModifier object CblConstantGeneration { fun addConstants(holder: BaseEntityHolder, useNullableMap: Boolean): FunSpec { - val type = if (useNullableMap) TypeUtil.mutableMapStringAnyNullable() else TypeUtil.mutableMapStringAny() val builder = FunSpec.builder("addConstants").addModifiers(KModifier.PRIVATE).addParameter("map", type) for (fieldHolder in holder.fieldConstants.values) { - if (fieldHolder.isConstant) { builder.addStatement("map.put(%N, DOC_%N)", fieldHolder.constantName, fieldHolder.constantName) } diff --git a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/generation/model/CblDefaultGeneration.kt b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/generation/model/CblDefaultGeneration.kt index eee8a681..d3c2ed84 100644 --- a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/generation/model/CblDefaultGeneration.kt +++ b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/generation/model/CblDefaultGeneration.kt @@ -11,7 +11,6 @@ import com.squareup.kotlinpoet.KModifier object CblDefaultGeneration { fun addDefaults(holder: BaseEntityHolder, useNullableMap: Boolean): FunSpec { - val type = if (useNullableMap) TypeUtil.mutableMapStringAnyNullable() else TypeUtil.mutableMapStringAny() val valueType = @@ -25,14 +24,14 @@ object CblDefaultGeneration { builder.addStatement("%T.addDefaults<%T, %T>(listOf(", CrystalWrap::class, typeConversionReturnType, valueType) for (fieldHolder in holder.fields.values) { - if (fieldHolder.isDefault) { builder.addStatement( "arrayOf(%N, %T::class, ${ConversionUtil.convertStringToDesiredFormat( fieldHolder.typeMirror, fieldHolder.defaultValue )}),", - fieldHolder.constantName, fieldHolder.fieldType + fieldHolder.constantName, + fieldHolder.fieldType ) } } diff --git a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/generation/model/CblReduceGeneration.kt b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/generation/model/CblReduceGeneration.kt index 39da1fe8..0896096e 100644 --- a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/generation/model/CblReduceGeneration.kt +++ b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/generation/model/CblReduceGeneration.kt @@ -7,7 +7,6 @@ import com.squareup.kotlinpoet.PropertySpec object CblReduceGeneration { fun onlyIncludeProperty(holder: BaseEntityHolder): PropertySpec { - val spec = PropertySpec.builder(PROPERTY_ONLY_INCLUDES, TypeUtil.list(TypeUtil.string()).copy(nullable = true)) if (holder.isReduced) { diff --git a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/generation/model/CommonInterfaceGeneration.kt b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/generation/model/CommonInterfaceGeneration.kt index 00d60c6f..c1550958 100644 --- a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/generation/model/CommonInterfaceGeneration.kt +++ b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/generation/model/CommonInterfaceGeneration.kt @@ -10,7 +10,6 @@ private const val GENERATED_REPRESENT_NAME = "Represent" class CommonInterfaceGeneration { fun generateModel(holder: BaseEntityHolder, useSuspend: Boolean): FileSpec { - val interfaceSpec = TypeSpec.interfaceBuilder(holder.interfaceSimpleName) interfaceSpec.addSuperinterface(TypeUtil.mapSupport()) @@ -40,7 +39,6 @@ class CommonInterfaceGeneration { } private fun generateRepresent(holder: BaseModelHolder, parent: TypeSpec.Builder, useSuspend: Boolean) { - val typeBuilder = TypeSpec.classBuilder(GENERATED_REPRESENT_NAME) .addSuperinterface(TypeUtil.mapSupport()) .addModifiers(KModifier.PRIVATE) diff --git a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/generation/model/EnsureTypesGeneration.kt b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/generation/model/EnsureTypesGeneration.kt index e5c6165c..d326e75c 100644 --- a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/generation/model/EnsureTypesGeneration.kt +++ b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/generation/model/EnsureTypesGeneration.kt @@ -8,7 +8,6 @@ import com.squareup.kotlinpoet.FunSpec object EnsureTypesGeneration { fun ensureTypes(holder: BaseEntityHolder, useNullableMap: Boolean): FunSpec { - val explicitType = if (useNullableMap) TypeUtil.hashMapStringAnyNullable() else TypeUtil.hashMapStringAny() val type = if (useNullableMap) TypeUtil.mapStringAnyNullable() else TypeUtil.mapStringAny() @@ -20,7 +19,6 @@ object EnsureTypesGeneration { ensureTypes.addStatement("result.putAll(%T.ensureTypes<%T>(mapOf(", CrystalWrap::class, typeConversionReturnType) for (field in holder.fields.values) { - ensureTypes.addStatement("%N to %T::class,", field.constantName, field.evaluateClazzForTypeConversion()) } ensureTypes.addStatement("), doc))") diff --git a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/generation/model/EntityGeneration.kt b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/generation/model/EntityGeneration.kt index eb81b768..34dbcf02 100644 --- a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/generation/model/EntityGeneration.kt +++ b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/generation/model/EntityGeneration.kt @@ -280,24 +280,30 @@ class EntityGeneration { } private fun evaluateModifiers(useSuspend: Boolean): List { - return if (useSuspend) listOf( - KModifier.PUBLIC, - KModifier.SUSPEND - ) else listOf(KModifier.PUBLIC) + return if (useSuspend) { + listOf( + KModifier.PUBLIC, + KModifier.SUSPEND + ) + } else { + listOf(KModifier.PUBLIC) + } } private fun create(holder: EntityHolder, useSuspend: Boolean): List { - return listOf( FunSpec.builder("create").addModifiers(evaluateModifiers(useSuspend)) .addParameter("id", String::class).addAnnotation(JvmStatic::class).addStatement( "return %N(%T.${getDocumentMethod(useSuspend)}(id, %S) ?: mutableMapOf(_ID to id))", - holder.entitySimpleName, PersistenceConfig::class, holder.dbName + holder.entitySimpleName, + PersistenceConfig::class, + holder.dbName ).returns(holder.entityTypeName).build(), FunSpec.builder("create").addModifiers(evaluateModifiers(useSuspend)) .addAnnotation(JvmStatic::class).addStatement( "return %N(%T())", - holder.entitySimpleName, TypeUtil.hashMapStringAny() + holder.entitySimpleName, + TypeUtil.hashMapStringAny() ).returns(holder.entityTypeName).build(), FunSpec.builder("create").addModifiers(KModifier.PUBLIC) .addParameter("map", TypeUtil.mutableMapStringAny()).addAnnotation(JvmStatic::class) diff --git a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/generation/model/RebindMethodGeneration.kt b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/generation/model/RebindMethodGeneration.kt index 48178b93..d11cf87d 100644 --- a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/generation/model/RebindMethodGeneration.kt +++ b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/generation/model/RebindMethodGeneration.kt @@ -7,7 +7,6 @@ import com.squareup.kotlinpoet.FunSpec class RebindMethodGeneration { fun generate(clearMDocChanges: Boolean): FunSpec { - val explicitType = if (clearMDocChanges) TypeUtil.hashMapStringAny() else TypeUtil.linkedHashMapStringAnyNullable() val type = if (clearMDocChanges) TypeUtil.mapStringAny() else TypeUtil.mapStringAnyNullable() val rebind = FunSpec.builder("rebind").addParameter("doc", type) diff --git a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/generation/model/SetAllMethodGeneration.kt b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/generation/model/SetAllMethodGeneration.kt index 7951dcf0..4a28fc22 100644 --- a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/generation/model/SetAllMethodGeneration.kt +++ b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/generation/model/SetAllMethodGeneration.kt @@ -8,7 +8,6 @@ import com.squareup.kotlinpoet.KModifier class SetAllMethodGeneration { fun generate(holder: BaseEntityHolder, useMDocChanges: Boolean): FunSpec { - val attributeName = if (useMDocChanges) "mDocChanges" else "mDoc" val setAllBuilder = FunSpec.builder("setAll").addModifiers(KModifier.PUBLIC, KModifier.OVERRIDE) .addParameter("map", TypeUtil.mapStringAnyNullable()).addStatement( diff --git a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/generation/model/WrapperGeneration.kt b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/generation/model/WrapperGeneration.kt index 111b73d3..ba1f9255 100644 --- a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/generation/model/WrapperGeneration.kt +++ b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/generation/model/WrapperGeneration.kt @@ -10,7 +10,6 @@ import java.util.* class WrapperGeneration { fun generateModel(holder: WrapperEntityHolder, useSuspend: Boolean): FileSpec { - val companionSpec = TypeSpec.companionObjectBuilder() val builderBuilder = BuilderClassGeneration.generateBaseBuilder(holder) @@ -46,7 +45,6 @@ class WrapperGeneration { } for (fieldHolder in holder.allFields) { - companionSpec.addProperties(fieldHolder.createFieldConstant()) typeBuilder.addProperty(fieldHolder.property(null, holder.abstractParts, false, holder.deprecated)) fieldHolder.builderSetter(null, holder.sourcePackage, holder.entitySimpleName, false, holder.deprecated)?.let { @@ -126,7 +124,6 @@ class WrapperGeneration { } private fun create(holder: WrapperEntityHolder): List { - return Arrays.asList( FunSpec.builder("create").addModifiers(KModifier.PUBLIC).addParameter("doc", TypeUtil.mutableMapStringAnyNullable()).addAnnotation(JvmStatic::class).addStatement( "return %N(doc)", @@ -134,7 +131,8 @@ class WrapperGeneration { ).returns(holder.entityTypeName).build(), FunSpec.builder("create").addModifiers(KModifier.PUBLIC).addAnnotation(JvmStatic::class).addStatement( "return %N(%T())", - holder.entitySimpleName, TypeUtil.hashMapStringAnyNullable() + holder.entitySimpleName, + TypeUtil.hashMapStringAnyNullable() ).returns(holder.entityTypeName).build() ) } diff --git a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/model/EntityFactory.kt b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/model/EntityFactory.kt index 727f0c29..36e5dbc1 100644 --- a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/model/EntityFactory.kt +++ b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/model/EntityFactory.kt @@ -26,7 +26,10 @@ object EntityFactory { return create( sourceModel, EntityHolder( - annotation.database, annotation.modifierOpen, annotation.type, sourceModel + annotation.database, + annotation.modifierOpen, + annotation.type, + sourceModel ), allWrappers, allBaseModels @@ -38,7 +41,10 @@ object EntityFactory { allWrappers: List ): BaseModelHolder { return create( - sourceModel, BaseModelHolder(sourceModel), allWrappers, emptyMap() + sourceModel, + BaseModelHolder(sourceModel), + allWrappers, + emptyMap() ) as BaseModelHolder } @@ -62,7 +68,6 @@ object EntityFactory { allWrappers: List, allBaseModels: Map ): BaseEntityHolder { - content.reducesModels = createReduceModels(sourceModel, content, allWrappers, allBaseModels) content.abstractParts = sourceModel.abstractParts content.comment = sourceModel.commentAnnotation?.comment ?: arrayOf() @@ -83,7 +88,9 @@ object EntityFactory { if (it.generateAccessor != null) { content.generateAccessors.add( CblGenerateAccessorHolder( - content.sourceClazzTypeName, it, null + content.sourceClazzTypeName, + it, + null ) ) } @@ -92,7 +99,9 @@ object EntityFactory { if (it.generateAccessor != null) { content.generateAccessors.add( CblGenerateAccessorHolder( - content.sourceClazzTypeName, null, it + content.sourceClazzTypeName, + null, + it ) ) } @@ -163,9 +172,7 @@ object EntityFactory { allWrappers: List, allBaseModels: Map ) { - for (cblField in sourceModel.fieldAnnotations) { - if (cblField.readonly) { content.fieldConstants[cblField.name] = CblConstantHolder(cblField) } else { diff --git a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/model/MapperFactory.kt b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/model/MapperFactory.kt index f94312c7..5eaaaee9 100644 --- a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/model/MapperFactory.kt +++ b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/model/MapperFactory.kt @@ -14,7 +14,6 @@ import javax.lang.model.element.Modifier object MapperFactory { fun create(env: ProcessingEnvironment, mapperElement: Element): MapperHolder { - val result = MapperHolder(mapperElement) val getterSetterMap = hashMapOf() @@ -26,7 +25,8 @@ object MapperFactory { if (childElement.kind == ElementKind.FIELD) { childElement.getAnnotation(Mapify::class.java)?.apply { result.fields[childElement.simpleName.toString()] = MapifyHolder( - MapifyElementTypeField(childElement, this), env + MapifyElementTypeField(childElement, this), + env ) } } diff --git a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/model/accessor/CblGenerateAccessorHolder.kt b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/model/accessor/CblGenerateAccessorHolder.kt index fcd9f445..93384b3e 100644 --- a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/model/accessor/CblGenerateAccessorHolder.kt +++ b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/model/accessor/CblGenerateAccessorHolder.kt @@ -10,11 +10,10 @@ import com.squareup.kotlinpoet.TypeName class CblGenerateAccessorHolder( private val sourceClassTypeName: TypeName, private val memberFunction: SourceMemberFunction?, - private val memberProperty: SourceMemberField?, + private val memberProperty: SourceMemberField? ) { fun accessorFunSpec(): FunSpec? { - if (memberFunction != null) { val methodBuilder = FunSpec.builder(memberFunction.name).addAnnotation(JvmStatic::class) @@ -40,7 +39,6 @@ class CblGenerateAccessorHolder( } fun accessorPropertySpec(): PropertySpec? { - if (memberProperty != null) { return PropertySpec.builder( memberProperty.name, diff --git a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/model/deprecated/DeprecatedModel.kt b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/model/deprecated/DeprecatedModel.kt index 074e0531..c6a92a2f 100644 --- a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/model/deprecated/DeprecatedModel.kt +++ b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/model/deprecated/DeprecatedModel.kt @@ -26,7 +26,6 @@ class DeprecatedModel(deprecated: Deprecated) { } fun addDeprecated(field: String, spec: PropertySpec.Builder) { - if (deprecationType != DeprecationType.FIELD_DEPRECATION) { val inUse = deprecationType == DeprecationType.ENTITY_DEPRECATION spec.addAnnotation(buildDeprecatedAnnotation(inUse, "")) @@ -39,7 +38,6 @@ class DeprecatedModel(deprecated: Deprecated) { } fun evaluateFieldDeprecationLevel(field: String): DeprecationLevel? { - if (deprecationType != DeprecationType.FIELD_DEPRECATION) { val inUse = deprecationType == DeprecationType.ENTITY_DEPRECATION return evaluateDeprecationLevel(inUse) @@ -53,7 +51,6 @@ class DeprecatedModel(deprecated: Deprecated) { } fun addDeprecatedFunctions(fields: Array, spec: FunSpec.Builder): Boolean { - return if (deprecationType != DeprecationType.FIELD_DEPRECATION) { val inUse = deprecationType == DeprecationType.ENTITY_DEPRECATION spec.addAnnotation( @@ -78,7 +75,6 @@ class DeprecatedModel(deprecated: Deprecated) { } fun addDeprecatedBuilderSetter(field: String, spec: FunSpec.Builder): Boolean { - return if (deprecationType != DeprecationType.FIELD_DEPRECATION) { val inUse = deprecationType == DeprecationType.ENTITY_DEPRECATION spec.addAnnotation(buildDeprecatedAnnotation(inUse, "")) @@ -114,12 +110,13 @@ class DeprecatedModel(deprecated: Deprecated) { } fun addDeprecated(spec: TypeSpec.Builder) { - if (deprecationType == DeprecationType.ENTITY_DEPRECATION || deprecationType == DeprecationType.ENTITY_DEPRECATION_NOT_IN_USE) { val replacedBy = replacedByTypeMirror?.let { if (it.toString() != Void::class.java.canonicalName) { it.toString() - } else "" + } else { + "" + } } ?: "" spec.addAnnotation(buildDeprecatedAnnotation(true, replacedBy)) diff --git a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/model/field/CblConstantHolder.kt b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/model/field/CblConstantHolder.kt index 22f82226..8d9f20ce 100644 --- a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/model/field/CblConstantHolder.kt +++ b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/model/field/CblConstantHolder.kt @@ -35,7 +35,6 @@ class CblConstantHolder(field: Field) : CblBaseFieldHolder(field.name, field) { } override fun property(dbName: String?, possibleOverrides: Set, useMDocChanges: Boolean, deprecated: DeprecatedModel?): PropertySpec { - val mDocPhrase = if (useMDocChanges) "mDocChanges, mDoc" else "mDoc, mutableMapOf()" val builder = PropertySpec.builder(accessorSuffix(), fieldType, KModifier.PUBLIC, KModifier.OVERRIDE) @@ -50,7 +49,6 @@ class CblConstantHolder(field: Field) : CblBaseFieldHolder(field.name, field) { } override fun createFieldConstant(): List { - val fieldAccessorConstant = PropertySpec.builder(constantName, String::class, KModifier.FINAL, KModifier.PUBLIC).initializer("%S", dbField).addAnnotation(JvmField::class).build() return Arrays.asList( diff --git a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/model/field/CblFieldHolder.kt b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/model/field/CblFieldHolder.kt index b412fee5..9b17dbd4 100644 --- a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/model/field/CblFieldHolder.kt +++ b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/model/field/CblFieldHolder.kt @@ -66,7 +66,10 @@ class CblFieldHolder(field: Field, allWrappers: List) : .copy(nullable = true) val propertyBuilder = PropertySpec.builder( - accessorSuffix(), returnType.copy(true), KModifier.PUBLIC, KModifier.OVERRIDE + accessorSuffix(), + returnType.copy(true), + KModifier.PUBLIC, + KModifier.OVERRIDE ).mutable(true) val getter = FunSpec.getterBuilder() @@ -79,33 +82,65 @@ class CblFieldHolder(field: Field, allWrappers: List) : if (isTypeOfSubEntity) { if (isIterable) { getter.addStatement( - "return %T.getList<%T>($mDocPhrase, %N, %T::class, {%T.fromMap(it) ?: emptyList()})", CrystalWrap::class, subEntityTypeName, constantName, subEntityTypeName, subEntityTypeName + "return %T.getList<%T>($mDocPhrase, %N, %T::class, {%T.fromMap(it) ?: emptyList()})", + CrystalWrap::class, + subEntityTypeName, + constantName, + subEntityTypeName, + subEntityTypeName ) setter.addStatement( - "%T.setList(%N, %N, value, %T::class, {%T.toMap(it)})", CrystalWrap::class, if (useMDocChanges) "mDocChanges" else "mDoc", constantName, subEntityTypeName, subEntityTypeName + "%T.setList(%N, %N, value, %T::class, {%T.toMap(it)})", + CrystalWrap::class, + if (useMDocChanges) "mDocChanges" else "mDoc", + constantName, + subEntityTypeName, + subEntityTypeName ) } else { getter.addStatement( - "return %T.get<%T>($mDocPhrase, %N, %T::class, {%T.fromMap(it)})", CrystalWrap::class, subEntityTypeName, constantName, subEntityTypeName, subEntityTypeName + "return %T.get<%T>($mDocPhrase, %N, %T::class, {%T.fromMap(it)})", + CrystalWrap::class, + subEntityTypeName, + constantName, + subEntityTypeName, + subEntityTypeName ) setter.addStatement( - "%T.set(%N, %N, value, %T::class, {%T.toMap(it)})", CrystalWrap::class, if (useMDocChanges) "mDocChanges" else "mDoc", constantName, subEntityTypeName, subEntityTypeName + "%T.set(%N, %N, value, %T::class, {%T.toMap(it)})", + CrystalWrap::class, + if (useMDocChanges) "mDocChanges" else "mDoc", + constantName, + subEntityTypeName, + subEntityTypeName ) } } else { val forTypeConversion = evaluateClazzForTypeConversion() if (isIterable) { getter.addStatement( - "return %T.getList<%T>($mDocPhrase, %N, %T::class)", CrystalWrap::class, fieldType, constantName, forTypeConversion + "return %T.getList<%T>($mDocPhrase, %N, %T::class)", + CrystalWrap::class, + fieldType, + constantName, + forTypeConversion ) } else { getter.addStatement( - "return %T.get<%T>($mDocPhrase, %N, %T::class)", CrystalWrap::class, fieldType, constantName, forTypeConversion + "return %T.get<%T>($mDocPhrase, %N, %T::class)", + CrystalWrap::class, + fieldType, + constantName, + forTypeConversion ) } setter.addStatement( - "%T.set(%N, %N, value, %T::class)", CrystalWrap::class, if (useMDocChanges) "mDocChanges" else "mDoc", constantName, forTypeConversion + "%T.set(%N, %N, value, %T::class)", + CrystalWrap::class, + if (useMDocChanges) "mDocChanges" else "mDoc", + constantName, + forTypeConversion ) } @@ -134,7 +169,8 @@ class CblFieldHolder(field: Field, allWrappers: List) : } if (deprecated?.addDeprecatedBuilderSetter( - dbField, builder + dbField, + builder ) == true ) { builder.addStatement("throw %T()", UnsupportedOperationException::class) @@ -160,6 +196,8 @@ class CblFieldHolder(field: Field, allWrappers: List) : } else { fieldType } - } else TypeUtil.parseMetaType(typeMirror, isIterable, false, subEntitySimpleName) + } else { + TypeUtil.parseMetaType(typeMirror, isIterable, false, subEntitySimpleName) + } } } diff --git a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/model/id/DocIdHolder.kt b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/model/id/DocIdHolder.kt index 14dd567a..d5ce20e7 100644 --- a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/model/id/DocIdHolder.kt +++ b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/model/id/DocIdHolder.kt @@ -118,7 +118,7 @@ class DocIdHolder(docId: DocId, val customSegmentSource: MutableList = distinctFieldAccessors(entity) - if (entity.deprecated?.addDeprecatedFunctions(*list.toTypedArray(), spec) == true) { + if (entity.deprecated?.addDeprecatedFunctions(list.toTypedArray(), spec) == true) { spec.addStatement("throw %T()", UnsupportedOperationException::class) } else { spec.addStatement("return $COMPANION_BUILD_FUNCTION_NAME(${list.joinToString(separator = ",")})") diff --git a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/model/query/CblQueryHolder.kt b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/model/query/CblQueryHolder.kt index 59fd6196..e6d87d20 100644 --- a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/model/query/CblQueryHolder.kt +++ b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/model/query/CblQueryHolder.kt @@ -36,7 +36,6 @@ class CblQueryHolder(private val mQuery: Query) { if (entityHolder.deprecated?.addDeprecatedFunctions(fields, builder) == true) { builder.addStatement("throw %T()", UnsupportedOperationException::class) } else { - builder.addStatement( "val queryParams = mutableMapOf<%T, %T>()", TypeUtil.string(), diff --git a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/model/source/ReducedSourceModel.kt b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/model/source/ReducedSourceModel.kt index e48deaa8..f9af502f 100644 --- a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/model/source/ReducedSourceModel.kt +++ b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/model/source/ReducedSourceModel.kt @@ -36,7 +36,9 @@ data class ReducedSourceModel( sourceModel.fieldAnnotations.toMutableList().mapNotNull { if (reducedModelHolder.includedElements.contains(it.name).not()) { null - } else it + } else { + it + } } override val docIdAnnotation: DocId? = @@ -52,7 +54,9 @@ data class ReducedSourceModel( if (reducedModelHolder.includeAccessor) it.generateAccessor else null if (docIdSegment != null || generateAccessor != null) { SourceMemberField(it.name, it.type, docIdSegment, generateAccessor) - } else null + } else { + null + } } override val relevantStaticFunctions: List = @@ -62,6 +66,8 @@ data class ReducedSourceModel( if (reducedModelHolder.includeAccessor) it.generateAccessor else null if (docIdSegment != null || generateAccessor != null) { SourceMemberFunction(it.name, it.isSuspend, it.returnTypeName, it.parameters, docIdSegment, generateAccessor) - } else null + } else { + null + } } } diff --git a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/model/source/SourceModel.kt b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/model/source/SourceModel.kt index d982cf88..e343f08b 100644 --- a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/model/source/SourceModel.kt +++ b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/model/source/SourceModel.kt @@ -85,7 +85,8 @@ data class SourceModel(private val sourceElement: Element) : ISourceModel, IClas it.asType(), it.getAnnotation(Nullable::class.java) != null ), - docSegment, accessor + docSegment, + accessor ) ) } diff --git a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/processing/mapper/MapperWorkSet.kt b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/processing/mapper/MapperWorkSet.kt index f11ce09a..0d99ff39 100644 --- a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/processing/mapper/MapperWorkSet.kt +++ b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/processing/mapper/MapperWorkSet.kt @@ -20,7 +20,6 @@ class MapperWorkSet(val allMapperElements: Set) : WorkSet { } override fun loadModels(logger: Logger, env: ProcessingEnvironment) { - for (element in allMapperElements) { val baseModel = MapperFactory.create(env, element) mapperModels[element.toString()] = baseModel diff --git a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/processing/model/ModelWorkSet.kt b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/processing/model/ModelWorkSet.kt index 395498b4..aafe9066 100644 --- a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/processing/model/ModelWorkSet.kt +++ b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/processing/model/ModelWorkSet.kt @@ -29,7 +29,6 @@ class ModelWorkSet(val allEntityElements: Set, val allWrapperElements: } override fun loadModels(logger: Logger, env: ProcessingEnvironment) { - val allWrapperStrings = allWrapperElements.map { element -> element.toString() } for (element in allBaseModelElements) { diff --git a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/processing/model/ModelWorker.kt b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/processing/model/ModelWorker.kt index 8714d848..5d3addde 100644 --- a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/processing/model/ModelWorker.kt +++ b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/processing/model/ModelWorker.kt @@ -33,7 +33,8 @@ class ModelWorker(override val logger: Logger, override val codeGenerator: CodeG schemaGenerator = SchemaGenerator( it, processingEnv.options.getOrDefault( - CoachBaseBinderProcessor.FRAMEWORK_SCHEMA_FILENAME_OPTION_NAME, "schema.json" + CoachBaseBinderProcessor.FRAMEWORK_SCHEMA_FILENAME_OPTION_NAME, + "schema.json" ) ) } @@ -64,7 +65,6 @@ class ModelWorker(override val logger: Logger, override val codeGenerator: CodeG } private fun process(models: List, generatedInterfaces: MutableSet, useSuspend: Boolean, generate: (T) -> FileSpec) { - for (model in models) { generateInterface(generatedInterfaces, model, useSuspend) documentationGenerator?.addEntitySegments(model) diff --git a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/util/ConversionUtil.kt b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/util/ConversionUtil.kt index 657a1344..21b61ff1 100644 --- a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/util/ConversionUtil.kt +++ b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/util/ConversionUtil.kt @@ -24,9 +24,10 @@ object ConversionUtil { } fun convertStringToDesiredFormat(clazz: TypeMirror, value: String): String { - return if (clazz.asTypeName().javaToKotlinType() == TypeUtil.string()) { "\"" + value + "\"" - } else value + } else { + value + } } } diff --git a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/util/ElementUtil.kt b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/util/ElementUtil.kt index 8c14d8ea..9658fb30 100644 --- a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/util/ElementUtil.kt +++ b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/util/ElementUtil.kt @@ -6,10 +6,8 @@ import java.util.Arrays object ElementUtil { fun splitGenericIfNeeded(name: String): List { - val result = ArrayList() if (name.contains("<")) { - result.add(name.substring(0, name.indexOf("<")).trim { it <= ' ' }) for (item in Arrays.asList(*name.substring(name.indexOf("<") + 1, name.indexOf(">")).split(",".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray())) { diff --git a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/util/FieldExtractionUtil.kt b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/util/FieldExtractionUtil.kt index 15988277..ee42dc8b 100644 --- a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/util/FieldExtractionUtil.kt +++ b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/util/FieldExtractionUtil.kt @@ -26,7 +26,9 @@ object FieldExtractionUtil { if (annotation.replacedBy != null) { throw Exception("Expected to get a MirroredTypeException") - } else null + } else { + null + } } catch (mte: MirroredTypeException) { mte.typeMirror } @@ -42,7 +44,6 @@ object FieldExtractionUtil { } fun typeMirror(annotation: BasedOn): List { - val result = mutableListOf() try { diff --git a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/util/TypeUtil.kt b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/util/TypeUtil.kt index 3f6838f1..bd402e07 100644 --- a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/util/TypeUtil.kt +++ b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/util/TypeUtil.kt @@ -137,7 +137,6 @@ object TypeUtil { } fun parseMetaType(type: TypeMirror, list: Boolean, convertMap: Boolean, subEntity: String?): TypeName { - val simpleName = if (subEntity != null && subEntity.contains(getSimpleName(type))) subEntity else getSimpleName(type) var baseType: TypeName? @@ -158,7 +157,9 @@ object TypeUtil { return if (list) { list(baseType!!.javaToKotlinType()) - } else baseType!!.javaToKotlinType() + } else { + baseType!!.javaToKotlinType() + } } fun classStar(): ParameterizedTypeName { diff --git a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/validation/mapper/MapperValidation.kt b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/validation/mapper/MapperValidation.kt index 5c7f1aaa..073feec6 100644 --- a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/validation/mapper/MapperValidation.kt +++ b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/validation/mapper/MapperValidation.kt @@ -12,10 +12,8 @@ import javax.lang.model.element.Element class MapperValidation(val logger: Logger, val mappers: MutableMap) { fun postValidate(): Boolean { - for (mapper in mappers) { for (field in mapper.value.fields) { - val element: Element = (field.value.mapifyElement as? MapifyElementTypeField)?.let { it.element } ?: (field.value.mapifyElement as? MapifyElementTypeGetterSetter)?.let { it.getterSetter.getterElement } ?: throw Exception("unknown kind") if (field.value.typeHandleMode == MapifyHolder.TypeHandleMode.UNKNOWN) { diff --git a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/validation/mapper/PreMapperValidation.kt b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/validation/mapper/PreMapperValidation.kt index fbc33190..c599c99e 100644 --- a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/validation/mapper/PreMapperValidation.kt +++ b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/validation/mapper/PreMapperValidation.kt @@ -10,12 +10,10 @@ object PreMapperValidation { @Throws(ClassNotFoundException::class) fun validate(mapperElement: Element, logger: Logger) { - val getterMap: MutableMap = hashMapOf() val setterMap: MutableMap = hashMapOf() for (member in mapperElement.enclosedElements) { if (member.kind == ElementKind.METHOD && member.getAnnotation(Mapify::class.java) != null) { - val isGetter: Boolean = member.simpleName.toString().let { it.startsWith("get") } val isSetter: Boolean = member.simpleName.toString().let { it.startsWith("set") } @@ -29,7 +27,6 @@ object PreMapperValidation { } hashSetOf(*getterMap.keys.minus(setterMap.keys).toTypedArray(), *setterMap.keys.minus(getterMap.keys).toTypedArray()).forEach { - println(it) val element = getterMap[it] ?: setterMap[it] ?: mapperElement diff --git a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/validation/model/ModelValidation.kt b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/validation/model/ModelValidation.kt index d992e77c..09b0a607 100644 --- a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/validation/model/ModelValidation.kt +++ b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/validation/model/ModelValidation.kt @@ -11,7 +11,6 @@ import com.schwarz.crystalapi.deprecated.DeprecatedField class ModelValidation(val logger: Logger, val baseModels: MutableMap, val wrapperModels: MutableMap, val entityModels: MutableMap) { private fun validateQuery(baseEntityHolder: BaseEntityHolder) { - for (query in baseEntityHolder.queries) { for (field in query.fields) { if (!baseEntityHolder.fields.containsKey(field) && !baseEntityHolder.fieldConstants.containsKey(field)) { @@ -22,7 +21,6 @@ class ModelValidation(val logger: Logger, val baseModels: MutableMap deprecated.replacedByTypeMirror?.toString()?.apply { if (this != Void::class.java.canonicalName && !wrapperModels.containsKey(this) && !entityModels.containsKey(this)) { @@ -65,7 +63,6 @@ class ModelValidation(val logger: Logger, val baseModels: MutableMap() for (fieldAnnotation in fields.value) { - if (names.contains(fieldAnnotation.name)) { logger.warn("duplicated field name", entityElement) } @@ -42,9 +39,7 @@ object PreModelValidation { } for (member in entityElement.enclosedElements) { - if (member.kind == ElementKind.CONSTRUCTOR) { - val constructor = member as Symbol.MethodSymbol if (constructor.parameters.size != 0) { diff --git a/crystal-map-processor/src/test/java/com/schwarz/CouchbaseBaseBinderProcessorKotlinTest.kt b/crystal-map-processor/src/test/java/com/schwarz/CouchbaseBaseBinderProcessorKotlinTest.kt index 53712851..2eec978c 100644 --- a/crystal-map-processor/src/test/java/com/schwarz/CouchbaseBaseBinderProcessorKotlinTest.kt +++ b/crystal-map-processor/src/test/java/com/schwarz/CouchbaseBaseBinderProcessorKotlinTest.kt @@ -2,11 +2,14 @@ package com.schwarz import com.schwarz.crystalprocessor.CoachBaseBinderProcessor import com.schwarz.testdata.TestDataHelper +import com.tschuchort.compiletesting.JvmCompilationResult import com.tschuchort.compiletesting.KotlinCompilation import com.tschuchort.compiletesting.SourceFile +import org.jetbrains.kotlin.compiler.plugin.ExperimentalCompilerApi import org.junit.Assert import org.junit.Test +@OptIn(ExperimentalCompilerApi::class) class CouchbaseBaseBinderProcessorKotlinTest { @Test @@ -118,7 +121,6 @@ class CouchbaseBaseBinderProcessorKotlinTest { @Test fun testKotlinAbstractGeneration() { - val subEntity = SourceFile.kotlin( "Sub.kt", ENTITY_HEADER + @@ -141,9 +143,9 @@ class CouchbaseBaseBinderProcessorKotlinTest { Assert.assertEquals(KotlinCompilation.ExitCode.OK, compilation.exitCode) } + @OptIn(ExperimentalCompilerApi::class) @Test fun testKotlinAbstractGenerationWithLongFields() { - val subEntity = SourceFile.kotlin( "Sub.kt", ENTITY_HEADER + @@ -168,7 +170,6 @@ class CouchbaseBaseBinderProcessorKotlinTest { @Test fun testKotlinPrivateGeneration() { - val subEntity = SourceFile.kotlin( "Sub.kt", ENTITY_HEADER + @@ -191,9 +192,9 @@ class CouchbaseBaseBinderProcessorKotlinTest { Assert.assertTrue(compilation.messages.contains("Entity can not be final")) } + @OptIn(ExperimentalCompilerApi::class) @Test fun testKotlinConstructorFailGeneration() { - val subEntity = SourceFile.kotlin( "Sub.kt", ENTITY_HEADER + @@ -216,13 +217,14 @@ class CouchbaseBaseBinderProcessorKotlinTest { Assert.assertTrue(compilation.messages.contains("Entity should not have a contructor")) } - private fun compileKotlin(vararg sourceFiles: SourceFile, useSuspend: Boolean = false): KotlinCompilation.Result { + private fun compileKotlin(vararg sourceFiles: SourceFile, useSuspend: Boolean = false): JvmCompilationResult { return KotlinCompilation().apply { sources = sourceFiles.toList() // pass your own instance of an annotation processor annotationProcessors = listOf(CoachBaseBinderProcessor()) correctErrorTypes = true + jvmTarget = "17" kaptArgs["useSuspend"] = useSuspend.toString() inheritClassPath = true diff --git a/crystal-map-versioning-plugin/build.gradle b/crystal-map-versioning-plugin/build.gradle index 3fbdd528..2f38f424 100644 --- a/crystal-map-versioning-plugin/build.gradle +++ b/crystal-map-versioning-plugin/build.gradle @@ -1,7 +1,7 @@ plugins { id 'java-gradle-plugin' id 'kotlin' - id 'maven' + id 'maven-publish' } @@ -14,32 +14,23 @@ gradlePlugin { } } -task sourcesJar(type: Jar, dependsOn: classes) { - classifier = 'sources' - from sourceSets.main.allSource -} +targetCompatibility = JavaVersion.VERSION_17 +sourceCompatibility = JavaVersion.VERSION_17 -task javadocJar(type: Jar, dependsOn: javadoc) { - classifier = 'javadoc' - from javadoc.destinationDir +java { + withSourcesJar() + withJavadocJar() } -artifacts { - archives sourcesJar - archives javadocJar -} -repositories { - mavenCentral() -} -compileKotlin { - kotlinOptions { - jvmTarget = "1.8" - } -} -compileTestKotlin { - kotlinOptions { - jvmTarget = "1.8" +publishing { + publications { + maven(MavenPublication) { + groupId project.group + artifactId project.name + version project.version + from components.java + } } } diff --git a/crystal-map-versioning-plugin/src/main/java/com/schwarz/crystalversioningplugin/VersioningPlugin.kt b/crystal-map-versioning-plugin/src/main/java/com/schwarz/crystalversioningplugin/VersioningPlugin.kt index 18abf3b2..34fc20af 100644 --- a/crystal-map-versioning-plugin/src/main/java/com/schwarz/crystalversioningplugin/VersioningPlugin.kt +++ b/crystal-map-versioning-plugin/src/main/java/com/schwarz/crystalversioningplugin/VersioningPlugin.kt @@ -35,7 +35,6 @@ class VersioningPlugin : Plugin { private fun markCurrentSchemaAsReleased(project: Project, extension: VersioningPluginExtension, task: Task) { task.dependsOn("build").doLast { - val version: String = when { project.hasProperty(PARAM_VERSION) -> project.property(PARAM_VERSION) as String else -> System.console().readLine("insert version of release") diff --git a/crystal-map-versioning-plugin/src/main/java/com/schwarz/crystalversioningplugin/task/ValidationTask.kt b/crystal-map-versioning-plugin/src/main/java/com/schwarz/crystalversioningplugin/task/ValidationTask.kt index 0ea548b5..285bfbd6 100644 --- a/crystal-map-versioning-plugin/src/main/java/com/schwarz/crystalversioningplugin/task/ValidationTask.kt +++ b/crystal-map-versioning-plugin/src/main/java/com/schwarz/crystalversioningplugin/task/ValidationTask.kt @@ -20,7 +20,6 @@ open class ValidationTask : DefaultTask() { @TaskAction fun generate() { - extension.validationClazz?.let { val currentVersionFile = parseVersionSchema(File(extension.currentSchema)) val prettyPrinter = services.get(StyledTextOutputFactory::class.java) @@ -29,7 +28,6 @@ open class ValidationTask : DefaultTask() { var result = true for (versionFile in File(extension.versionedSchemaPath).listFiles()) { if (versionFile.extension == "json") { - val logger = SchemaValidationLoggerImpl() validator.validate(currentVersionFile, parseVersionSchema(versionFile), logger) logger.print(prettyPrinter.create("model")) diff --git a/demo/build.gradle b/demo/build.gradle index 01b0cb9f..280c39f4 100644 --- a/demo/build.gradle +++ b/demo/build.gradle @@ -1,12 +1,12 @@ buildscript { - ext.kotlin_version = '1.7.10' + ext.kotlin_version = '1.9.21' repositories { google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.3.1' + classpath 'com.android.tools.build:gradle:8.0.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" //TODO enable to locally test plugin @@ -33,6 +33,7 @@ apply plugin: 'kotlin-kapt' android { + namespace "com.schwarz.crystaldemo" defaultConfig { applicationId "com.schwarz.crystaldemo" compileSdkVersion 33 @@ -49,8 +50,8 @@ android { } } compileOptions { - sourceCompatibility 1.8 - targetCompatibility 1.8 + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 } // workaround for "duplicate files during packaging of APK" issue: diff --git a/demo/src/main/java/com/schwarz/crystaldemo/Application.kt b/demo/src/main/java/com/schwarz/crystaldemo/Application.kt index 65e23a7a..2344f897 100755 --- a/demo/src/main/java/com/schwarz/crystaldemo/Application.kt +++ b/demo/src/main/java/com/schwarz/crystaldemo/Application.kt @@ -60,14 +60,15 @@ class Application : android.app.Application() { TAG, "Data type manipulated: Tried to cast ${errorWrapper.value} into ${errorWrapper.`class`}" ) - } else throw errorWrapper.exception + } else { + throw errorWrapper.exception + } } }) createMockArticle() } private fun deleteDbIfExists() { - try { database!!.delete() mDatabase = null diff --git a/demo/src/main/java/com/schwarz/crystaldemo/CommentActivity.kt b/demo/src/main/java/com/schwarz/crystaldemo/CommentActivity.kt index 79d5e365..04f4752d 100644 --- a/demo/src/main/java/com/schwarz/crystaldemo/CommentActivity.kt +++ b/demo/src/main/java/com/schwarz/crystaldemo/CommentActivity.kt @@ -24,7 +24,8 @@ class CommentActivity : AppCompatActivity() { val adapter = object : ArrayAdapter( this, R.layout.comment_item_view, - R.id.txt_comment, map(data) + R.id.txt_comment, + map(data) ) { override fun getView(position: Int, convertView: View?, parent: ViewGroup): View { val view = super.getView(position, convertView, parent) @@ -77,6 +78,7 @@ class CommentActivity : AppCompatActivity() { companion object { private val TAG = CommentActivity::class.java.name + @JvmStatic fun buildIntent(activity: MainActivity?, id: String?): Intent { val intent = Intent(activity, CommentActivity::class.java) diff --git a/demo/src/main/java/com/schwarz/crystaldemo/entity/BaseModel.kt b/demo/src/main/java/com/schwarz/crystaldemo/entity/BaseModel.kt index 53a34553..72b221b1 100644 --- a/demo/src/main/java/com/schwarz/crystaldemo/entity/BaseModel.kt +++ b/demo/src/main/java/com/schwarz/crystaldemo/entity/BaseModel.kt @@ -11,6 +11,6 @@ import com.schwarz.crystalapi.Fields defaultValue = "something", readonly = true ), - Field(name = "someConstant", type = String::class, defaultValue = "invalid", readonly = true), + Field(name = "someConstant", type = String::class, defaultValue = "invalid", readonly = true) ) open class BaseModel diff --git a/demo/src/main/java/com/schwarz/crystaldemo/entity/Product.kt b/demo/src/main/java/com/schwarz/crystaldemo/entity/Product.kt index 52da6a68..955c0f54 100644 --- a/demo/src/main/java/com/schwarz/crystaldemo/entity/Product.kt +++ b/demo/src/main/java/com/schwarz/crystaldemo/entity/Product.kt @@ -37,10 +37,11 @@ import com.schwarz.crystalapi.query.Query ), Field(name = "image", type = Blob::class), Field(name = "identifiers", type = String::class, list = true), - Field(name = "category", type = ProductCategory::class), + Field(name = "category", type = ProductCategory::class) ) @Queries( - Query(fields = ["type"]), Query(fields = ["type", "category"]) + Query(fields = ["type"]), + Query(fields = ["type", "category"]) ) @Reduces( Reduce(namePrefix = "Light", include = ["name", "type", "category", "image"]), diff --git a/demo/src/main/java/com/schwarz/crystaldemo/tesst/CaptureStateItemPosition.kt b/demo/src/main/java/com/schwarz/crystaldemo/tesst/CaptureStateItemPosition.kt index 5573481d..aff66c1b 100644 --- a/demo/src/main/java/com/schwarz/crystaldemo/tesst/CaptureStateItemPosition.kt +++ b/demo/src/main/java/com/schwarz/crystaldemo/tesst/CaptureStateItemPosition.kt @@ -4,7 +4,7 @@ import com.schwarz.crystalapi.* @Entity @Fields( - Field(name = "here_state", type = CaptureState::class, list = true), + Field(name = "here_state", type = CaptureState::class, list = true) ) open class CaptureStateItemPosition diff --git a/demo/src/test/java/kaufland/com/demo/TypeConversionTest.kt b/demo/src/test/java/kaufland/com/demo/TypeConversionTest.kt index 2079a9c8..7ee9d9d1 100644 --- a/demo/src/test/java/kaufland/com/demo/TypeConversionTest.kt +++ b/demo/src/test/java/kaufland/com/demo/TypeConversionTest.kt @@ -71,7 +71,6 @@ class TypeConversionTest { @Test @Throws(Exception::class) fun testCustomTypeConversion() { - val test = mapOf(TestClassEntity.CLAZZ_NAME to TypeConversionTest::class.simpleName!!) Assert.assertEquals( diff --git a/demo/src/test/java/kaufland/com/demo/entity/ProductEntityTest.kt b/demo/src/test/java/kaufland/com/demo/entity/ProductEntityTest.kt index cfd9df90..f52d04f7 100644 --- a/demo/src/test/java/kaufland/com/demo/entity/ProductEntityTest.kt +++ b/demo/src/test/java/kaufland/com/demo/entity/ProductEntityTest.kt @@ -45,7 +45,6 @@ object ProductEntityTestConnector : UnitTestConnector(typeConversions) { override fun invokeOnError(errorWrapper: TypeConversionErrorWrapper) { if (errorWrapper.exception is ClassCastException) { - logger.error( dataTypeErrorMsg.invoke( errorWrapper.fieldName, diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index f93a3fa9..5d5bd995 100755 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,5 +3,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-all.zip networkTimeout=300000