Skip to content

Commit ea1e431

Browse files
committed
Merge branch '2021.2' into 2021.3
2 parents 08804d1 + 1eb56f7 commit ea1e431

35 files changed

+201
-120
lines changed

.editorconfig

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
[*.{kt,kts}]
22
max_line_length=120
3-
# noinspection EditorConfigKeyCorrectness
4-
kotlin_imports_layout=ascii
3+
ij_kotlin_imports_layout=*

build.gradle.kts

Lines changed: 65 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,17 @@ import org.gradle.internal.os.OperatingSystem
1414
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
1515

1616
plugins {
17-
kotlin("jvm") version "1.4.32"
17+
kotlin("jvm") version "1.6.10"
1818
java
1919
mcdev
2020
groovy
2121
idea
22-
id("org.jetbrains.intellij") version "1.3.0"
22+
val ijPluginVersion = if (System.getProperty("mcdev.localdev").toBoolean()) {
23+
"1.1.3"
24+
} else {
25+
"1.3.0"
26+
}
27+
id("org.jetbrains.intellij") version ijPluginVersion
2328
id("org.cadixdev.licenser") version "0.6.1"
2429
id("org.jlleitschuh.gradle.ktlint") version "10.0.0"
2530
}
@@ -46,6 +51,12 @@ val testLibs: Configuration by configurations.creating {
4651
group = "com.demonwav.minecraft-dev"
4752
version = "$ideaVersionName-$coreVersion"
4853

54+
java {
55+
toolchain {
56+
languageVersion.set(JavaLanguageVersion.of(11))
57+
}
58+
}
59+
4960
val gradleToolingExtensionSourceSet: SourceSet = sourceSets.create("gradle-tooling-extension") {
5061
configurations.named(compileOnlyConfigurationName) {
5162
extendsFrom(gradleToolingExtension)
@@ -57,17 +68,8 @@ val gradleToolingExtensionJar = tasks.register<Jar>(gradleToolingExtensionSource
5768
}
5869

5970
repositories {
60-
mavenCentral()
6171
maven("https://repo.denwav.dev/repository/maven-public/")
62-
maven("https://repo.spongepowered.org/maven")
63-
if (!ideaVersion.endsWith("SNAPSHOT")) {
64-
maven("https://www.jetbrains.com/intellij-repository/releases")
65-
} else {
66-
maven("https://www.jetbrains.com/intellij-repository/snapshots")
67-
}
68-
maven("https://cache-redirector.jetbrains.com/intellij-dependencies")
69-
maven("https://repo.gradle.org/gradle/libs-releases-local/")
70-
maven("https://maven.extracraftx.com")
72+
mavenCentral()
7173
}
7274

7375
dependencies {
@@ -82,19 +84,28 @@ dependencies {
8284
implementation(files(gradleToolingExtensionJar))
8385

8486
implementation(libs.templateMakerFabric)
85-
86-
implementation("org.ow2.asm:asm:9.2")
87-
implementation("org.ow2.asm:asm-tree:9.2")
88-
implementation("org.ow2.asm:asm-analysis:9.2")
87+
implementation(libs.bundles.asm)
8988

9089
jflex(libs.jflex.lib)
91-
jflexSkeleton("${libs.jflex.skeleton.text()}@skeleton")
90+
jflexSkeleton(libs.jflex.skeleton) {
91+
artifact {
92+
extension = "skeleton"
93+
}
94+
}
9295
grammarKit(libs.grammarKit)
9396

9497
testLibs(libs.test.mockJdk)
9598
testLibs(libs.test.mixin)
96-
testLibs("${libs.test.spongeapi.text()}:shaded")
97-
testLibs("${libs.test.nbt.text()}@nbt")
99+
testLibs(libs.test.spongeapi) {
100+
artifact {
101+
classifier = "shaded"
102+
}
103+
}
104+
testLibs(libs.test.nbt) {
105+
artifact {
106+
extension = "nbt"
107+
}
108+
}
98109
testLibs(project(":mixin-test-data"))
99110

100111
// For non-SNAPSHOT versions (unless Jetbrains fixes this...) find the version with:
@@ -155,7 +166,7 @@ java {
155166
tasks.withType<JavaCompile>().configureEach {
156167
options.encoding = "UTF-8"
157168
options.compilerArgs = listOf("-proc:none")
158-
options.release.set(8)
169+
options.release.set(11)
159170
}
160171

161172
tasks.withType<KotlinCompile>().configureEach {
@@ -165,6 +176,18 @@ tasks.withType<KotlinCompile>().configureEach {
165176
}
166177
}
167178

179+
// Compile classes to be loaded into the Gradle VM to Java 5 to match Groovy
180+
// This is for maximum compatibility, these classes will be loaded into every Gradle import on all
181+
// projects (not just Minecraft), so we don't want to break that with an incompatible class version.
182+
tasks.named(gradleToolingExtensionSourceSet.compileJavaTaskName, JavaCompile::class) {
183+
val java7Compiler = javaToolchains.compilerFor { languageVersion.set(JavaLanguageVersion.of(8)) }
184+
javaCompiler.set(java7Compiler)
185+
options.release.set(null as Int?)
186+
sourceCompatibility = "1.5"
187+
targetCompatibility = "1.5"
188+
options.bootstrapClasspath = files(java7Compiler.map { it.metadata.installationPath.file("jre/lib/rt.jar") })
189+
options.compilerArgs = listOf("-Xlint:-options")
190+
}
168191
tasks.withType<GroovyCompile>().configureEach {
169192
options.compilerArgs = listOf("-proc:none")
170193
sourceCompatibility = "1.5"
@@ -189,26 +212,33 @@ tasks.processResources {
189212
}
190213

191214
tasks.test {
192-
dependsOn(testLibs)
215+
dependsOn(tasks.jar, testLibs)
193216
useJUnitPlatform()
194217
doFirst {
195218
testLibs.resolvedConfiguration.resolvedArtifacts.forEach {
196219
systemProperty("testLibs.${it.name}", it.file.absolutePath)
197220
}
198221
}
199222
systemProperty("NO_FS_ROOTS_ACCESS_CHECK", "true")
200-
if (JavaVersion.current().isJava9Compatible) {
201-
jvmArgs(
202-
"--add-opens", "java.base/java.io=ALL-UNNAMED",
203-
"--add-opens", "java.base/java.lang=ALL-UNNAMED",
204-
"--add-opens", "java.desktop/sun.awt=ALL-UNNAMED",
205-
"--add-opens", "java.desktop/java.awt=ALL-UNNAMED",
206-
"--add-opens", "java.desktop/javax.swing=ALL-UNNAMED",
207-
"--add-opens", "java.desktop/javax.swing.plaf.basic=ALL-UNNAMED",
208-
"--add-opens", "java.desktop/sun.font=ALL-UNNAMED",
209-
"--add-opens", "java.desktop/sun.swing=ALL-UNNAMED"
210-
)
211-
}
223+
224+
jvmArgs(
225+
"--add-opens", "java.base/java.io=ALL-UNNAMED",
226+
"--add-opens", "java.base/java.lang.invoke=ALL-UNNAMED",
227+
"--add-opens", "java.base/java.lang.ref=ALL-UNNAMED",
228+
"--add-opens", "java.base/java.lang.reflect=ALL-UNNAMED",
229+
"--add-opens", "java.base/java.lang=ALL-UNNAMED",
230+
"--add-opens", "java.base/java.util.concurrent.atomic=ALL-UNNAMED",
231+
"--add-opens", "java.base/java.util.concurrent.locks=ALL-UNNAMED",
232+
"--add-opens", "java.base/java.util.concurrent=ALL-UNNAMED",
233+
"--add-opens", "java.base/sun.nio.fs=ALL-UNNAMED",
234+
"--add-opens", "java.desktop/java.awt.event=ALL-UNNAMED",
235+
"--add-opens", "java.desktop/java.awt=ALL-UNNAMED",
236+
"--add-opens", "java.desktop/javax.swing.plaf.basic=ALL-UNNAMED",
237+
"--add-opens", "java.desktop/javax.swing=ALL-UNNAMED",
238+
"--add-opens", "java.desktop/sun.awt=ALL-UNNAMED",
239+
"--add-opens", "java.desktop/sun.font=ALL-UNNAMED",
240+
"--add-opens", "java.desktop/sun.swing=ALL-UNNAMED",
241+
)
212242
}
213243

214244
idea {
@@ -342,10 +372,10 @@ tasks.buildSearchableOptions {
342372
"--add-exports=java.base/jdk.internal.vm=ALL-UNNAMED",
343373
"--add-opens=java.base/java.lang=ALL-UNNAMED",
344374
"--add-opens=java.base/java.util=ALL-UNNAMED",
345-
"--add-opens=java.desktop/java.awt=ALL-UNNAMED",
346375
"--add-opens=java.desktop/java.awt.event=ALL-UNNAMED",
347-
"--add-opens=java.desktop/javax.swing=ALL-UNNAMED",
376+
"--add-opens=java.desktop/java.awt=ALL-UNNAMED",
348377
"--add-opens=java.desktop/javax.swing.plaf.basic=ALL-UNNAMED",
378+
"--add-opens=java.desktop/javax.swing=ALL-UNNAMED",
349379
"--add-opens=java.desktop/sun.awt=ALL-UNNAMED",
350380
"--add-opens=java.desktop/sun.font=ALL-UNNAMED",
351381
"--add-opens=java.desktop/sun.swing=ALL-UNNAMED"
@@ -355,10 +385,3 @@ tasks.buildSearchableOptions {
355385
jvmArgs("--add-opens=java.desktop/com.apple.eawt.event=ALL-UNNAMED")
356386
}
357387
}
358-
359-
// version catalogs still have rough edges as it's still experimental
360-
// this lets us get around some of that while still getting the benefits of using catalogs
361-
fun Provider<MinimalExternalModuleDependency>.text(): String {
362-
val dep = get()
363-
return "${dep.module.group}:${dep.module.name}:${dep.versionConstraint}"
364-
}

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ kotlin.code.style=official
1414
ideaVersion = 2021.3
1515
ideaVersionName = 2021.3
1616

17-
coreVersion = 1.5.17
17+
coreVersion = 1.5.18
1818
downloadIdeaSources = true
1919

2020
pluginTomlVersion = 213.5744.224

gradle/libs.versions.toml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[versions]
2-
coroutines = "1.4.3"
2+
coroutines = "1.5.2"
33
junit = "5.7.1"
4+
asm = "9.2"
45

56
[libraries]
67
coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutines" }
@@ -18,14 +19,19 @@ gradleToolingExtension = "com.jetbrains.intellij.gradle:gradle-tooling-extension
1819
annotations = "org.jetbrains:annotations:20.1.0"
1920
groovy = "org.codehaus.groovy:groovy-all:2.5.14"
2021

22+
asm = { module = "org.ow2.asm:asm", version.ref = "asm" }
23+
asm-tree = { module = "org.ow2.asm:asm-tree", version.ref = "asm" }
24+
asm-analysis = { module = "org.ow2.asm:asm-analysis", version.ref = "asm" }
25+
2126
# Testing
2227
test-mockJdk = "org.jetbrains.idea:mock-jdk:1.7-4d76c50"
23-
test-mixin = "org.spongepowered:mixin:0.8-SNAPSHOT"
24-
test-spongeapi = "org.spongepowered:spongeapi:7.0.0"
28+
test-mixin = "org.spongepowered:mixin:0.8.5"
29+
test-spongeapi = "org.spongepowered:spongeapi:7.4.0"
2530
test-nbt = "com.demonwav.mcdev:all-types-nbt:1.0"
2631

2732
junit-api = { module = "org.junit.jupiter:junit-jupiter-api", version.ref = "junit" }
2833
junit-entine = { module = "org.junit.jupiter:junit-jupiter-engine", version.ref = "junit" }
2934

3035
[bundles]
3136
coroutines = ["coroutines-core", "coroutines-swing"]
37+
asm = ["asm", "asm-tree", "asm-analysis"]

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Minecraft Development for IntelliJ
3232
</tr>
3333
</table>
3434

35-
Info and Documentation [![Current Release](https://img.shields.io/badge/release-1.5.16-orange.svg?style=flat-square)](https://plugins.jetbrains.com/plugin/8327)
35+
Info and Documentation [![Current Release](https://img.shields.io/badge/release-1.5.18-orange.svg?style=flat-square)](https://plugins.jetbrains.com/plugin/8327)
3636
----------------------
3737

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

src/main/grammars/AwLexer.flex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ HEADER_VERSION_ELEMENT=v\d+
4141
HEADER_NAMESPACE_ELEMENT=named|intermediary
4242
PRIMITIVE=[ZBCSIFDJV]
4343
CLASS_VALUE=(\[+[ZBCSIFDJ]|(\[*L[^;\n]+;))
44-
ACCESS_ELEMENT=accessible|extendable|mutable
44+
ACCESS_ELEMENT=accessible|transitive-accessible|extendable|transitive-extendable|mutable|transitive-mutable
4545
CLASS_ELEMENT=class
4646
METHOD_ELEMENT=method
4747
FIELD_ELEMENT=field

src/main/kotlin/creator/MinecraftProjectCreator.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import com.intellij.openapi.progress.Task
2323
import com.intellij.openapi.vfs.VfsUtil
2424
import java.nio.file.Files
2525
import java.nio.file.Path
26+
import java.util.Locale
2627

2728
class MinecraftProjectCreator {
2829

@@ -116,7 +117,7 @@ class MinecraftProjectCreator {
116117
for (config in configs) {
117118
val log = newLog(config, workLog)
118119

119-
val dirName = config.type.normalName.toLowerCase()
120+
val dirName = config.type.normalName.lowercase(Locale.ENGLISH)
120121
val newArtifactId = "${build.artifactId}-$dirName"
121122
val dir = Files.createDirectories(root.resolve(newArtifactId))
122123

src/main/kotlin/creator/buildsystem/gradle/GradleBuildSystem.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ class GradleBuildSystem(
4545
): Iterable<CreatorStep> {
4646
val project = module.project
4747

48-
val baseName = artifactId.toLowerCase(Locale.ENGLISH)
48+
val baseName = artifactId.lowercase(Locale.ENGLISH)
4949
val names = mutableListOf("$baseName-common")
50-
names += types.map { "$baseName-${it.name.toLowerCase(Locale.ENGLISH)}" }
50+
names += types.map { "$baseName-${it.name.lowercase(Locale.ENGLISH)}" }
5151

5252
val buildText = BuildSystemTemplate.applyBuildGradle(project, this)
5353
val propText = BuildSystemTemplate.applyGradleProp(project)

src/main/kotlin/creator/buildsystem/maven/MavenBuildSystem.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ class MavenBuildSystem(
4242
val project = module.project
4343
val pomText = BuildSystemTemplate.applyPom(project)
4444

45-
val baseName = artifactId.toLowerCase(Locale.ENGLISH)
45+
val baseName = artifactId.lowercase(Locale.ENGLISH)
4646
val moduleNames = mutableListOf("$baseName-common")
47-
moduleNames += types.map { "$baseName-${it.name.toLowerCase(Locale.ENGLISH)}" }
47+
moduleNames += types.map { "$baseName-${it.name.lowercase(Locale.ENGLISH)}" }
4848

4949
return listOf(
5050
BasicMavenStep(

src/main/kotlin/errorreporter/AnonymousFeedback.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ object AnonymousFeedback {
3030
data class FeedbackData(val url: String, val token: Int, val isDuplicate: Boolean)
3131

3232
private const val authedUrl = "https://www.denwav.dev/errorReport"
33-
private const val baseUrl = "https://api.github.com/repos/minecraft-dev/MinecraftDev/issues"
33+
private const val baseUrl = "https://api.github.com/repos/minecraft-dev/mcdev-error-report/issues"
3434

3535
fun sendFeedback(
3636
factory: HttpConnectionFactory,

0 commit comments

Comments
 (0)