User: kyle wood Date: 27 Mar 26 04:23 Revision: 57591ddb2d07d52dea774b269a12fdecb979171f Summary: Merge branch 'dev' into 2025.2 TeamCity URL: http://ci.mcdev.io:80/viewModification.html?tab=vcsModificationFiles&modId=10443&personal=false Index: buildSrc/src/main/kotlin/mcdev-core.gradle.kts =================================================================== --- buildSrc/src/main/kotlin/mcdev-core.gradle.kts (revision c3fcf468b174eb582c26047ee73edc1af8f818a7) +++ buildSrc/src/main/kotlin/mcdev-core.gradle.kts (revision 57591ddb2d07d52dea774b269a12fdecb979171f) @@ -3,7 +3,7 @@ * * https://mcdev.io/ * - * Copyright (C) 2025 minecraft-dev + * Copyright (C) 2026 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 @@ -19,6 +19,7 @@ */ import org.cadixdev.gradle.licenser.header.HeaderStyle +import org.cadixdev.gradle.licenser.tasks.LicenseTask import org.gradle.accessors.dm.LibrariesForLibs import org.jetbrains.kotlin.gradle.dsl.JvmDefaultMode import org.jetbrains.kotlin.gradle.dsl.JvmTarget @@ -130,7 +131,30 @@ } license { - header.set(resources.text.fromFile(rootProject.layout.projectDirectory.file("copyright.txt"))) + header.set(resources.text.fromString($$""" + Minecraft Development for IntelliJ + + https://mcdev.io/ + + Copyright (C) ${year} 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 . + """.trimIndent())) + + properties { + set("year", "2026") + } + style["flex"] = HeaderStyle.BLOCK_COMMENT.format style["bnf"] = HeaderStyle.BLOCK_COMMENT.format @@ -138,6 +162,27 @@ include(endings.map { "**/*.$it" }) } +tasks.withType(LicenseTask::class).configureEach { + val changedFiles = if (rootProject.ext.has("changedFiles")) { + @Suppress("UNCHECKED_CAST") + rootProject.ext["changedFiles"] as Set + } else { + val unstagedFiles = git("diff", "--name-only").lines() + val stagedFiles = git("diff", "--staged", "--name-only").lines() + var changedFiles = (unstagedFiles + stagedFiles) + .filter { it.isNotBlank() } + .map(project::file) + .toSet() + rootProject.ext["changedFiles"] = changedFiles + changedFiles + } + doFirst { + files = files.filter { + it in changedFiles + } + } +} + idea { module { excludeDirs.add(file(intellijPlatform.sandboxContainer.get()))