User: kyle wood Date: 29 Jan 23 07:23 Revision: aead93f8d1ea69997f4f284c2a4738c5631918eb Summary: Merge branch '2022.2' into 2022.3 TeamCity URL: https://ci.mcdev.io/viewModification.html?tab=vcsModificationFiles&modId=8275&personal=false Index: build.gradle.kts =================================================================== --- build.gradle.kts (revision 6eb6d5c73990cf67f469de662567c640e88593fb) +++ build.gradle.kts (revision aead93f8d1ea69997f4f284c2a4738c5631918eb) @@ -3,7 +3,7 @@ * * https://minecraftdev.org * - * Copyright (c) 2022 minecraft-dev + * Copyright (c) 2023 minecraft-dev * * MIT License */ @@ -17,12 +17,12 @@ import org.jlleitschuh.gradle.ktlint.tasks.BaseKtLintCheckTask plugins { - kotlin("jvm") version "1.7.20" + kotlin("jvm") version "1.8.0" java mcdev groovy idea - id("org.jetbrains.intellij") version "1.9.0" + id("org.jetbrains.intellij") version "1.12.0" id("org.cadixdev.licenser") id("org.jlleitschuh.gradle.ktlint") version "10.3.0" } @@ -243,27 +243,7 @@ } } systemProperty("NO_FS_ROOTS_ACCESS_CHECK", "true") - - jvmArgs( - "-Dsun.io.useCanonCaches=false", - "-Dsun.io.useCanonPrefixCache=false", - "--add-opens", "java.base/java.io=ALL-UNNAMED", - "--add-opens", "java.base/java.lang.invoke=ALL-UNNAMED", - "--add-opens", "java.base/java.lang.ref=ALL-UNNAMED", - "--add-opens", "java.base/java.lang.reflect=ALL-UNNAMED", - "--add-opens", "java.base/java.lang=ALL-UNNAMED", - "--add-opens", "java.base/java.util.concurrent.atomic=ALL-UNNAMED", - "--add-opens", "java.base/java.util.concurrent.locks=ALL-UNNAMED", - "--add-opens", "java.base/java.util.concurrent=ALL-UNNAMED", - "--add-opens", "java.base/sun.nio.fs=ALL-UNNAMED", - "--add-opens", "java.desktop/java.awt.event=ALL-UNNAMED", - "--add-opens", "java.desktop/java.awt=ALL-UNNAMED", - "--add-opens", "java.desktop/javax.swing.plaf.basic=ALL-UNNAMED", - "--add-opens", "java.desktop/javax.swing=ALL-UNNAMED", - "--add-opens", "java.desktop/sun.awt=ALL-UNNAMED", - "--add-opens", "java.desktop/sun.font=ALL-UNNAMED", - "--add-opens", "java.desktop/sun.swing=ALL-UNNAMED", - ) + jvmArgs("--illegal-access=deny") } idea { @@ -366,7 +346,6 @@ tasks.runIde { maxHeapSize = "4G" - jvmArgs("--add-exports=java.base/jdk.internal.vm=ALL-UNNAMED") System.getProperty("debug")?.let { systemProperty("idea.ProcessCanceledException", "disabled") systemProperty("idea.debug.mode", "true") Index: gradle.properties =================================================================== --- gradle.properties (revision 6eb6d5c73990cf67f469de662567c640e88593fb) +++ gradle.properties (revision aead93f8d1ea69997f4f284c2a4738c5631918eb) @@ -3,7 +3,7 @@ # # https://minecraftdev.org # -# Copyright (c) 2022 minecraft-dev +# Copyright (c) 2023 minecraft-dev # # MIT License # @@ -14,10 +14,10 @@ ideaVersion = 2022.3 ideaVersionName = 2022.3 -coreVersion = 1.5.21 +coreVersion = 1.5.22 downloadIdeaSources = true pluginTomlVersion = 223.7571.59 # Silences a build-time warning because we are bundling our own kotlin library -kotlin.stdlib.default.dependency = true +kotlin.stdlib.default.dependency = false Index: src/main/kotlin/creator/MinecraftModuleBuilder.kt =================================================================== --- src/main/kotlin/creator/MinecraftModuleBuilder.kt (revision 6eb6d5c73990cf67f469de662567c640e88593fb) +++ src/main/kotlin/creator/MinecraftModuleBuilder.kt (revision aead93f8d1ea69997f4f284c2a4738c5631918eb) @@ -3,7 +3,7 @@ * * https://minecraftdev.org * - * Copyright (c) 2022 minecraft-dev + * Copyright (c) 2023 minecraft-dev * * MIT License */ Index: src/main/kotlin/errorreporter/AnonymousFeedback.kt =================================================================== --- src/main/kotlin/errorreporter/AnonymousFeedback.kt (revision 6eb6d5c73990cf67f469de662567c640e88593fb) +++ src/main/kotlin/errorreporter/AnonymousFeedback.kt (revision aead93f8d1ea69997f4f284c2a4738c5631918eb) @@ -3,7 +3,7 @@ * * https://minecraftdev.org * - * Copyright (c) 2022 minecraft-dev + * Copyright (c) 2023 minecraft-dev * * MIT License */ Index: src/main/kotlin/inspection/WrongEntityDataParameterClassInspection.kt =================================================================== --- src/main/kotlin/inspection/WrongEntityDataParameterClassInspection.kt (revision 6eb6d5c73990cf67f469de662567c640e88593fb) +++ src/main/kotlin/inspection/WrongEntityDataParameterClassInspection.kt (revision aead93f8d1ea69997f4f284c2a4738c5631918eb) @@ -3,7 +3,7 @@ * * https://minecraftdev.org * - * Copyright (c) 2022 minecraft-dev + * Copyright (c) 2023 minecraft-dev * * MIT License */ Index: src/main/kotlin/platform/forge/inspections/sideonly/RemoveAnnotationInspectionGadgetsFix.kt =================================================================== --- src/main/kotlin/platform/forge/inspections/sideonly/RemoveAnnotationInspectionGadgetsFix.kt (revision 6eb6d5c73990cf67f469de662567c640e88593fb) +++ src/main/kotlin/platform/forge/inspections/sideonly/RemoveAnnotationInspectionGadgetsFix.kt (revision aead93f8d1ea69997f4f284c2a4738c5631918eb) @@ -3,7 +3,7 @@ * * https://minecraftdev.org * - * Copyright (c) 2022 minecraft-dev + * Copyright (c) 2023 minecraft-dev * * MIT License */ Index: src/main/kotlin/platform/forge/inspections/sideonly/VariableUseSideOnlyInspection.kt =================================================================== --- src/main/kotlin/platform/forge/inspections/sideonly/VariableUseSideOnlyInspection.kt (revision 6eb6d5c73990cf67f469de662567c640e88593fb) +++ src/main/kotlin/platform/forge/inspections/sideonly/VariableUseSideOnlyInspection.kt (revision aead93f8d1ea69997f4f284c2a4738c5631918eb) @@ -3,7 +3,7 @@ * * https://minecraftdev.org * - * Copyright (c) 2022 minecraft-dev + * Copyright (c) 2023 minecraft-dev * * MIT License */ Index: src/main/kotlin/platform/forge/inspections/simpleimpl/AddEmptyConstructorInspectionGadgetsFix.kt =================================================================== --- src/main/kotlin/platform/forge/inspections/simpleimpl/AddEmptyConstructorInspectionGadgetsFix.kt (revision 6eb6d5c73990cf67f469de662567c640e88593fb) +++ src/main/kotlin/platform/forge/inspections/simpleimpl/AddEmptyConstructorInspectionGadgetsFix.kt (revision aead93f8d1ea69997f4f284c2a4738c5631918eb) @@ -3,7 +3,7 @@ * * https://minecraftdev.org * - * Copyright (c) 2022 minecraft-dev + * Copyright (c) 2023 minecraft-dev * * MIT License */ Index: src/main/kotlin/platform/mixin/inspection/UnusedMixinInspection.kt =================================================================== --- src/main/kotlin/platform/mixin/inspection/UnusedMixinInspection.kt (revision 6eb6d5c73990cf67f469de662567c640e88593fb) +++ src/main/kotlin/platform/mixin/inspection/UnusedMixinInspection.kt (revision aead93f8d1ea69997f4f284c2a4738c5631918eb) @@ -3,7 +3,7 @@ * * https://minecraftdev.org * - * Copyright (c) 2022 minecraft-dev + * Copyright (c) 2023 minecraft-dev * * MIT License */ Index: src/main/kotlin/platform/mixin/util/AsmUtil.kt =================================================================== --- src/main/kotlin/platform/mixin/util/AsmUtil.kt (revision 6eb6d5c73990cf67f469de662567c640e88593fb) +++ src/main/kotlin/platform/mixin/util/AsmUtil.kt (revision aead93f8d1ea69997f4f284c2a4738c5631918eb) @@ -3,7 +3,7 @@ * * https://minecraftdev.org * - * Copyright (c) 2022 minecraft-dev + * Copyright (c) 2023 minecraft-dev * * MIT License */ @@ -22,12 +22,12 @@ import com.demonwav.mcdev.util.fullQualifiedName import com.demonwav.mcdev.util.hasSyntheticMethod import com.demonwav.mcdev.util.isErasureEquivalentTo +import com.demonwav.mcdev.util.loggerForTopLevel import com.demonwav.mcdev.util.mapToArray import com.demonwav.mcdev.util.realName import com.demonwav.mcdev.util.toJavaIdentifier import com.intellij.codeEditor.JavaEditorFileSwapper import com.intellij.ide.highlighter.JavaFileType -import com.intellij.openapi.diagnostic.Logger import com.intellij.openapi.module.Module import com.intellij.openapi.progress.ProcessCanceledException import com.intellij.openapi.project.Project @@ -79,7 +79,7 @@ import org.objectweb.asm.tree.MethodNode import org.objectweb.asm.tree.VarInsnNode -private val LOGGER = Logger.getInstance("AsmUtil") +private val LOGGER = loggerForTopLevel() private val MODIFIER_TO_ACCESS_FLAG = mapOf( entry(PsiModifier.PUBLIC, Opcodes.ACC_PUBLIC), Index: src/main/kotlin/platform/mixin/util/LocalVariables.kt =================================================================== --- src/main/kotlin/platform/mixin/util/LocalVariables.kt (revision 6eb6d5c73990cf67f469de662567c640e88593fb) +++ src/main/kotlin/platform/mixin/util/LocalVariables.kt (revision aead93f8d1ea69997f4f284c2a4738c5631918eb) @@ -3,7 +3,7 @@ * * https://minecraftdev.org * - * Copyright (c) 2022 minecraft-dev + * Copyright (c) 2023 minecraft-dev * * MIT License */ Index: src/main/kotlin/util/utils.kt =================================================================== --- src/main/kotlin/util/utils.kt (revision 6eb6d5c73990cf67f469de662567c640e88593fb) +++ src/main/kotlin/util/utils.kt (revision aead93f8d1ea69997f4f284c2a4738c5631918eb) @@ -3,7 +3,7 @@ * * https://minecraftdev.org * - * Copyright (c) 2022 minecraft-dev + * Copyright (c) 2023 minecraft-dev * * MIT License */ @@ -18,6 +18,7 @@ import com.intellij.openapi.application.ModalityState import com.intellij.openapi.application.runReadAction import com.intellij.openapi.command.WriteCommandAction +import com.intellij.openapi.diagnostic.Logger import com.intellij.openapi.module.Module import com.intellij.openapi.module.ModuleManager import com.intellij.openapi.progress.ProcessCanceledException @@ -32,6 +33,7 @@ import com.intellij.pom.java.LanguageLevel import com.intellij.psi.PsiDocumentManager import com.intellij.psi.PsiFile +import java.lang.invoke.MethodHandles import java.util.Locale import kotlin.math.min import kotlin.reflect.KClass @@ -344,3 +346,8 @@ } fun String.decapitalize(): String = replaceFirstChar { it.lowercase(Locale.ENGLISH) } + +// Bit of a hack, but this allows us to get the class object for top level declarations without having to +// put the whole class name in as a string (easier to refactor, etc.) +@Suppress("NOTHING_TO_INLINE") // In order for this to work this function must be `inline` +inline fun loggerForTopLevel() = Logger.getInstance(MethodHandles.lookup().lookupClass())