Skip to content

Commit 87677a6

Browse files
committed
Merge branch '2023.3' into 2024.1
2 parents 9a0d413 + 370a370 commit 87677a6

File tree

106 files changed

+2372
-1004
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+2372
-1004
lines changed

build.gradle.kts

+3-5
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ dependencies {
118118

119119
implementation(libs.mixinExtras.expressions)
120120
testLibs(libs.mixinExtras.common)
121-
implementation("org.ow2.asm:asm-util:9.3")
122121

123122
// Kotlin
124123
implementation(kotlin("stdlib-jdk8"))
@@ -298,10 +297,9 @@ tasks.processResources {
298297
tasks.test {
299298
dependsOn(tasks.jar, testLibs)
300299
useJUnitPlatform()
301-
doFirst {
302-
testLibs.resolvedConfiguration.resolvedArtifacts.forEach {
303-
systemProperty("testLibs.${it.name}", it.file.absolutePath)
304-
}
300+
301+
testLibs.resolvedConfiguration.resolvedArtifacts.forEach {
302+
systemProperty("testLibs.${it.name}", it.file.absolutePath)
305303
}
306304
systemProperty("NO_FS_ROOTS_ACCESS_CHECK", "true")
307305
systemProperty("java.awt.headless", "true")

buildSrc/src/main/kotlin/JFlexExec.kt

+8-1
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,29 @@ import org.gradle.api.file.DirectoryProperty
2626
import org.gradle.api.file.FileCollection
2727
import org.gradle.api.file.FileSystemOperations
2828
import org.gradle.api.file.RegularFileProperty
29+
import org.gradle.api.tasks.CacheableTask
30+
import org.gradle.api.tasks.Classpath
2931
import org.gradle.api.tasks.InputFile
3032
import org.gradle.api.tasks.InputFiles
3133
import org.gradle.api.tasks.Internal
3234
import org.gradle.api.tasks.JavaExec
3335
import org.gradle.api.tasks.OutputDirectory
3436
import org.gradle.api.tasks.OutputFile
37+
import org.gradle.api.tasks.PathSensitive
38+
import org.gradle.api.tasks.PathSensitivity
3539

40+
@CacheableTask
3641
abstract class JFlexExec : JavaExec() {
3742

3843
@get:InputFile
44+
@get:PathSensitive(PathSensitivity.RELATIVE)
3945
abstract val sourceFile: RegularFileProperty
4046

41-
@get:InputFiles
47+
@get:Classpath
4248
abstract val jflex: ConfigurableFileCollection
4349

4450
@get:InputFile
51+
@get:PathSensitive(PathSensitivity.RELATIVE)
4552
abstract val skeletonFile: RegularFileProperty
4653

4754
@get:OutputDirectory

buildSrc/src/main/kotlin/ParserExec.kt

+8-5
Original file line numberDiff line numberDiff line change
@@ -24,26 +24,29 @@ import org.gradle.api.file.ConfigurableFileCollection
2424
import org.gradle.api.file.DirectoryProperty
2525
import org.gradle.api.file.FileSystemOperations
2626
import org.gradle.api.file.RegularFileProperty
27+
import org.gradle.api.tasks.CacheableTask
28+
import org.gradle.api.tasks.Classpath
2729
import org.gradle.api.tasks.InputFile
2830
import org.gradle.api.tasks.InputFiles
2931
import org.gradle.api.tasks.Internal
3032
import org.gradle.api.tasks.JavaExec
3133
import org.gradle.api.tasks.OutputDirectory
34+
import org.gradle.api.tasks.PathSensitive
35+
import org.gradle.api.tasks.PathSensitivity
3236

37+
@CacheableTask
3338
abstract class ParserExec : JavaExec() {
3439

3540
@get:InputFile
41+
@get:PathSensitive(PathSensitivity.RELATIVE)
3642
abstract val sourceFile: RegularFileProperty
3743

38-
@get:InputFiles
44+
@get:Classpath
3945
abstract val grammarKit: ConfigurableFileCollection
4046

41-
@get:OutputDirectory
47+
@get:Internal
4248
abstract val destinationRootDirectory: DirectoryProperty
4349

44-
@get:OutputDirectory
45-
abstract val destinationDirectory: DirectoryProperty
46-
4750
@get:OutputDirectory
4851
abstract val psiDirectory: DirectoryProperty
4952

buildSrc/src/main/kotlin/mcdev.gradle.kts

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import com.google.gson.Gson
2222
import com.google.gson.GsonBuilder
2323
import com.google.gson.reflect.TypeToken
2424
import java.net.HttpURLConnection
25+
import java.net.URI
2526
import java.net.URL
2627
import java.util.Properties
2728
import java.util.zip.ZipFile
@@ -94,7 +95,7 @@ tasks.register("resolveIntellijLibSources") {
9495
val groupPath = dep.groupId.replace('.', '/')
9596
val (_, artifact, ver) = dep
9697
val url = "https://repo.maven.apache.org/maven2/$groupPath/$artifact/$ver/$artifact-$ver-sources.jar"
97-
return@filter with(URL(url).openConnection() as HttpURLConnection) {
98+
return@filter with(URI.create(url).toURL().openConnection() as HttpURLConnection) {
9899
try {
99100
requestMethod = "GET"
100101
val code = responseCode

buildSrc/src/main/kotlin/util.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import org.gradle.api.JavaVersion
2424
import org.gradle.api.Project
2525
import org.gradle.api.tasks.JavaExec
2626
import org.gradle.api.tasks.TaskContainer
27+
import org.gradle.api.tasks.TaskProvider
2728
import org.gradle.kotlin.dsl.RegisteringDomainObjectDelegateProviderWithTypeAndAction
2829
import org.gradle.kotlin.dsl.getValue
2930
import org.gradle.kotlin.dsl.provideDelegate
@@ -39,8 +40,8 @@ fun Project.lexer(flex: String, pack: String): TaskDelegate<JFlexExec> {
3940

4041
return tasks.registering(JFlexExec::class) {
4142
sourceFile.set(layout.projectDirectory.file("src/main/grammars/$flex.flex"))
42-
destinationDirectory.set(layout.buildDirectory.dir("gen/$pack"))
43-
destinationFile.set(layout.buildDirectory.file("gen/$pack/$flex.java"))
43+
destinationDirectory.set(layout.buildDirectory.dir("gen/$pack/lexer"))
44+
destinationFile.set(layout.buildDirectory.file("gen/$pack/lexer/$flex.java"))
4445
logFile.set(layout.buildDirectory.file("logs/generate$flex.log"))
4546

4647
val jflex by project.configurations
@@ -61,7 +62,6 @@ fun Project.parser(bnf: String, pack: String): TaskDelegate<ParserExec> {
6162
val dest = destRoot.map { it.dir(pack) }
6263
sourceFile.set(project.layout.projectDirectory.file("src/main/grammars/$bnf.bnf"))
6364
destinationRootDirectory.set(destRoot)
64-
destinationDirectory.set(dest)
6565
psiDirectory.set(dest.map { it.dir("psi") })
6666
parserDirectory.set(dest.map { it.dir("parser") })
6767
logFile.set(layout.buildDirectory.file("logs/generate$bnf.log"))

changelog.md

+21
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,26 @@
11
# Minecraft Development for IntelliJ
22

3+
## [Unreleased]
4+
5+
### Added
6+
7+
- Access widener completion in fabric.mod.json
8+
- Event listener generation for Kotlin
9+
- `JUMP` injection point support (without source navigation)
10+
- Inspection highlighting that `JUMP` usages are discouraged
11+
- Inspection highlighting discouraged instruction shifts
12+
- Inspections for when @Inject local capture is unused and for when they can be replaced with @Local
13+
- [#2306](https://github.com/minecraft-dev/MinecraftDev/issues/2306) Use mixin icon for mixin classes
14+
15+
### Fixed
16+
17+
- [#2330](https://github.com/minecraft-dev/MinecraftDev/issues/2330) Reformat created files without keeping line breaks. Fixes the Velocity main class annotation's bad formatting.
18+
- [#2331](https://github.com/minecraft-dev/MinecraftDev/issues/2331) Support fabric.mod.json in test resources
19+
- MixinExtras occasional cache desync ([#2335](https://github.com/minecraft-dev/MinecraftDev/pull/2335))
20+
- [#2163](https://github.com/minecraft-dev/MinecraftDev/issues/2163) `@ModifyVariable` method signature checking with `STORE`
21+
- [#2282](https://github.com/minecraft-dev/MinecraftDev/issues/2282) Mixin support confusion with `$` and `.` separators in class names
22+
- Recent NeoModDev version import errors
23+
324
## [1.8.0]
425

526
This release contains two major features:

gradle/libs.versions.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ groovy = "org.codehaus.groovy:groovy-all:2.5.18"
2626
asm = { module = "org.ow2.asm:asm", version.ref = "asm" }
2727
asm-tree = { module = "org.ow2.asm:asm-tree", version.ref = "asm" }
2828
asm-analysis = { module = "org.ow2.asm:asm-analysis", version.ref = "asm" }
29+
asm-util = { module = "org.ow2.asm:asm-util", version.ref = "asm" }
2930

3031
fuel = { module = "com.github.kittinunf.fuel:fuel", version.ref = "fuel" }
3132
fuel-coroutines = { module = "com.github.kittinunf.fuel:fuel-coroutines", version.ref = "fuel" }
@@ -45,5 +46,5 @@ mixinExtras-common = "io.github.llamalad7:mixinextras-common:0.5.0-beta.1"
4546

4647
[bundles]
4748
coroutines = ["coroutines-swing"]
48-
asm = ["asm", "asm-tree", "asm-analysis"]
49+
asm = ["asm", "asm-tree", "asm-analysis", "asm-util"]
4950
fuel = ["fuel", "fuel-coroutines"]

gradle/wrapper/gradle-wrapper.jar

42 Bytes
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

gradlew

+5-2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
# See the License for the specific language governing permissions and
1616
# limitations under the License.
1717
#
18+
# SPDX-License-Identifier: Apache-2.0
19+
#
1820

1921
##############################################################################
2022
#
@@ -55,7 +57,7 @@
5557
# Darwin, MinGW, and NonStop.
5658
#
5759
# (3) This script is generated from the Groovy template
58-
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
60+
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
5961
# within the Gradle project.
6062
#
6163
# You can find Gradle at https://github.com/gradle/gradle/.
@@ -84,7 +86,8 @@ done
8486
# shellcheck disable=SC2034
8587
APP_BASE_NAME=${0##*/}
8688
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
87-
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
89+
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
90+
' "$PWD" ) || exit
8891

8992
# Use the maximum available, or set MAX_FD != -1 to use that value.
9093
MAX_FD=maximum

gradlew.bat

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
@rem See the License for the specific language governing permissions and
1414
@rem limitations under the License.
1515
@rem
16+
@rem SPDX-License-Identifier: Apache-2.0
17+
@rem
1618

1719
@if "%DEBUG%"=="" @echo off
1820
@rem ##########################################################################

readme.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Minecraft Development for IntelliJ
3535
</tr>
3636
</table>
3737

38-
Info and Documentation [![Current Release](https://img.shields.io/badge/release-1.7.6-orange.svg?style=flat-square)](https://plugins.jetbrains.com/plugin/8327)
38+
Info and Documentation [![Current Release](https://img.shields.io/badge/release-1.8.0-orange.svg?style=flat-square)](https://plugins.jetbrains.com/plugin/8327)
3939
----------------------
4040

4141
<a href="https://discord.gg/j6UNcfr"><img src="https://i.imgur.com/JXu9C1G.png" height="48px"></img></a>

src/gradle-tooling-extension/groovy/com/demonwav/mcdev/platform/mcp/gradle/tooling/neomoddev/NeoModDevGradleModelBuilderImpl.groovy

+20-9
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ package com.demonwav.mcdev.platform.mcp.gradle.tooling.neomoddev
2222

2323
import com.demonwav.mcdev.platform.mcp.gradle.tooling.McpModelNMD
2424
import org.gradle.api.Project
25+
import org.gradle.api.provider.ListProperty
2526
import org.jetbrains.annotations.NotNull
2627
import org.jetbrains.plugins.gradle.tooling.ErrorMessageBuilder
2728
import org.jetbrains.plugins.gradle.tooling.ModelBuilderService
@@ -51,16 +52,26 @@ final class NeoModDevGradleModelBuilderImpl implements ModelBuilderService {
5152
return null
5253
}
5354

54-
def accessTransformers = extension.accessTransformers.get().collect { project.file(it) }
55+
def accessTransformersRaw = extension.accessTransformers
56+
List<File> accessTransformers
57+
if (accessTransformersRaw instanceof ListProperty) {
58+
accessTransformers = accessTransformersRaw.get().collect { project.file(it) }
59+
} else {
60+
accessTransformers = accessTransformersRaw.files.files.toList()
61+
}
5562

56-
// Hacky way to guess where the mappings file is, but I could not find a proper way to find it
57-
def neoformDir = project.buildDir.toPath().resolve("neoForm")
58-
def mappingsFile = Files.list(neoformDir)
59-
.map { it.resolve("config/joined.tsrg") }
60-
.filter { Files.exists(it) }
61-
.findFirst()
62-
.orElse(null)
63-
?.toFile()
63+
File mappingsFile = null
64+
try {
65+
// Hacky way to guess where the mappings file is, but I could not find a proper way to find it
66+
def neoformDir = project.buildDir.toPath().resolve("neoForm")
67+
mappingsFile = Files.list(neoformDir)
68+
.map { it.resolve("config/joined.tsrg") }
69+
.filter { Files.exists(it) }
70+
.findFirst()
71+
.orElse(null)
72+
?.toFile()
73+
} catch (Exception ignore) {
74+
}
6475

6576
//noinspection GroovyAssignabilityCheck
6677
return new NeoModDevGradleModelImpl(neoforgeVersion, mappingsFile, accessTransformers)

src/main/grammars/MEExpressionParser.bnf

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*/
2020

2121
{
22-
parserClass="com.demonwav.mcdev.platform.mixin.expression.gen.MEExpressionParser"
22+
parserClass="com.demonwav.mcdev.platform.mixin.expression.gen.parser.MEExpressionParser"
2323
extends="com.intellij.extapi.psi.ASTWrapperPsiElement"
2424
parserImports = ["static com.demonwav.mcdev.platform.mixin.expression.psi.MEExpressionParserUtil.*"]
2525

src/main/kotlin/MinecraftConfigurable.kt

+7
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,13 @@ class MinecraftConfigurable : Configurable {
8686
}
8787
}
8888

89+
group(MCDevBundle("minecraft.settings.mixin")) {
90+
row {
91+
checkBox(MCDevBundle("minecraft.settings.mixin.mixin_class_icon"))
92+
.bindSelected(settings::mixinClassIcon)
93+
}
94+
}
95+
8996
group(MCDevBundle("minecraft.settings.creator")) {
9097
row(MCDevBundle("minecraft.settings.creator.repos")) {}
9198

src/main/kotlin/MinecraftSettings.kt

+8
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ class MinecraftSettings : PersistentStateComponent<MinecraftSettings.State> {
4040
var isShowChatColorUnderlines: Boolean = false,
4141
var underlineType: UnderlineType = UnderlineType.DOTTED,
4242

43+
var mixinClassIcon: Boolean = true,
44+
4345
var creatorTemplateRepos: List<TemplateRepo> = listOf(TemplateRepo.makeBuiltinRepo()),
4446
)
4547

@@ -106,6 +108,12 @@ class MinecraftSettings : PersistentStateComponent<MinecraftSettings.State> {
106108
state.underlineType = underlineType
107109
}
108110

111+
var mixinClassIcon: Boolean
112+
get() = state.mixinClassIcon
113+
set(mixinClassIcon) {
114+
state.mixinClassIcon = mixinClassIcon
115+
}
116+
109117
var creatorTemplateRepos: List<TemplateRepo>
110118
get() = state.creatorTemplateRepos.map { it.copy() }
111119
set(creatorTemplateRepos) {

src/main/kotlin/asset/MixinAssets.kt

+2
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,6 @@ object MixinAssets : Assets() {
2727

2828
val MIXIN_CLASS_ICON = loadIcon("/assets/icons/mixin/mixin_class_gutter.png")
2929
val MIXIN_CLASS_ICON_DARK = loadIcon("/assets/icons/mixin/mixin_class_gutter_dark.png")
30+
31+
val MIXIN_MARK = loadIcon("/assets/icons/mixin/mixin_mark.svg")
3032
}

src/main/kotlin/creator/creator-utils.kt

+7-2
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,12 @@ import com.intellij.openapi.application.ModalityState
3737
import com.intellij.openapi.diagnostic.thisLogger
3838
import com.intellij.openapi.observable.properties.ObservableMutableProperty
3939
import com.intellij.openapi.observable.properties.ObservableProperty
40+
import com.intellij.openapi.progress.ProgressManager
4041
import com.intellij.openapi.project.Project
4142
import com.intellij.openapi.util.Key
4243
import com.intellij.openapi.util.RecursionManager
4344
import java.time.ZonedDateTime
45+
import javax.swing.JComponent
4446

4547
val NewProjectWizardStep.gitEnabled
4648
get() = data.getUserData(GitNewProjectWizardData.KEY)!!.git
@@ -165,10 +167,13 @@ fun notifyCreatedProjectNotOpened() {
165167
).notify(null)
166168
}
167169

170+
val WizardContext.contentPanel: JComponent?
171+
get() = this.getUserData(AbstractWizard.KEY)?.contentPanel
172+
168173
val WizardContext.modalityState: ModalityState
169174
get() {
170-
val contentPanel = this.getUserData(AbstractWizard.KEY)?.contentPanel
171-
175+
ProgressManager.checkCanceled()
176+
val contentPanel = contentPanel
172177
if (contentPanel == null) {
173178
thisLogger().error("Wizard content panel is null, using default modality state")
174179
return ModalityState.defaultModalityState()

0 commit comments

Comments
 (0)