-
Notifications
You must be signed in to change notification settings - Fork 4
use shared config dependency #71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
80fba2e
use shared config dependency
Frotty f6fe9de
review fixes
Frotty a70a4f8
differentiate between game version and game path
Frotty 70dad41
fix tests
Frotty 85383d0
fix CI
Frotty 645c80a
review fix
Frotty 5d54c10
review
Frotty File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| # AGENTS.md - WurstSetup / Grill Notes | ||
|
|
||
| This repo builds the Grill CLI and project setup tooling. The generated map-project agent notes live in `templates/AGENTS.md`; keep this root file focused on WurstSetup itself. | ||
|
|
||
| ## Current Architecture | ||
|
|
||
| - Project config models come from `com.github.wurstscript:wurst-project-config`; do not reintroduce local DAO copies. | ||
| - Local helpers in `config/ProjectConfigModels.kt` should stay thin: typealiases plus immutable copy helpers for shared records. | ||
| - `YamlHelper.dumpProjectConfig` intentionally serializes a pruned YAML map instead of the shared records directly. This preserves the old user-facing `wurst.build` behavior by omitting null/default nested fields. | ||
| - `wbschema.json` should stay lenient and aligned with the shared config parser, especially for `scriptMode`, `wc3Patch`, and nullable legacy fields. | ||
|
|
||
| ## WC3 Patch And Core JASS | ||
|
|
||
| - `CoreJassProvider.DEFAULT_PATCH` is `v2.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 | ||
| - 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. | ||
| - Keep provenance in `_build/core-jass.properties`; mismatched cached `common.j` / `blizzard.j` should be refreshed. | ||
|
|
||
| ## Generate Workflow | ||
|
|
||
| - `grill generate` should write a schema-valid minimal `wurst.build`. | ||
| - Keep `dependencies`, `scriptMode`, and `wc3Patch`. | ||
| - `buildMapData` should only seed known fields: `name`, `fileName`, and `author`. Do not emit nested default scaffolding like `scenarioData`, `optionsFlags`, `players: []`, `forces: []`, or `loadingScreen: null`. | ||
| - Generate supports `--wc3-path <dir>`. It should detect/show the Warcraft III client family and warn if it does not match the selected project patch target. | ||
| - The VS Code setting `wurst.wc3path` should only be written for a valid detected/selected WC3 folder. | ||
|
|
||
| ## Install / Userdir | ||
|
|
||
| - Grill installs itself to `~/.wurst/grill-cli/grill.jar`. | ||
| - The Gradle task `make_for_userdir` must keep that jar refreshed for local testing. | ||
| - `remove wurstscript` must not delete the whole `~/.wurst` folder; it should remove compiler artifacts only and leave Grill/runtime state intact. | ||
| - Tests should not mutate the real user install. Use the `wurst.install.dir` system property override when testing installation/removal behavior. | ||
|
|
||
| ## Compiler Interaction | ||
|
|
||
| - Build/typecheck should not require parsing the installed Warcraft executable when `wc3Patch` is pinned. | ||
| - Run/launch is different: the selected WC3 executable controls launch arguments. If the client family and project patch target differ, warn and allow choosing another WC3 folder. | ||
| - Keep compiler-facing patch behavior tested in the WurstScript repo as well; Grill and compiler can diverge if only one side is tested. | ||
|
|
||
| ## Test Commands | ||
|
|
||
| Run the full WurstSetup suite before publishing: | ||
|
|
||
| ```bash | ||
| ./gradlew test | ||
| ``` | ||
|
|
||
| Useful focused checks: | ||
|
|
||
| ```bash | ||
| ./gradlew test --tests GenerateTests --tests YamlHelperTests --tests Wc3ClientDetectorTests | ||
| ./gradlew test --tests CMDTests.testUnInstallCmd | ||
| ./gradlew make_for_userdir | ||
| ``` | ||
|
|
||
| `git diff --check` should be clean apart from Windows CRLF warnings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| package config | ||
|
|
||
| const val CONFIG_FILE_NAME = "wurst.build" | ||
|
|
||
| typealias ScriptMode = org.wurstscript.projectconfig.ScriptMode | ||
| typealias Race = org.wurstscript.projectconfig.Race | ||
| typealias Controller = org.wurstscript.projectconfig.Controller | ||
| typealias WurstProjectConfigData = org.wurstscript.projectconfig.WurstProjectConfigData | ||
| typealias WurstProjectBuildMapData = org.wurstscript.projectconfig.WurstProjectBuildMapData | ||
| typealias WurstProjectBuildScenarioData = org.wurstscript.projectconfig.WurstProjectBuildScenarioData | ||
| typealias WurstProjectBuildLoadingScreenData = org.wurstscript.projectconfig.WurstProjectBuildLoadingScreenData | ||
| typealias WurstProjectBuildOptionFlagsData = org.wurstscript.projectconfig.WurstProjectBuildOptionFlagsData | ||
| typealias WurstProjectBuildPlayer = org.wurstscript.projectconfig.WurstProjectBuildPlayer | ||
| typealias WurstProjectBuildForce = org.wurstscript.projectconfig.WurstProjectBuildForce | ||
| typealias WurstProjectBuildForceFlags = org.wurstscript.projectconfig.WurstProjectBuildForceFlags | ||
|
|
||
| fun newProjectConfig( | ||
| projectName: String = "unnamed", | ||
| dependencies: List<String> = emptyList(), | ||
| buildMapData: WurstProjectBuildMapData = WurstProjectBuildMapData.empty(), | ||
| scriptMode: ScriptMode? = null, | ||
| wc3Patch: String? = null | ||
| ): WurstProjectConfigData { | ||
| return WurstProjectConfigData(projectName, dependencies, buildMapData, scriptMode, wc3Patch) | ||
| } | ||
|
|
||
| fun WurstProjectConfigData.withProjectName(projectName: String): WurstProjectConfigData { | ||
| return WurstProjectConfigData(projectName, dependencies(), buildMapData(), scriptMode(), wc3Patch()) | ||
| } | ||
|
|
||
| fun WurstProjectConfigData.withWc3Patch(wc3Patch: String?): WurstProjectConfigData { | ||
| return WurstProjectConfigData(projectName(), dependencies(), buildMapData(), scriptMode(), wc3Patch) | ||
| } | ||
|
|
||
| fun WurstProjectConfigData.withDependencies(dependencies: List<String>): WurstProjectConfigData { | ||
| return WurstProjectConfigData(projectName(), dependencies, buildMapData(), scriptMode(), wc3Patch()) | ||
| } | ||
|
|
||
| fun WurstProjectConfigData.withAddedDependency(dependency: String): WurstProjectConfigData { | ||
| return withDependencies(dependencies() + dependency) | ||
| } | ||
|
|
||
| fun WurstProjectConfigData.withRemovedDependency(dependency: String): WurstProjectConfigData { | ||
| return withDependencies(dependencies().filterNot { it == dependency }) | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.