Skip to content

Commit db232e3

Browse files
authored
FIX: Avoid problems with CI and reimports (#2091)
1 parent 2d824e1 commit db232e3

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

Packages/com.unity.inputsystem/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ however, it has to be formatted properly to pass verification tests.
3434
- Fixed an issue with default device selection when adding new Control Scheme.
3535
- Fixed an issue where action map delegates were not updated when the asset already assigned to the PlayerInput component were changed [ISXB-711](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-711).
3636
- Fixed Action properties edition in the UI Toolkit version of the Input Actions Asset editor. [ISXB-1277](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-1277)
37+
- Fixed an issue where batch jobs would fail with "Error: Error building Player because scripts are compiling" if a source generated .inputactions asset is out of sync with its generated source code (ISXB-1300).
3738

3839
### Changed
3940
- Added back the InputManager to InputSystem project-wide asset migration code with performance improvement (ISX-2086).

Packages/com.unity.inputsystem/InputSystem/Editor/AssetImporter/InputActionImporter.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -256,11 +256,11 @@ private static void GenerateWrapperCode(AssetImportContext ctx, InputActionAsset
256256

257257
if (InputActionCodeGenerator.GenerateWrapperCode(wrapperFilePath, asset, options))
258258
{
259-
// When we generate the wrapper code cs file during asset import, we cannot call ImportAsset on that directly because
260-
// script assets have to be imported before all other assets, and are not allowed to be added to the import queue during
261-
// asset import. So instead we register a callback to trigger a delayed asset refresh which should then pick up the
262-
// changed/added script, and trigger a new import.
263-
EditorApplication.delayCall += AssetDatabase.Refresh;
259+
// This isn't ideal and may have side effects, but we cannot avoid compiling again.
260+
// Previously we attempted to run a EditorApplication.delayCall += AssetDatabase.Refresh
261+
// but this would lead to "error: Error building Player because scripts are compiling" in CI.
262+
// Previous comment here warned against not being able to reimport here directly, but it seems it's ok.
263+
AssetDatabase.ImportAsset(wrapperFilePath);
264264
}
265265
}
266266

0 commit comments

Comments
 (0)