From 6665edb8c2b4bf6da7bc9c8e5a318c28181709f8 Mon Sep 17 00:00:00 2001 From: Brandon Fergerson Date: Fri, 30 Sep 2022 19:06:57 +0400 Subject: [PATCH] refactor: remove codegen module --- build.gradle.kts | 8 ++--- codegen/build.gradle.kts | 15 -------- .../codegen/ProtocolCodeGenProcessor.kt | 36 ------------------- gradle.properties | 2 +- settings.gradle | 2 -- .../META-INF/vertx/json-mappers.properties | 0 6 files changed, 3 insertions(+), 60 deletions(-) delete mode 100644 codegen/build.gradle.kts delete mode 100644 codegen/src/main/kotlin/spp/protocol/codegen/ProtocolCodeGenProcessor.kt rename {codegen/src => src}/main/resources/META-INF/vertx/json-mappers.properties (100%) diff --git a/build.gradle.kts b/build.gradle.kts index af948d3c..a4d9f0df 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -77,8 +77,8 @@ dependencies { testImplementation("io.vertx:vertx-junit5:$vertxVersion") testImplementation("io.vertx:vertx-core:$vertxVersion") - annotationProcessor("io.vertx:vertx-codegen:$vertxVersion:processor") - kapt(findProject("codegen") ?: project(":protocol:codegen")) + kapt("io.vertx:vertx-codegen:$vertxVersion:processor") + compileOnly("io.vertx:vertx-codegen:$vertxVersion") detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.21.0") } @@ -142,7 +142,3 @@ spotless { licenseHeader(formattedLicenseHeader) } } - -kapt { - annotationProcessor("spp.protocol.codegen.ProtocolCodeGenProcessor") -} diff --git a/codegen/build.gradle.kts b/codegen/build.gradle.kts deleted file mode 100644 index 57146e87..00000000 --- a/codegen/build.gradle.kts +++ /dev/null @@ -1,15 +0,0 @@ -plugins { - kotlin("jvm") -} - -val vertxVersion: String by project -val joorVersion: String by project - -repositories { - mavenCentral() -} - -dependencies { - implementation("io.vertx:vertx-codegen:$vertxVersion") - implementation("org.jooq:joor:$joorVersion") -} diff --git a/codegen/src/main/kotlin/spp/protocol/codegen/ProtocolCodeGenProcessor.kt b/codegen/src/main/kotlin/spp/protocol/codegen/ProtocolCodeGenProcessor.kt deleted file mode 100644 index edd0cf23..00000000 --- a/codegen/src/main/kotlin/spp/protocol/codegen/ProtocolCodeGenProcessor.kt +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Source++, the open-source live coding platform. - * Copyright (C) 2022 CodeBrig, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package spp.protocol.codegen - -import io.vertx.codegen.CodeGen -import io.vertx.codegen.CodeGenProcessor -import org.joor.Reflect - -/** - * Better (but still hacky) fix for https://github.com/sourceplusplus/sourceplusplus/issues/430. - */ -@Suppress("unused") -class ProtocolCodeGenProcessor : CodeGenProcessor() { - init { - val mappers = mutableListOf>() - Reflect.on(this).set("mappers", mappers) - val inputStream = ProtocolCodeGenProcessor::class.java.getResource( - "/META-INF/vertx/json-mappers.properties" - )!!.openStream() - Reflect.onClass(CodeGenProcessor::class.java).call("loadJsonMappers", mappers, inputStream) - } -} diff --git a/gradle.properties b/gradle.properties index 92376414..f85e5a5f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,7 +3,7 @@ kotlin.code.style=official projectVersion=0.7.1-SNAPSHOT kotlinVersion=1.6.10 -vertxVersion=4.3.3 +vertxVersion=4.3.4 jacksonVersion=2.13.4 joorVersion=0.9.14 jupiterVersion=5.9.1 diff --git a/settings.gradle b/settings.gradle index eb6c38ae..95b173d5 100644 --- a/settings.gradle +++ b/settings.gradle @@ -10,5 +10,3 @@ pluginManagement { } rootProject.name = 'protocol' - -include "codegen" diff --git a/codegen/src/main/resources/META-INF/vertx/json-mappers.properties b/src/main/resources/META-INF/vertx/json-mappers.properties similarity index 100% rename from codegen/src/main/resources/META-INF/vertx/json-mappers.properties rename to src/main/resources/META-INF/vertx/json-mappers.properties