diff --git a/gradle.properties b/gradle.properties index 1881bd4ad..d960706b3 100644 --- a/gradle.properties +++ b/gradle.properties @@ -24,7 +24,7 @@ kotlin.code.style=official ideaVersion = 2023.3 ideaVersionName = 2023.3 -coreVersion = 1.6.11 +coreVersion = 1.6.12 downloadIdeaSources = true pluginTomlVersion = 233.11799.172 diff --git a/readme.md b/readme.md index 311f37099..e83184cc6 100644 --- a/readme.md +++ b/readme.md @@ -11,10 +11,6 @@ Minecraft Development for IntelliJ Main Build Teamcity Build Status - - 2022.3 - 2022.3 Nightly Status - 2023.1 2023.1 Nightly Status @@ -35,7 +31,7 @@ Minecraft Development for IntelliJ -Info and Documentation [![Current Release](https://img.shields.io/badge/release-1.6.11-orange.svg?style=flat-square)](https://plugins.jetbrains.com/plugin/8327) +Info and Documentation [![Current Release](https://img.shields.io/badge/release-1.6.12-orange.svg?style=flat-square)](https://plugins.jetbrains.com/plugin/8327) ---------------------- diff --git a/src/main/kotlin/MinecraftConfigurable.kt b/src/main/kotlin/MinecraftConfigurable.kt index cc64b7b37..4d0fb0c1d 100644 --- a/src/main/kotlin/MinecraftConfigurable.kt +++ b/src/main/kotlin/MinecraftConfigurable.kt @@ -89,7 +89,8 @@ class MinecraftConfigurable : Configurable { settings.isShowEventListenerGutterIcons = showEventListenerGutterCheckBox.isSelected settings.isShowChatColorGutterIcons = showChatGutterIconsCheckBox.isSelected settings.isShowChatColorUnderlines = showChatColorUnderlinesCheckBox.isSelected - settings.underlineType = chatColorUnderlinesComboBox.selectedItem as MinecraftSettings.UnderlineType + settings.underlineType = chatColorUnderlinesComboBox.selectedItem as? MinecraftSettings.UnderlineType + ?: MinecraftSettings.UnderlineType.DOTTED } override fun reset() { diff --git a/src/main/kotlin/insight/generation/GenerateEventListenerAction.kt b/src/main/kotlin/insight/generation/GenerateEventListenerAction.kt index f7220b70c..8428cdf81 100644 --- a/src/main/kotlin/insight/generation/GenerateEventListenerAction.kt +++ b/src/main/kotlin/insight/generation/GenerateEventListenerAction.kt @@ -20,6 +20,14 @@ package com.demonwav.mcdev.insight.generation +import com.demonwav.mcdev.asset.MCDevBundle import com.intellij.codeInsight.generation.actions.BaseGenerateAction +import com.intellij.openapi.actionSystem.AnActionEvent -class GenerateEventListenerAction : BaseGenerateAction(GenerateEventListenerHandler()) +class GenerateEventListenerAction : BaseGenerateAction(GenerateEventListenerHandler()) { + + override fun update(e: AnActionEvent) { + super.update(e) + e.presentation.text = MCDevBundle("generate.event_listener.title") + } +} diff --git a/src/main/kotlin/platform/bukkit/creator/bukkit-platforms.kt b/src/main/kotlin/platform/bukkit/creator/bukkit-platforms.kt index a180ce750..0815c03f4 100644 --- a/src/main/kotlin/platform/bukkit/creator/bukkit-platforms.kt +++ b/src/main/kotlin/platform/bukkit/creator/bukkit-platforms.kt @@ -26,8 +26,10 @@ import com.demonwav.mcdev.platform.PlatformType import com.demonwav.mcdev.util.MinecraftTemplates import com.demonwav.mcdev.util.MinecraftVersions import com.demonwav.mcdev.util.SemanticVersion +import com.intellij.icons.AllIcons import com.intellij.openapi.observable.util.bindBooleanStorage import com.intellij.openapi.ui.validation.WHEN_GRAPH_PROPAGATION_FINISHED +import com.intellij.ui.content.AlertIcon import com.intellij.ui.dsl.builder.Panel import com.intellij.ui.dsl.builder.bindSelected @@ -74,7 +76,11 @@ class PaperPlatformStep(parent: BukkitPlatformStep) : AbstractBukkitPlatformStep override fun setupUI(builder: Panel) { super.setupUI(builder) with(builder) { - row("Paper manifest:") { + row("Paper Manifest:") { + icon(AlertIcon(AllIcons.General.Warning)).comment( + "Paper plugins are " + + "still experimental, their usage is discouraged for general purpose development. " + ) checkBox("Use paper-plugin.yml") .bindSelected(usePaperManifestProperty) .validationRequestor(WHEN_GRAPH_PROPAGATION_FINISHED(propertyGraph)) diff --git a/src/main/kotlin/platform/mixin/action/GenerateOverwriteAction.kt b/src/main/kotlin/platform/mixin/action/GenerateOverwriteAction.kt index b6127e9e9..2577b2e9a 100644 --- a/src/main/kotlin/platform/mixin/action/GenerateOverwriteAction.kt +++ b/src/main/kotlin/platform/mixin/action/GenerateOverwriteAction.kt @@ -127,11 +127,10 @@ class GenerateOverwriteAction : MixinCodeInsightAction() { return } - // Generate needed shadows - val newShadows = createShadowMembers(project, psiClass, filterNewShadows(requiredMembers, psiClass)) - disableAnnotationWrapping(project) { runWriteAction { + // Generate needed shadows + val newShadows = createShadowMembers(project, psiClass, filterNewShadows(requiredMembers, psiClass)) // Insert shadows insertShadows(psiClass, newShadows) } diff --git a/src/main/kotlin/platform/mixin/handlers/injectionPoint/MethodInjectionPoint.kt b/src/main/kotlin/platform/mixin/handlers/injectionPoint/InvokeInjectionPoint.kt similarity index 90% rename from src/main/kotlin/platform/mixin/handlers/injectionPoint/MethodInjectionPoint.kt rename to src/main/kotlin/platform/mixin/handlers/injectionPoint/InvokeInjectionPoint.kt index e83b1a36a..dd62f10c3 100644 --- a/src/main/kotlin/platform/mixin/handlers/injectionPoint/MethodInjectionPoint.kt +++ b/src/main/kotlin/platform/mixin/handlers/injectionPoint/InvokeInjectionPoint.kt @@ -37,7 +37,7 @@ import org.objectweb.asm.tree.ClassNode import org.objectweb.asm.tree.MethodInsnNode import org.objectweb.asm.tree.MethodNode -class MethodInjectionPoint : AbstractMethodInjectionPoint() { +abstract class AbstractInvokeInjectionPoint(private val assign: Boolean) : AbstractMethodInjectionPoint() { override fun createNavigationVisitor( at: PsiAnnotation, target: MixinSelector?, @@ -53,9 +53,9 @@ class MethodInjectionPoint : AbstractMethodInjectionPoint() { mode: CollectVisitor.Mode, ): CollectVisitor? { if (mode == CollectVisitor.Mode.COMPLETION) { - return MyCollectVisitor(mode, at.project, MemberReference("")) + return MyCollectVisitor(mode, at.project, MemberReference(""), assign) } - return target?.let { MyCollectVisitor(mode, at.project, it) } + return target?.let { MyCollectVisitor(mode, at.project, it, assign) } } private class MyNavigationVisitor( @@ -141,6 +141,7 @@ class MethodInjectionPoint : AbstractMethodInjectionPoint() { mode: Mode, private val project: Project, private val selector: MixinSelector, + private val assign: Boolean, ) : CollectVisitor(mode) { override fun accept(methodNode: MethodNode) { val insns = methodNode.instructions ?: return @@ -150,12 +151,19 @@ class MethodInjectionPoint : AbstractMethodInjectionPoint() { } val sourceMethod = nodeMatchesSelector(insn, mode, selector, project) ?: return@forEachRemaining - addResult( - insn, - sourceMethod, - qualifier = insn.owner.replace('/', '.'), - ) + val actualInsn = if (assign) insn.next else insn + if (actualInsn != null) { + addResult( + actualInsn, + sourceMethod, + qualifier = insn.owner.replace('/', '.'), + ) + } } } } } + +class InvokeInjectionPoint : AbstractInvokeInjectionPoint(false) + +class InvokeAssignInjectionPoint : AbstractInvokeInjectionPoint(true) diff --git a/src/main/kotlin/platform/mixin/handlers/mixinextras/MixinExtrasInjectorAnnotationHandler.kt b/src/main/kotlin/platform/mixin/handlers/mixinextras/MixinExtrasInjectorAnnotationHandler.kt index 4214a0b18..f51107c77 100644 --- a/src/main/kotlin/platform/mixin/handlers/mixinextras/MixinExtrasInjectorAnnotationHandler.kt +++ b/src/main/kotlin/platform/mixin/handlers/mixinextras/MixinExtrasInjectorAnnotationHandler.kt @@ -149,7 +149,7 @@ abstract class MixinExtrasInjectorAnnotationHandler : InjectorAnnotationHandler( .resolveAsm(annotation.project) as? MethodTargetMember )?.classAndMethod sourceClassAndMethod?.method?.getGenericReturnType(sourceClassAndMethod.clazz, annotation.project) - ?: Type.getType(insn.desc).toPsiType(elementFactory) + ?: Type.getReturnType(insn.desc).toPsiType(elementFactory) } is FieldInsnNode -> { diff --git a/src/main/kotlin/platform/mixin/inspection/injector/InvalidInjectorMethodSignatureInspection.kt b/src/main/kotlin/platform/mixin/inspection/injector/InvalidInjectorMethodSignatureInspection.kt index 1b93da3c2..182c37246 100644 --- a/src/main/kotlin/platform/mixin/inspection/injector/InvalidInjectorMethodSignatureInspection.kt +++ b/src/main/kotlin/platform/mixin/inspection/injector/InvalidInjectorMethodSignatureInspection.kt @@ -47,11 +47,13 @@ import com.intellij.psi.PsiClassType import com.intellij.psi.PsiElementVisitor import com.intellij.psi.PsiMethod import com.intellij.psi.PsiModifier +import com.intellij.psi.PsiNameHelper import com.intellij.psi.PsiParameterList import com.intellij.psi.PsiPrimitiveType import com.intellij.psi.PsiType import com.intellij.psi.codeStyle.JavaCodeStyleManager import com.intellij.psi.codeStyle.VariableKind +import com.intellij.psi.util.PsiUtil import com.intellij.psi.util.TypeConversionUtil import org.objectweb.asm.Opcodes import org.objectweb.asm.tree.AbstractInsnNode @@ -318,13 +320,15 @@ class InvalidInjectorMethodSignatureInspection : MixinInspection() { val newParams = expected.flatMapTo(mutableListOf()) { if (it.default) { + val nameHelper = PsiNameHelper.getInstance(project) + val languageLevel = PsiUtil.getLanguageLevel(parameters) it.parameters.mapIndexed { i: Int, p: Parameter -> - JavaPsiFacade.getElementFactory(project).createParameter( - p.name ?: JavaCodeStyleManager.getInstance(project) + val paramName = p.name?.takeIf { name -> nameHelper.isIdentifier(name, languageLevel) } + ?: JavaCodeStyleManager.getInstance(project) .suggestVariableName(VariableKind.PARAMETER, null, null, p.type).names - .firstOrNull() ?: "var$i", - p.type, - ) + .firstOrNull() + ?: "var$i" + JavaPsiFacade.getElementFactory(project).createParameter(paramName, p.type) } } else { emptyList() diff --git a/src/main/kotlin/platform/mixin/inspection/mixinextras/UnnecessaryMutableLocalInspection.kt b/src/main/kotlin/platform/mixin/inspection/mixinextras/UnnecessaryMutableLocalInspection.kt new file mode 100644 index 000000000..06c14f2f8 --- /dev/null +++ b/src/main/kotlin/platform/mixin/inspection/mixinextras/UnnecessaryMutableLocalInspection.kt @@ -0,0 +1,198 @@ +/* + * Minecraft Development for IntelliJ + * + * https://mcdev.io/ + * + * Copyright (C) 2023 minecraft-dev + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published + * by the Free Software Foundation, version 3.0 only. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.demonwav.mcdev.platform.mixin.inspection.mixinextras + +import com.demonwav.mcdev.platform.mixin.handlers.InjectorAnnotationHandler +import com.demonwav.mcdev.platform.mixin.handlers.MixinAnnotationHandler +import com.demonwav.mcdev.platform.mixin.handlers.mixinextras.WrapOperationHandler +import com.demonwav.mcdev.platform.mixin.inspection.MixinInspection +import com.demonwav.mcdev.platform.mixin.util.MixinConstants +import com.demonwav.mcdev.util.findContainingMethod +import com.intellij.codeInspection.LocalQuickFixOnPsiElement +import com.intellij.codeInspection.ProblemsHolder +import com.intellij.openapi.project.Project +import com.intellij.psi.JavaElementVisitor +import com.intellij.psi.PsiClass +import com.intellij.psi.PsiClassType +import com.intellij.psi.PsiElement +import com.intellij.psi.PsiElementFactory +import com.intellij.psi.PsiExpressionList +import com.intellij.psi.PsiFile +import com.intellij.psi.PsiMethod +import com.intellij.psi.PsiMethodCallExpression +import com.intellij.psi.PsiParameter +import com.intellij.psi.PsiReferenceExpression +import com.intellij.psi.PsiType +import com.intellij.psi.PsiTypes +import com.intellij.psi.search.searches.OverridingMethodsSearch +import com.intellij.psi.search.searches.ReferencesSearch +import com.intellij.psi.util.PsiUtil +import com.intellij.psi.util.parentOfType +import com.siyeh.ig.psiutils.MethodCallUtils +import org.jetbrains.plugins.groovy.intentions.style.inference.resolve + +class UnnecessaryMutableLocalInspection : MixinInspection() { + override fun getStaticDescription() = "Unnecessary mutable reference to captured local" + + override fun buildVisitor(holder: ProblemsHolder) = object : JavaElementVisitor() { + override fun visitMethod(method: PsiMethod) { + val project = method.project + val hasValidMixinAnnotation = method.annotations.any { ann -> + ann.qualifiedName?.let { MixinAnnotationHandler.forMixinAnnotation(it, project) } + // Mutable Local references do have different semantics inside a WrapOperation. + ?.let { it is InjectorAnnotationHandler && it !is WrapOperationHandler } == true + } + if (!hasValidMixinAnnotation) { + return + } + + // ignore if method has any references + val hasReferences = ReferencesSearch.search(method) + .mapNotNull { PsiUtil.skipParenthesizedExprUp(it.element).parent as? PsiMethodCallExpression } + .any { !MethodCallUtils.hasSuperQualifier(it) } + if (hasReferences) { + return + } + + for ((i, param) in method.parameterList.parameters.withIndex()) { + if (!param.hasAnnotation(MixinConstants.MixinExtras.LOCAL)) { + continue + } + val paramType = param.type.resolve() + if (paramType?.qualifiedName?.startsWith(MixinConstants.MixinExtras.LOCAL_REF_PACKAGE) != true) { + continue + } + + checkParameter(holder, method, param, i, paramType) + } + } + } + + private fun checkParameter( + holder: ProblemsHolder, + originalMethod: PsiMethod, + originalParam: PsiParameter, + paramIndex: Int, + paramType: PsiClass + ) { + var hasAnyGets = false + for (method in OverridingMethodsSearch.search(originalMethod).findAll() + listOf(originalMethod)) { + val param = method.parameterList.getParameter(paramIndex) ?: return + val getMethod = paramType.findMethodsByName("get", false).firstOrNull() ?: return + for (ref in ReferencesSearch.search(param)) { + if (isDelegationToSuper(ref.element, paramIndex)) { + continue + } + val parent = PsiUtil.skipParenthesizedExprUp(ref.element.parent) as? PsiReferenceExpression ?: return + if (parent.references.any { it.isReferenceTo(getMethod) }) { + hasAnyGets = true + } else { + return + } + } + } + if (!hasAnyGets) { + // Don't annoy them if they've just made the parameter + return + } + holder.registerProblem( + originalParam.typeElement ?: originalParam, + "@Local could be captured immutably", + SwitchToImmutableCaptureFix(originalParam) + ) + } + + // Ignore super delegations in subclasses. super.foo(myLocalRef) has no effect on whether the local can be converted + private fun isDelegationToSuper(ref: PsiElement, paramIndex: Int): Boolean { + val method = ref.findContainingMethod() ?: return false + val superMethod = method.findSuperMethods().firstOrNull { it.containingClass?.isInterface == false } + ?: return false + + // For some reason ref is sometimes the identifier rather than the reference expression. Get the reference expr + val actualRef = if (ref is PsiReferenceExpression) { + ref + } else { + PsiUtil.skipParenthesizedExprUp(ref.parent) as? PsiReferenceExpression ?: return false + } + val param = PsiUtil.skipParenthesizedExprUp(actualRef) + val paramList = param.parent as? PsiExpressionList ?: return false + val methodCall = paramList.parent as? PsiMethodCallExpression ?: return false + + // Check that the method call is a super call + if (!MethodCallUtils.hasSuperQualifier(methodCall)) { + return false + } + + // Check that our reference is in the correct parameter index + if (paramList.expressions.getOrNull(paramIndex) != param) { + return false + } + + // Check that the super call is referencing the correct super method. + return methodCall.resolveMethod() == superMethod + } + + private class SwitchToImmutableCaptureFix(param: PsiParameter) : LocalQuickFixOnPsiElement(param) { + override fun getFamilyName() = "Switch to immutable capture" + override fun getText() = "Switch to immutable capture" + + override fun invoke(project: Project, file: PsiFile, startElement: PsiElement, endElement: PsiElement) { + val param = startElement as? PsiParameter ?: return + val method = param.parentOfType() ?: return + val paramIndex = method.parameterList.getParameterIndex(param) + val methods = mutableListOf(method) + if (file.isPhysical) { + methods.addAll(OverridingMethodsSearch.search(method)) + } + for (impl in methods) { + fixMethod(impl, paramIndex) + } + } + + private fun fixMethod(method: PsiMethod, paramIndex: Int) { + val param = method.parameterList.getParameter(paramIndex) ?: return + val paramType = param.type as? PsiClassType ?: return + val innerType = paramType.innerRefType ?: return + val factory = PsiElementFactory.getInstance(method.project) + param.typeElement?.replace(factory.createTypeElement(innerType)) + for (ref in ReferencesSearch.search(param)) { + val refExpression = PsiUtil.skipParenthesizedExprUp(ref.element.parent) as? PsiReferenceExpression + ?: continue + val call = refExpression.parent as? PsiMethodCallExpression ?: continue + call.replace(ref.element) + } + } + + private val PsiClassType.innerRefType: PsiType? + get() = + when (resolve()?.qualifiedName?.substringAfterLast('.')) { + "LocalBooleanRef" -> PsiTypes.booleanType() + "LocalCharRef" -> PsiTypes.charType() + "LocalDoubleRef" -> PsiTypes.doubleType() + "LocalFloatRef" -> PsiTypes.floatType() + "LocalIntRef" -> PsiTypes.intType() + "LocalLongRef" -> PsiTypes.longType() + "LocalShortRef" -> PsiTypes.shortType() + "LocalRef" -> parameters.getOrNull(0) + else -> null + } + } +} diff --git a/src/main/kotlin/platform/mixin/util/AsmDfaUtil.kt b/src/main/kotlin/platform/mixin/util/AsmDfaUtil.kt index a9bfb1294..f6a42695f 100644 --- a/src/main/kotlin/platform/mixin/util/AsmDfaUtil.kt +++ b/src/main/kotlin/platform/mixin/util/AsmDfaUtil.kt @@ -22,6 +22,7 @@ package com.demonwav.mcdev.platform.mixin.util import com.demonwav.mcdev.util.internalName import com.intellij.openapi.diagnostic.thisLogger +import com.intellij.openapi.progress.ProcessCanceledException import com.intellij.openapi.project.Project import com.intellij.psi.JavaPsiFacade import com.intellij.psi.PsiClassType @@ -53,6 +54,10 @@ object AsmDfaUtil { ), ).analyze(clazz.name, method) } catch (e: AnalyzerException) { + val cause = e.cause + if (cause is ProcessCanceledException) { + throw cause + } LOGGER.warn("AsmDfaUtil.analyzeMethod failed", e) null } diff --git a/src/main/kotlin/platform/mixin/util/MixinConstants.kt b/src/main/kotlin/platform/mixin/util/MixinConstants.kt index 57587f322..d491d49f0 100644 --- a/src/main/kotlin/platform/mixin/util/MixinConstants.kt +++ b/src/main/kotlin/platform/mixin/util/MixinConstants.kt @@ -79,5 +79,7 @@ object MixinConstants { object MixinExtras { const val OPERATION = "com.llamalad7.mixinextras.injector.wrapoperation.Operation" const val WRAP_OPERATION = "com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation" + const val LOCAL = "com.llamalad7.mixinextras.sugar.Local" + const val LOCAL_REF_PACKAGE = "com.llamalad7.mixinextras.sugar.ref." } } diff --git a/src/main/kotlin/toml/platform/forge/inspections/ModsTomlValidationInspection.kt b/src/main/kotlin/toml/platform/forge/inspections/ModsTomlValidationInspection.kt index 920df2f2b..101663f68 100644 --- a/src/main/kotlin/toml/platform/forge/inspections/ModsTomlValidationInspection.kt +++ b/src/main/kotlin/toml/platform/forge/inspections/ModsTomlValidationInspection.kt @@ -72,7 +72,9 @@ class ModsTomlValidationInspection : LocalInspectionTool() { "modId" -> { val value = keyValue.value ?: return val modId = value.stringValue() ?: return - if (modId != "\"" && !ForgeConstants.MOD_ID_REGEX.matches(modId)) { + if (modId != "\"" && !(modId.startsWith("\${") && modId.endsWith("}")) && + !ForgeConstants.MOD_ID_REGEX.matches(modId) + ) { val endOffset = if (value.text.endsWith('"')) modId.length + 1 else modId.length holder.registerProblem(value, TextRange(1, endOffset), "Mod ID is invalid") } diff --git a/src/main/kotlin/toml/platform/forge/reference/ModsTomlReferenceContributor.kt b/src/main/kotlin/toml/platform/forge/reference/ModsTomlReferenceContributor.kt index e1ad1ccb2..0ce3ad803 100644 --- a/src/main/kotlin/toml/platform/forge/reference/ModsTomlReferenceContributor.kt +++ b/src/main/kotlin/toml/platform/forge/reference/ModsTomlReferenceContributor.kt @@ -117,6 +117,11 @@ class ModsTomlDependencyIdReference(keySegment: TomlKeySegment) : PsiReferenceBa object ModsTomlModIdReferenceProvider : PsiReferenceProvider() { override fun getReferencesByElement(element: PsiElement, context: ProcessingContext): Array { val value = element as? TomlValue ?: return PsiReference.EMPTY_ARRAY + val stringValue = value.stringValue() + if (stringValue != null && stringValue.startsWith("\${") && stringValue.endsWith("}")) { + return PsiReference.EMPTY_ARRAY + } + return arrayOf(ModsTomlModIdReference(value)) } } diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml index 6a2e8fef5..f6db721f2 100644 --- a/src/main/resources/META-INF/plugin.xml +++ b/src/main/resources/META-INF/plugin.xml @@ -142,8 +142,8 @@ - - + + @@ -980,6 +980,14 @@ level="ERROR" hasStaticDescription="true" implementationClass="com.demonwav.mcdev.platform.mixin.inspection.mixinextras.WrongOperationParametersInspection"/> + diff --git a/src/main/resources/fileTemplates/j2ee/architectury/architectury_build.gradle.ft b/src/main/resources/fileTemplates/j2ee/architectury/architectury_build.gradle.ft index 8c4590a4d..1a3269046 100644 --- a/src/main/resources/fileTemplates/j2ee/architectury/architectury_build.gradle.ft +++ b/src/main/resources/fileTemplates/j2ee/architectury/architectury_build.gradle.ft @@ -42,7 +42,7 @@ allprojects { tasks.withType(JavaCompile) { options.encoding = "UTF-8" - options.release = ${JAVA_VERSION} + options.release.set(${JAVA_VERSION}) } java { diff --git a/src/main/resources/fileTemplates/j2ee/bukkit/Bukkit build.gradle.ft b/src/main/resources/fileTemplates/j2ee/bukkit/Bukkit build.gradle.ft index b284016fa..cb6cf20e2 100644 --- a/src/main/resources/fileTemplates/j2ee/bukkit/Bukkit build.gradle.ft +++ b/src/main/resources/fileTemplates/j2ee/bukkit/Bukkit build.gradle.ft @@ -24,7 +24,7 @@ java { tasks.withType(JavaCompile).configureEach { if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) { - options.release = targetJavaVersion + options.release.set(targetJavaVersion) } } diff --git a/src/main/resources/fileTemplates/j2ee/bungeecord/BungeeCord build.gradle.ft b/src/main/resources/fileTemplates/j2ee/bungeecord/BungeeCord build.gradle.ft index 1079507d1..a38a3aec8 100644 --- a/src/main/resources/fileTemplates/j2ee/bungeecord/BungeeCord build.gradle.ft +++ b/src/main/resources/fileTemplates/j2ee/bungeecord/BungeeCord build.gradle.ft @@ -22,7 +22,7 @@ java { tasks.withType(JavaCompile).configureEach { if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) { - options.release = targetJavaVersion + options.release.set(targetJavaVersion) } } diff --git a/src/main/resources/fileTemplates/j2ee/fabric/fabric_build.gradle.ft b/src/main/resources/fileTemplates/j2ee/fabric/fabric_build.gradle.ft index 24e501100..9b8508288 100644 --- a/src/main/resources/fileTemplates/j2ee/fabric/fabric_build.gradle.ft +++ b/src/main/resources/fileTemplates/j2ee/fabric/fabric_build.gradle.ft @@ -51,7 +51,7 @@ tasks.withType(JavaCompile).configureEach { // If Javadoc is generated, this must be specified in that task too. it.options.encoding = "UTF-8" if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) { - it.options.release = targetJavaVersion + it.options.release.set(targetJavaVersion) } } diff --git a/src/main/resources/fileTemplates/j2ee/forge/Forge (1.13+) build.gradle.ft b/src/main/resources/fileTemplates/j2ee/forge/Forge (1.13+) build.gradle.ft index 8441e3fda..a402739b7 100644 --- a/src/main/resources/fileTemplates/j2ee/forge/Forge (1.13+) build.gradle.ft +++ b/src/main/resources/fileTemplates/j2ee/forge/Forge (1.13+) build.gradle.ft @@ -21,8 +21,8 @@ plugins { apply plugin: 'org.spongepowered.mixin' #end -group = mod_version -version = mod_group_id +group = mod_group_id +version = mod_version base { archivesName = mod_id diff --git a/src/main/resources/fileTemplates/j2ee/velocity/Velocity build.gradle.ft b/src/main/resources/fileTemplates/j2ee/velocity/Velocity build.gradle.ft index 336743baa..af27f6dc1 100644 --- a/src/main/resources/fileTemplates/j2ee/velocity/Velocity build.gradle.ft +++ b/src/main/resources/fileTemplates/j2ee/velocity/Velocity build.gradle.ft @@ -25,7 +25,7 @@ java { tasks.withType(JavaCompile).configureEach { if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) { - options.release = targetJavaVersion + options.release.set(targetJavaVersion) } }