Skip to content

Commit 7536131

Browse files
bitterekcoh
andauthored
FIX: Change location of the link xml file so that it can persist beyond an editor shutdown. (#2092)
Co-authored-by: Håkan Sidenvall <[email protected]>
1 parent 6b042c2 commit 7536131

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

Packages/com.unity.inputsystem/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ however, it has to be formatted properly to pass verification tests.
3737
- 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).
3838

3939
### Changed
40+
- Changed location of the link xml file (code stripping rules), from a temporary directory to the project Library folder (ISX-2140).
4041
- Added back the InputManager to InputSystem project-wide asset migration code with performance improvement (ISX-2086).
4142
- Changed `OnScreenControl` to automaticaly switch, in Single Player with autoswitch enabled, to the target device control scheme when the first component is enabled to prevent bad interactions when it start.
4243
- Changed paremeter `overrideModifiersNeedToBePressedFirst` to obsolete for `ButtonWithOneModifier`, `ButtonWithTwoModifiers`, `OneModifierComposite` and `TwoModifiersComposite` in favour the new `modifiersOrder` parameter which is more explicit.

Packages/com.unity.inputsystem/InputSystem/Editor/BuildPipeline/LinkFileGenerator.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,12 @@ public string GenerateAdditionalLinkXmlFile(BuildReport report, UnityLinkerBuild
7777

7878
sb.AppendLine("</linker>");
7979

80-
var filePathName = Path.Combine(Application.dataPath, "..", "Temp", "InputSystemLink.xml");
81-
File.WriteAllText(filePathName, sb.ToString());
82-
return filePathName;
80+
var linkXmlDirectory = Path.Combine(Application.dataPath, "..", "Library", "InputSystem");
81+
var linkXmlFile = Path.Combine(linkXmlDirectory, $"{data.target}Link.xml");
82+
83+
Directory.CreateDirectory(linkXmlDirectory);
84+
File.WriteAllText(linkXmlFile, sb.ToString());
85+
return linkXmlFile;
8386
}
8487

8588
static bool IsTypeUsedViaReflectionByInputSystem(Type type)

0 commit comments

Comments
 (0)