User: rednesto Date: 12 Sep 24 22:45 Revision: d0d3a4bff8c3a7219d0a0b15bf44699e40c38c77 Summary: Merge branch '2024.1' into 2024.2 # Conflicts: # build.gradle.kts # gradle.properties # gradle/libs.versions.toml # src/main/kotlin/creator/custom/ResourceBundleTranslator.kt TeamCity URL: https://ci.mcdev.io/viewModification.html?tab=vcsModificationFiles&modId=9668&personal=false Index: build.gradle.kts =================================================================== --- build.gradle.kts (revision 4c3f5eeaec0fad51789395f6b474f86d02b1eb11) +++ build.gradle.kts (revision d0d3a4bff8c3a7219d0a0b15bf44699e40c38c77) @@ -18,27 +18,20 @@ * along with this program. If not, see . */ -import org.cadixdev.gradle.licenser.header.HeaderStyle -import org.cadixdev.gradle.licenser.tasks.LicenseUpdate import org.gradle.internal.jvm.Jvm import org.jetbrains.changelog.Changelog +import org.jetbrains.gradle.ext.settings +import org.jetbrains.gradle.ext.taskTriggers import org.jetbrains.intellij.platform.gradle.TestFrameworkType import org.jetbrains.intellij.platform.gradle.tasks.PrepareSandboxTask -import org.jetbrains.intellij.platform.gradle.tasks.PublishPluginTask -import org.jetbrains.kotlin.gradle.tasks.KotlinCompile -import org.jlleitschuh.gradle.ktlint.tasks.BaseKtLintCheckTask -import org.jlleitschuh.gradle.ktlint.tasks.KtLintFormatTask plugins { - kotlin("jvm") version "1.9.24" - java - mcdev groovy - idea - id("org.jetbrains.intellij.platform") version "2.0.0" - id("org.cadixdev.licenser") - id("org.jlleitschuh.gradle.ktlint") version "10.3.0" - id("org.jetbrains.changelog") version "2.2.0" + id(libs.plugins.changelog.get().pluginId) + alias(libs.plugins.idea.ext) + `mcdev-core` + `mcdev-parsing` + `mcdev-publishing` } val ideaVersionProvider: Provider = providers.gradleProperty("ideaVersion") @@ -50,21 +43,9 @@ isTransitive = false } -group = "com.demonwav.minecraft-dev" +group = "com.demonwav.mcdev" version = "$ideaVersionName-$coreVersion" -java { - toolchain { - languageVersion.set(JavaLanguageVersion.of(21)) - vendor.set(JvmVendorSpec.JETBRAINS) - } -} -kotlin { - jvmToolchain { - languageVersion.set(java.toolchain.languageVersion.get()) - } -} - val gradleToolingExtensionSourceSet: SourceSet = sourceSets.create("gradle-tooling-extension") { configurations.named(compileOnlyConfigurationName) { extendsFrom(gradleToolingExtension) @@ -102,50 +83,42 @@ archiveFileName.set("externalAnnotations.jar") } -repositories { - maven("https://repo.denwav.dev/repository/maven-public/") - maven("https://maven.fabricmc.net/") { - content { - includeModule("net.fabricmc", "mapping-io") - includeModule("net.fabricmc", "fabric-loader") - } - } - mavenCentral() - maven("https://repo.spongepowered.org/maven/") - - intellijPlatform { - defaultRepositories() - } -} - dependencies { // Add tools.jar for the JDI API implementation(files(Jvm.current().toolsJar)) + implementation(files(gradleToolingExtensionJar)) + implementation(libs.mixinExtras.expressions) testLibs(libs.mixinExtras.common) - // Kotlin - implementation(kotlin("stdlib-jdk8")) - implementation(kotlin("reflect")) - implementation(libs.bundles.coroutines) { - exclude(module = "kotlinx-coroutines-core-jvm") - } - - implementation(files(gradleToolingExtensionJar)) - implementation(libs.mappingIo) implementation(libs.bundles.asm) implementation(libs.bundles.fuel) - jflex(libs.jflex.lib) - jflexSkeleton(libs.jflex.skeleton) { - artifact { - extension = "skeleton" + intellijPlatform { + intellijIdeaCommunity(libs.versions.intellij.ide) + + // Bundled plugin dependencies + bundledPlugin("com.intellij.java") + bundledPlugin("org.jetbrains.idea.maven") + bundledPlugin("com.intellij.gradle") + bundledPlugin("org.intellij.groovy") + bundledPlugin("ByteCodeViewer") + bundledPlugin("org.intellij.intelliLang") + bundledPlugin("com.intellij.properties") + + // Optional dependencies + bundledPlugin("org.jetbrains.kotlin") + bundledPlugin("org.toml.lang") + bundledPlugin("org.jetbrains.plugins.yaml") + + testFramework(TestFrameworkType.JUnit5) + testFramework(TestFrameworkType.Plugin.Java) + + pluginVerifier() - } + } - } - grammarKit(libs.grammarKit) intellijPlatform { intellijIdeaCommunity(ideaVersionProvider, useInstaller = false) @@ -168,6 +141,8 @@ testLibs(libs.test.mockJdk) testLibs(libs.test.mixin) + testLibs(libs.test.spigotapi) + testLibs(libs.test.bungeecord) testLibs(libs.test.spongeapi) { artifact { classifier = "shaded" @@ -186,39 +161,8 @@ gradleToolingExtension(libs.groovy) gradleToolingExtension(libs.gradleToolingExtension) gradleToolingExtension(libs.annotations) - - testImplementation(libs.junit.api) - testRuntimeOnly(libs.junit.entine) - testRuntimeOnly(libs.junit.platform.launcher) } -val artifactType = Attribute.of("artifactType", String::class.java) -val filtered = Attribute.of("filtered", Boolean::class.javaObjectType) - -dependencies { - attributesSchema { - attribute(filtered) - } - artifactTypes.getByName("jar") { - attributes.attribute(filtered, false) - } - - registerTransform(Filter::class) { - from.attribute(filtered, false).attribute(artifactType, "jar") - to.attribute(filtered, true).attribute(artifactType, "jar") - - parameters { - ideaVersion.set(providers.gradleProperty("ideaVersion")) - ideaVersionName.set(providers.gradleProperty("ideaVersionName")) - depsFile.set(layout.projectDirectory.file(".gradle/intellij-deps.json")) - } - } -} - -configurations.compileClasspath { - attributes.attribute(filtered, true) -} - changelog { version = coreVersion groups.empty() @@ -226,11 +170,8 @@ } intellijPlatform { - sandboxContainer.set(layout.projectDirectory.dir(".sandbox")) + projectName = "Minecraft Development" - instrumentCode = false - buildSearchableOptions = false - pluginVerification { ides { recommended() @@ -243,31 +184,6 @@ changeNotes = changelog.render(Changelog.OutputType.HTML) } -tasks.withType { - // Build numbers are used for - properties["buildNumber"]?.let { buildNumber -> - project.version = "${project.version}-$buildNumber" - } - properties["mcdev.deploy.token"]?.let { deployToken -> - token.set(deployToken.toString()) - } - channels.add(properties["mcdev.deploy.channel"]?.toString() ?: "Stable") -} - -tasks.withType().configureEach { - options.encoding = "UTF-8" - options.compilerArgs = listOf("-proc:none") - options.release.set(21) -} - -tasks.withType().configureEach { - kotlinOptions { - jvmTarget = "21" - freeCompilerArgs = listOf("-Xjvm-default=all") - kotlinDaemonJvmArguments.add("-Xmx2G") - } -} - // Compile classes to be loaded into the Gradle VM to Java 5 to match Groovy // This is for maximum compatibility, these classes will be loaded into every Gradle import on all // projects (not just Minecraft), so we don't want to break that with an incompatible class version. @@ -303,7 +219,6 @@ tasks.test { dependsOn(tasks.jar, testLibs) - useJUnitPlatform() testLibs.resolvedConfiguration.resolvedArtifacts.forEach { systemProperty("testLibs.${it.name}", it.file.absolutePath) @@ -318,26 +233,22 @@ } idea { - module { - generatedSourceDirs.add(file("build/gen")) - excludeDirs.add(intellijPlatform.sandboxContainer.get().asFile) - isDownloadJavadoc = true - isDownloadSources = true + project.settings.taskTriggers.afterSync("generate") - } +} -} license { - header.set(resources.text.fromFile(file("copyright.txt"))) - style["flex"] = HeaderStyle.BLOCK_COMMENT.format - style["bnf"] = HeaderStyle.BLOCK_COMMENT.format - val endings = listOf("java", "kt", "kts", "groovy", "gradle.kts", "xml", "properties", "html", "flex", "bnf") exclude("META-INF/plugin.xml") // https://youtrack.jetbrains.com/issue/IDEA-345026 include(endings.map { "**/*.$it" }) - exclude("com/demonwav/mcdev/platform/mixin/invalidInjectorMethodSignature/*.java") + val projectDir = layout.projectDirectory.asFile + exclude { + it.file.toRelativeString(projectDir) + .replace("\\", "/") + .startsWith("src/test/resources") + } - this.tasks { + tasks { register("gradle") { files.from( fileTree(project.projectDir) { @@ -354,6 +265,14 @@ }, ) } + register("mixinTestData") { + files.from( + project.fileTree(project.projectDir.resolve("mixin-test-data")) { + include("**/*.java", "**/*.kts") + exclude("**/build/**") + }, + ) + } register("grammars") { files.from(project.fileTree("src/main/grammars")) } @@ -363,19 +282,6 @@ } } -ktlint { - disabledRules.add("filename") -} -tasks.withType().configureEach { - workerMaxHeapSize.set("512m") -} - -tasks.register("format") { - group = "minecraft" - description = "Formats source code according to project style" - dependsOn(tasks.withType(), tasks.withType()) -} - val generateAtLexer by lexer("AtLexer", "com/demonwav/mcdev/platform/mcp/at/gen") val generateAtParser by parser("AtParser", "com/demonwav/mcdev/platform/mcp/at/gen") @@ -420,12 +326,6 @@ // Remove gen directory on clean tasks.clean { delete(generate) } -tasks.register("cleanSandbox", Delete::class) { - group = "intellij" - description = "Deletes the sandbox directory." - delete(layout.projectDirectory.dir(".sandbox")) -} - tasks.withType { pluginJar.set(tasks.jar.get().archiveFile) from(externalAnnotationsJar) { Index: gradle.properties =================================================================== --- gradle.properties (revision 4c3f5eeaec0fad51789395f6b474f86d02b1eb11) +++ gradle.properties (revision d0d3a4bff8c3a7219d0a0b15bf44699e40c38c77) @@ -19,12 +19,12 @@ # # suppress inspection "UnusedProperty" for whole file -kotlin.code.style=official - -ideaVersion = 2024.2 ideaVersionName = 2024.2 coreVersion = 1.8.1 # Silences a build-time warning because we are bundling our own kotlin library kotlin.stdlib.default.dependency = false + +org.gradle.parallel=true +org.gradle.caching=true Index: gradle/libs.versions.toml =================================================================== --- gradle/libs.versions.toml (revision 4c3f5eeaec0fad51789395f6b474f86d02b1eb11) +++ gradle/libs.versions.toml (revision d0d3a4bff8c3a7219d0a0b15bf44699e40c38c77) @@ -1,13 +1,33 @@ [versions] -coroutines = "1.8.0" -junit = "5.10.0" -junit-platform = "1.10.0" -asm = "9.7" +kotlin = "2.0.20" +coroutines = "1.9.0-RC.2" +junit = "5.10.2" +junit-platform = "1.10.2" +asm = "9.6" fuel = "2.3.1" +licenser = "0.6.1" +changelog = "2.2.0" +intellij-plugin = "2.0.1" +intellij-ide = "2024.2" +idea-ext = "1.1.8" +psiPlugin = "242.4697" +[plugins] +kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } +intellij-platform = { id = "org.jetbrains.intellij.platform", version.ref = "intellij-plugin" } +idea-ext = { id = "org.jetbrains.gradle.plugin.idea-ext", version.ref = "idea-ext" } +licenser = { id = "org.cadixdev.licenser", version.ref = "licenser" } +changelog = { id = "org.jetbrains.changelog", version.ref = "changelog" } + [libraries] -coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutines" } -coroutines-jdk8 = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-jdk8", version.ref = "coroutines" } +kotlin-plugin = { module = "org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin", version.ref = "kotlin" } +kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk8", version.ref = "kotlin" } +kotlin-reflect = { module = "org.jetbrains.kotlin:kotlin-reflect", version.ref = "kotlin" } + +intellij-plugin = { module = "org.jetbrains.intellij.platform:org.jetbrains.intellij.platform.gradle.plugin", version.ref = "intellij-plugin" } +licenser-plugin = { module = "org.cadixdev.licenser:org.cadixdev.licenser.gradle.plugin", version.ref = "licenser" } +changelog-plugin = { module = "org.jetbrains.changelog:org.jetbrains.changelog.gradle.plugin", version.ref = "changelog" } + coroutines-swing = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-swing", version.ref = "coroutines" } mappingIo = "net.fabricmc:mapping-io:0.2.1" @@ -28,18 +48,23 @@ asm-analysis = { module = "org.ow2.asm:asm-analysis", version.ref = "asm" } asm-util = { module = "org.ow2.asm:asm-util", version.ref = "asm" } +gson = "com.google.code.gson:gson:2.10.1" + fuel = { module = "com.github.kittinunf.fuel:fuel", version.ref = "fuel" } fuel-coroutines = { module = "com.github.kittinunf.fuel:fuel-coroutines", version.ref = "fuel" } # Testing test-mockJdk = "org.jetbrains.idea:mock-jdk:1.7-4d76c50" test-mixin = "org.spongepowered:mixin:0.8.5" +test-spigotapi = "org.spigotmc:spigot-api:1.21-R0.1-SNAPSHOT" +test-bungeecord = "net.md-5:bungeecord-api:1.21-R0.1-SNAPSHOT" test-spongeapi = "org.spongepowered:spongeapi:7.4.0" test-fabricloader = "net.fabricmc:fabric-loader:0.15.11" test-nbt = "com.demonwav.mcdev:all-types-nbt:1.0" junit-api = { module = "org.junit.jupiter:junit-jupiter-api", version.ref = "junit" } -junit-entine = { module = "org.junit.jupiter:junit-jupiter-engine", version.ref = "junit" } +junit-engine = { module = "org.junit.jupiter:junit-jupiter-engine", version.ref = "junit" } +junit-vintage = { module = "org.junit.vintage:junit-vintage-engine", version.ref = "junit" } junit-platform-launcher = { module = "org.junit.platform:junit-platform-launcher", version.ref = "junit-platform" } mixinExtras-common = "io.github.llamalad7:mixinextras-common:0.5.0-beta.1" Index: settings.gradle.kts =================================================================== --- settings.gradle.kts (revision 4c3f5eeaec0fad51789395f6b474f86d02b1eb11) +++ settings.gradle.kts (revision d0d3a4bff8c3a7219d0a0b15bf44699e40c38c77) @@ -23,6 +23,7 @@ } rootProject.name = "MinecraftDev" +include("obfuscation-explorer") enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")