Skip to content

Commit

Permalink
Squashed '.scripts/X2ModBuildCommon/' changes from 1f63b8f..c7e3945
Browse files Browse the repository at this point in the history
c7e3945 Release v1.1.1
cb83114 Merge pull request #60 from pledbrook/patch-3
932381d Merge pull request #59 from X2CommunityCore/fail-on-sdk-revert-fail
d4e3e9b Merge pull request #56 from robojumper/55-spaces-in-project-path
63ff7e3 Make path rewriting aware of IncludeSrc (#57)
ccf2109 Remove /DCOPY:DA robocopy option
93da7dc Added a check (and fail) for post-cooking SDK cleanup
b78de7e Add disclaimer about spaces to README, update CHANGELOG
a72ea3d Fix mod project paths containing spaces
becea48 Merge pull request #53 from X2CommunityCore/revert-dlc-cook
305bef8 Revert DLC cooking + some improvements
3fef85d Merge pull request #51 from pledbrook/patch-1
53cc89e Fix build error when cooking maps
7bc79b5 Switched to DLC cooking functionality (#46)
5b866db Release v1.1.0
1dd9936 Merge pull request #28 from robojumper/remove_verification
1b88ae5 Update README with information about X2ProjectGenerator
60a8235 Rip project file verification out of build_common
6647121 Merge pull request #42 from robojumper/changelog
f6b7c1c Changelog the 2nd
702c0f4 Merge pull request #38 from robojumper/profile
f126426 Don't set the thread's culture just for a decimal dot
3f602dc Add self-profiling to report step timings
ed7a5f2 Merge pull request #31 from robojumper/check-macro-redefs
81c0216 More descriptive macro redefinition error message
0da0304 Merge pull request #39 from robojumper/future-proof
adf7f69 Use release tags in installation instructions instead of pulling main
8817f76 Don't delete XComGame\Published in clean.ps1
8da626f Error out on macro redefinitions as a stopgap measure
da647e0 Merge pull request #29 from robojumper/changelog
f825c12 Merge pull request #27 from robojumper/error-file-line-syntax
06f9d17 Add rolling changelog
0c508eb Use error syntax compatible with both ModBuddy and VS Code

git-subtree-dir: .scripts/X2ModBuildCommon
git-subtree-split: c7e3945067903304bf74599b763675ffecd43f79
  • Loading branch information
Iridar committed Nov 17, 2021
1 parent 060ecde commit 25f9e1a
Show file tree
Hide file tree
Showing 5 changed files with 642 additions and 417 deletions.
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
## Next

## 1.1.1 (2021-08-11)

* Support Rebuild ModBuddy target
* Internal improvements and fixes to asset cooking functionality
* Support projects with spaces in path (#55)
* Fix cryptic error about `SteamPublishID` for some projects (#56)
* Fail the build in case cooking cleanup fails, preventing silent SDK corruption (#54)
* Properly rewrite error messages originating from `IncludeSrc`-ed files (#45)


## 1.1.0 (2021-06-15)

* Remove compiled script packages when switching between debug and release mode to prevent compiler error (#16)
* Remove compiled script packages when modifying macros (#20)
* Overridden Steam UGC IDs can now be `long` (`int64`) (#22)
* Use error syntax `file(line)` for compiler errors to be compatible with both ModBuddy and VS Code (#26)
* Add a `clean.ps1` script, ModBuddy configuration and VS Code example task to remove all cached build artifacts (#24)
* Remove project file verification. Consider using [Xymanek/X2ProjectGenerator](https://github.com/Xymanek/X2ProjectGenerator) instead (#28)
* Catch macro name clashes through `extra_globals.uci` (#30)
* Add debugging option to profile build times (#35)

## 1.0.0 (2021-05-22)

* Initial release
31 changes: 24 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ An improved XCOM 2 mod build system. The following (in no praticular order) are
* Full HL building: final release compiling and cooking of native script packages
* Scriptable hooks in the build process
* Conversion of localization file(s) encoding (UTF8 in the project for correct git merging and UTF16 for correct game loading)
* Validation of `.x2proj` for cases when devs are using both ModBuddy and VSCode
* Mod asset cooking (experimental)
* Correct removal of files from the steamapps/XCOM2/WOTC/XComGame/Mods (built mod) when they are deleted from the project
* Mod-defined global macros (without explicit `include`s and without messing with your `SrcOrig`)
Expand All @@ -30,12 +29,12 @@ Open a command line prompt (cmd or powershell, does not matter) in the `[modRoot
your working tree is clean and run the following command:

```
git subtree add --prefix .scripts/X2ModBuildCommon https://github.com/X2CommunityCore/X2ModBuildCommon main --squash
git subtree add --prefix .scripts/X2ModBuildCommon https://github.com/X2CommunityCore/X2ModBuildCommon v1.1.1 --squash
```

### Your mod does not use git
Download the source code of this repository from GitHub. Unzip it and place so that `build_commom.ps1` resides at
`[modRoot]\.scripts\X2ModBuildCommon\build_common.ps1`.
Download the source code of this repository from the latest release on the [Releases page](https://github.com/X2CommunityCore/X2ModBuildCommon/releases/latest).
Unzip it and place so that `build_common.ps1` resides at `[modRoot]\.scripts\X2ModBuildCommon\build_common.ps1`.

## Ignoring the `BuildCache`
The build system will create a `[modRoot]\BuildCache` folder which is used for various file-based operations (such
Expand Down Expand Up @@ -81,7 +80,14 @@ switch ($config)
$builder.InvokeBuild()
```

Replace `YourProjectName` with the internal mod name (e.g. the name of your `.XCOM_sln` file without the extension)
Replace `YourProjectName` with the mod project name (e.g. the name of your `.XCOM_sln` file without the extension).

If you're transitioning an existing mod to X2ModBuildCommon, this advice might come too late, but we recommend that
the project name contain only ASCII alphabetic characters, numbers and underscores (matching the regular expression `^[A-Za-z][A-Za-z0-9_]*$`).
The ModBuddy project generator lets you create projects with a large variety of characters that will break the ModBuddy
build already (like brackets and dashes), but spaces and semicolons are allowed and work fine with the Firaxis ModBuddy plugin.
`X2ModBuildCommon` will do its best to support project names with spaces, but it's historically been a common source of bugs
and you may run into fewer of them if you keep your mod name simple.

## IDE integration
At this point your mod is actually ready for building but invoking the powershell script with all the arguments each time manually
Expand All @@ -105,6 +111,12 @@ Replace it with following:
<Import Project="$(BuildCommonRoot)XCOM2.targets" />
```

Note that the build tool does not care about most of the `.x2proj` file and will
copy and compile files not referenced by the project file without issuing warnings.
Consider using a tool like [Xymanek/X2ProjectGenerator](https://github.com/Xymanek/X2ProjectGenerator)
to automatically ensure the file list in ModBuddy accurately lists the files part of the project.


### VSCode

> FIXME(#1): Rename variables to remove HL references?
Expand Down Expand Up @@ -149,6 +161,11 @@ name in the "Clean" task):
"command": "powershell.exe –NonInteractive –ExecutionPolicy Unrestricted -file '${workspaceRoot}\\.scripts\\clean.ps1' -modName 'MY_MOD_NAME' -srcDirectory '${workspaceRoot}' -sdkPath '${config:xcom.highlander.sdkroot}' -gamePath '${config:xcom.highlander.gameroot}'",
"group": "build",
"problemMatcher": []
},
{
"label": "Full rebuild",
"dependsOrder": "sequence",
"dependsOn": ["Clean", "Build"]
}
]
}
Expand All @@ -172,7 +189,7 @@ If you don't use git, simply download the new version and overwrite the old file
If you use git, run the same command as before, replacing `add` with `pull`:

```
git subtree pull --prefix .scripts/X2ModBuildCommon https://github.com/X2CommunityCore/X2ModBuildCommon main --squash
git subtree pull --prefix .scripts/X2ModBuildCommon https://github.com/X2CommunityCore/X2ModBuildCommon v1.1.1 --squash
```

# Configuration options
Expand Down Expand Up @@ -287,7 +304,7 @@ Assuming the file is named `ContentOptions.json`:
$builder.SetContentOptionsJsonFilename("ContentOptions.json")
```

Four options are avaliable: `missingUncooked`, `sfStandalone`, `sfMaps`, `sfCollectionMaps`. Omitting an option (or the file entirely)
Four options are available: `missingUncooked`, `sfStandalone`, `sfMaps`, `sfCollectionMaps`. Omitting an option (or the file entirely)
is treated the same as setting it to an empty array

### Including missing uncooked
Expand Down
2 changes: 1 addition & 1 deletion XCOM2.targets
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
/>
</Target>
<Target Name="ReBuild">
<Error Text="Target ReBuild is not supported"/>
<CallTarget Targets="Clean;Default"/>
</Target>

<!-- The actual build -->
Expand Down
Loading

0 comments on commit 25f9e1a

Please sign in to comment.