Skip to content

Commit b662717

Browse files
committed
Merge branch '2025.2' into 2025.3
2 parents 65ec4d8 + 7e94783 commit b662717

495 files changed

Lines changed: 2772 additions & 17398 deletions

File tree

Some content is hidden

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

.editorconfig

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1+
root = true
2+
13
[*.{kt,kts}]
2-
max_line_length=120
3-
ij_kotlin_imports_layout=*
4+
indent_size = 4
5+
indent_style = space
6+
max_line_length = 120
7+
ij_kotlin_imports_layout = *
48
ij_kotlin_name_count_to_use_star_import = 2147483647
59
ij_kotlin_name_count_to_use_star_import_for_members = 2147483647
610
insert_final_newline = true

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[submodule "templates"]
22
path = templates
3-
branch = v1
3+
branch = v2
44
url = https://github.com/minecraft-dev/templates

build.gradle.kts

Lines changed: 44 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* https://mcdev.io/
55
*
6-
* Copyright (C) 2025 minecraft-dev
6+
* Copyright (C) 2026 minecraft-dev
77
*
88
* This program is free software: you can redistribute it and/or modify
99
* it under the terms of the GNU Lesser General Public License as published
@@ -19,11 +19,14 @@
1919
*/
2020

2121
import io.sentry.android.gradle.extensions.SentryPluginExtension
22+
import java.util.concurrent.atomic.AtomicInteger
23+
import kotlin.concurrent.atomics.AtomicInt
2224
import org.gradle.kotlin.dsl.configure
2325
import org.jetbrains.changelog.Changelog
2426
import org.jetbrains.gradle.ext.settings
2527
import org.jetbrains.gradle.ext.taskTriggers
2628
import org.jetbrains.intellij.platform.gradle.TestFrameworkType
29+
import org.jetbrains.intellij.platform.gradle.tasks.CleanSandboxTask
2730
import org.jetbrains.intellij.platform.gradle.tasks.PrepareSandboxTask
2831

2932
plugins {
@@ -102,6 +105,8 @@ dependencies {
102105
exclude(group = "org.slf4j")
103106
}
104107

108+
implementation(libs.jspecify)
109+
105110
intellijPlatform {
106111
intellijIdea(libs.versions.intellij.ide) {
107112
useInstaller = false
@@ -123,7 +128,6 @@ dependencies {
123128
bundledPlugin("org.toml.lang")
124129
bundledPlugin("org.jetbrains.plugins.yaml")
125130

126-
127131
testFramework(TestFrameworkType.JUnit5)
128132
testFramework(TestFrameworkType.Platform)
129133
testFramework(TestFrameworkType.Plugin.Java)
@@ -200,8 +204,39 @@ tasks.processResources {
200204
}
201205
}
202206

207+
// Run unit tests in paralllel. Unfortunately, to accomplish this, we also need separate sandboxes for each test fork.
208+
// All of this is still worth doing since the IntelliJ test fixtures themselves are rather slow.
209+
val testForks = 6
210+
val sandboxTestTasks = mutableListOf<TaskProvider<PrepareSandboxTask>>()
211+
repeat(testForks) {
212+
sandboxTestTasks += tasks.register<PrepareSandboxTask>("prepareTestSandboxFork$it") {
213+
sandboxSuffix.set("-fork-$it")
214+
doFirst {
215+
sandboxDirectory.get().asFile.listFiles()
216+
?.filter { f -> f.name.endsWith("-fork-$it") }
217+
?.forEach { f -> f.deleteRecursively() }
218+
}
219+
}
220+
}
221+
tasks.prepareTestSandbox {
222+
doFirst {
223+
sandboxDirectory.get().asFile.listFiles()
224+
?.filter { f -> f.name.endsWith("-test") }
225+
?.forEach { f -> f.deleteRecursively() }
226+
}
227+
}
228+
229+
val cleanTestSandboxForks by tasks.registering(Delete::class) {
230+
doFirst {
231+
tasks.prepareTestSandbox.flatMap { it.sandboxDirectory }
232+
.get().asFile.listFiles()
233+
?.filter { it.name.matches(Regex(".*-(?:fork-\\d+|test)")) }
234+
?.let { delete(it) }
235+
}
236+
}
203237
tasks.test {
204-
dependsOn(tasks.jar, testLibs)
238+
dependsOn(tasks.jar, testLibs, sandboxTestTasks)
239+
finalizedBy(cleanTestSandboxForks)
205240

206241
testLibs.resolvedConfiguration.resolvedArtifacts.forEach {
207242
systemProperty("testLibs.${it.name}", it.file.absolutePath)
@@ -213,6 +248,12 @@ tasks.test {
213248
"-Dsun.io.useCanonCaches=false",
214249
"-Dsun.io.useCanonPrefixCache=false",
215250
)
251+
252+
val sandboxDir = tasks.prepareTestSandbox.flatMap { it.sandboxDirectory }.get().asFile
253+
254+
maxParallelForks = testForks
255+
systemProperty("sandboxDir", sandboxDir.absolutePath)
256+
systemProperty("forks", testForks.toString())
216257
}
217258

218259
idea {

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

Lines changed: 48 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* https://mcdev.io/
55
*
6-
* Copyright (C) 2025 minecraft-dev
6+
* Copyright (C) 2026 minecraft-dev
77
*
88
* This program is free software: you can redistribute it and/or modify
99
* it under the terms of the GNU Lesser General Public License as published
@@ -19,6 +19,7 @@
1919
*/
2020

2121
import org.cadixdev.gradle.licenser.header.HeaderStyle
22+
import org.cadixdev.gradle.licenser.tasks.LicenseTask
2223
import org.gradle.accessors.dm.LibrariesForLibs
2324
import org.jetbrains.kotlin.gradle.dsl.JvmDefaultMode
2425
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
@@ -66,6 +67,7 @@ kotlin {
6667
compilerOptions {
6768
jvmTarget = JvmTarget.JVM_21
6869
languageVersion = KotlinVersion.KOTLIN_2_2
70+
apiVersion = KotlinVersion.KOTLIN_2_2
6971
jvmDefault = JvmDefaultMode.NO_COMPATIBILITY
7072
freeCompilerArgs = listOf("-Xjdk-release=21")
7173
optIn.add("kotlin.contracts.ExperimentalContracts")
@@ -130,14 +132,58 @@ intellijPlatform {
130132
}
131133

132134
license {
133-
header.set(resources.text.fromFile(rootProject.layout.projectDirectory.file("copyright.txt")))
135+
header.set(resources.text.fromString($$"""
136+
Minecraft Development for IntelliJ
137+
138+
https://mcdev.io/
139+
140+
Copyright (C) ${year} minecraft-dev
141+
142+
This program is free software: you can redistribute it and/or modify
143+
it under the terms of the GNU Lesser General Public License as published
144+
by the Free Software Foundation, version 3.0 only.
145+
146+
This program is distributed in the hope that it will be useful,
147+
but WITHOUT ANY WARRANTY; without even the implied warranty of
148+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
149+
GNU General Public License for more details.
150+
151+
You should have received a copy of the GNU Lesser General Public License
152+
along with this program. If not, see <https://www.gnu.org/licenses/>.
153+
""".trimIndent()))
154+
155+
properties {
156+
set("year", "2026")
157+
}
158+
134159
style["flex"] = HeaderStyle.BLOCK_COMMENT.format
135160
style["bnf"] = HeaderStyle.BLOCK_COMMENT.format
136161

137162
val endings = listOf("java", "kt", "kts", "groovy", "gradle.kts", "xml", "properties", "html", "flex", "bnf")
138163
include(endings.map { "**/*.$it" })
139164
}
140165

166+
tasks.withType(LicenseTask::class).configureEach {
167+
val changedFiles = if (rootProject.ext.has("changedFiles")) {
168+
@Suppress("UNCHECKED_CAST")
169+
rootProject.ext["changedFiles"] as Set<File>
170+
} else {
171+
val unstagedFiles = git("diff", "--name-only").lines()
172+
val stagedFiles = git("diff", "--staged", "--name-only").lines()
173+
var changedFiles = (unstagedFiles + stagedFiles)
174+
.filter { it.isNotBlank() }
175+
.map(project::file)
176+
.toSet()
177+
rootProject.ext["changedFiles"] = changedFiles
178+
changedFiles
179+
}
180+
doFirst {
181+
files = files.filter {
182+
it in changedFiles
183+
}
184+
}
185+
}
186+
141187
idea {
142188
module {
143189
excludeDirs.add(file(intellijPlatform.sandboxContainer.get()))
@@ -149,12 +195,6 @@ tasks.runIde {
149195
jvmArgs("--add-exports=java.base/jdk.internal.vm=ALL-UNNAMED")
150196
}
151197

152-
tasks.register("cleanSandbox", Delete::class) {
153-
group = "intellij"
154-
description = "Deletes the sandbox directory."
155-
delete(layout.projectDirectory.dir(".sandbox"))
156-
}
157-
158198
tasks.test {
159199
useJUnitPlatform()
160200
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* https://mcdev.io/
55
*
6-
* Copyright (C) 2025 minecraft-dev
6+
* Copyright (C) 2026 minecraft-dev
77
*
88
* This program is free software: you can redistribute it and/or modify
99
* it under the terms of the GNU Lesser General Public License as published

buildSrc/src/main/kotlin/util.kt

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* https://mcdev.io/
55
*
6-
* Copyright (C) 2025 minecraft-dev
6+
* Copyright (C) 2026 minecraft-dev
77
*
88
* This program is free software: you can redistribute it and/or modify
99
* it under the terms of the GNU Lesser General Public License as published
@@ -18,6 +18,10 @@
1818
* along with this program. If not, see <https://www.gnu.org/licenses/>.
1919
*/
2020

21+
import java.io.ByteArrayOutputStream
22+
import java.io.InputStream
23+
import java.io.OutputStream
24+
import java.nio.charset.Charset
2125
import org.gradle.api.Project
2226
import org.gradle.api.tasks.TaskContainer
2327
import org.gradle.api.tasks.util.PatternFilterable
@@ -65,3 +69,11 @@ fun Project.parser(bnf: String, pack: String): TaskDelegate<ParserExec> {
6569
this.grammarKit.setFrom(grammarKit)
6670
}
6771
}
72+
73+
fun Project.git(vararg args: String): String {
74+
val output = providers.exec {
75+
commandLine("git", *args)
76+
isIgnoreExitValue = true
77+
}
78+
return output.standardOutput.asText.get()
79+
}

changelog.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,37 @@
11
# Minecraft Development for IntelliJ
22

3+
## [1.8.12]
4+
5+
### Version Support
6+
- Added IntelliJ 2026.1
7+
- Dropped IntelliJ 2025.1
8+
9+
### Added
10+
11+
- Automatic fetching of Paper versions in the project wizard.
12+
- More advanced customization in custom project templates, including:
13+
- Visibility control for property groups.
14+
- Inline Gradle plugin enabling and version selection.
15+
- Several new inspections for mixins:
16+
- `@Shadow` parameter names not matching their target.
17+
- Parameter name mismatch compared to the target class in unobfuscated versions.
18+
- Mixin class types that don't match the target's type.
19+
20+
### Changed
21+
22+
- The Run and Build tool windows now open automatically during project creation or Maven import.
23+
- Updated Fabric mixin parameter handling for versions 0.17.0 and higher.
24+
- Downgraded the parameter name mismatch inspection to a weak warning.
25+
26+
### Fixed
27+
28+
- Fixed translation folding when arguments are provided as an explicit array.
29+
- Fixed an issue where the Paper library would sometimes not be detected.
30+
- Fixed unintended renaming of mixin targets incorrectly affecting strings and non-Java files.
31+
- Fixed local and inner classes being incorrectly disallowed in mixins.
32+
- Improved the accuracy of parameter name inspections by correctly handling local variable table (LVT) ordering.
33+
- Fixed NeoForge version detection when in vanilla mode.
34+
335
## [1.8.11]
436

537
### Added

copyright.txt

Lines changed: 0 additions & 17 deletions
This file was deleted.

create_release.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,11 @@
1313

1414
from __future__ import annotations
1515
import argparse
16-
import shlex
1716
import subprocess
1817
import sys
1918
from typing import List, Tuple
2019

21-
BRANCHES=["2024.3", "2025.1", "2025.2", "2025.3"]
20+
BRANCHES=["2025.2", "2025.3", "2026.1"]
2221

2322
def check_file_contains_version(path: str, version: str) -> bool:
2423
try:

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ org.gradle.jvmargs=-Xmx1g
2323

2424
ideaVersionName = 2025.3
2525

26-
coreVersion = 1.8.11
26+
coreVersion = 1.8.12
2727

2828
# Silences a build-time warning because we are bundling our own kotlin library
2929
kotlin.stdlib.default.dependency = false

0 commit comments

Comments
 (0)