Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ This repo builds the Grill CLI and project setup tooling. The generated map-proj

## WC3 Patch And Core JASS

- `CoreJassProvider.DEFAULT_PATCH` is `v2.0`.
- `CoreJassProvider.DEFAULT_PATCH` is `v3.0`.
- Core JASS is fetched from `wurstscript/jass-history`.
- Friendly patch targets must resolve through the shared parser / `Wc3PatchTarget` style rules:
- below `1.29` => pre-1.29 behavior and stdlib
- `1.29` through `1.31` => classic
- `1.32+`, `1.36`, `2.0`, and `Reforged-*` => Reforged
- `1.32+`, `2.0`, `3.0`, and `Reforged-*` => Reforged
- Do not add alias hacks for broken jass-history folder names. Fix `wurstscript/jass-history` instead.
- Bundled core JASS fallbacks are patch-specific. Do not silently use the old `reforged` bundle as the `v2.0` fallback.
- Bundled core JASS fallbacks are patch-specific. Never reuse another patch's bundle for a new default alias.
- Keep provenance in `_build/core-jass.properties`; mismatched cached `common.j` / `blizzard.j` should be refreshed.

## Generate Workflow
Expand Down
7 changes: 4 additions & 3 deletions src/main/kotlin/file/CoreJassProvider.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import java.nio.file.StandardCopyOption
import java.util.jar.JarFile

object CoreJassProvider {
const val DEFAULT_PATCH = "v2.0"
const val DEFAULT_PATCH = "v3.0"
const val PRE_129_PATCH = "v1.28"

private const val JASS_HISTORY_RAW = "https://raw.githubusercontent.com/wurstscript/jass-history"
Expand All @@ -19,6 +19,7 @@ object CoreJassProvider {
private val log = KotlinLogging.logger {}

private val PATCH_TO_JASS_HISTORY_FOLDER = linkedMapOf(
"v3.0" to "Reforged-v3.0.0.24268-w3-3a9d8f2",
"v2.0" to "Reforged-v2.0.4.23745",
"v1.36" to "Reforged-v1.36.1.20719-w3-51d40ee",
"v1.35" to "Reforged-v1.35.0.20093-w3-5ec1b77",
Expand Down Expand Up @@ -77,7 +78,7 @@ object CoreJassProvider {
val supportedPatches: List<String> = PATCH_TO_JASS_HISTORY_FOLDER.keys.toList()

private val BUNDLED_CORE_JASS_PATCH_FOLDERS = mapOf(
DEFAULT_PATCH to "v2.0",
DEFAULT_PATCH to "v3.0",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve the v2.0 bundled fallback mapping

When a project remains pinned to wc3Patch: v2.0 and jass-history is unavailable, changing the only v2.0 map key indirectly via DEFAULT_PATCH removes its fallback: hasBundledCoreJass("v2.0") now returns false and materializeFile throws, even though core-jass/v2.0/common.j and blizzard.j are still bundled. Keep an explicit "v2.0" to "v2.0" entry alongside the new v3.0 default.

AGENTS.md reference: AGENTS.md:L29-L29

Useful? React with 👍 / 👎.

"v1.36" to "reforged",
PRE_129_PATCH to "pre1.29"
)
Expand All @@ -87,7 +88,7 @@ object CoreJassProvider {
fun describePatch(patch: String): String {
val normalizedPatch = normalizePatchInput(patch)
val label = when (normalizedPatch) {
DEFAULT_PATCH -> "latest Reforged / WC3 2.x core JASS"
DEFAULT_PATCH -> "latest Reforged / WC3 3.x core JASS"
"v1.31" -> "latest classic TFT"
PRE_129_PATCH -> "legacy pre-1.29"
else -> {
Expand Down
Loading
Loading