test
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
end_of_line = lf
|
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"timestamp": 1718627208,
|
||||
"signature": "XO721MNQKyDN0H6D282GzXcEQDBd9wgGlkoocQk3iz22Tjp0E9zHrXLlGRpHJv5ltn5k0Dmegdpvni4qdG7DWM1YIL8bp8fAq/r9Lh1gH8woZ1Q/d5O82XS30pNfpVzXus6EVDhxW0EpsE6Hzpmy6GSHGWYlYlfdP4fpLaK5Yoc3j/DKsgDGJUzkl3rkI96Ec0js4TgaA1b0hjftxOQN7bt+HloX8ltsbEp+t6/mqW6MzWqT1ewM8Rxz/UNRy9qncywyONwaSEqNvChcKWT4eJn6aGgt5Dg2MiDsYL9Zyz9lVc8Och3U860JE6y3XdA/0K5BKek2IMufJn8QQc7nrp3LaaS/CBwHEpuyrTSjLGrZzUz1JkcE4YqlRtv2D/VJhvLRm34PxdqcwNyIzH1b08R5U2zL/5TX1eajVx5mcnUizyW89dvzvhbwJQug3J7Eg9yjKCHtvK94IQ4GKd8coMwMWbgi2AT8aRZFCz/804hYxsVRyz3tozUGlUwcYD/X",
|
||||
"publicKey": "LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJQm9qQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FZOEFNSUlCaWdLQ0FZRUFzdUhXYUhsZ0I1cVF4ZEJjTlJKSAordHR4SmoxcVY1NTdvMlZaRE1XaXhYRVBkRTBEMVFkT1JIRXNSS1RscmplUXlERU83ZlNQS0ZwZ1A3MU5TTnJCCkFHM2NFSU45aHNQVDhOVmllZmdWem5QTkVMenFkVmdEbFhpb2VpUnV6OERKWFgvblpmU1JWKytwbk9ySTRibG4KS0twelJlNW14OTc1SjhxZ1FvRktKT0NNRlpHdkJMR2MxSzZZaEIzOHJFODZCZzgzbUovWjBEYkVmQjBxZm13cgo2ZDVFUXFsd0E5Y3JZT1YyV1VpWXprSnBLNmJZNzRZNmM1TmpBcEFKeGNiaTFOaDlRVEhUcU44N0ZtMDF0R1ZwCjVNd1pXSWZuYVRUemEvTGZLelR5U0pka0tldEZMVGdkYXpMYlpzUEE2aHBSK0FJRTJhc0tLTi84UUk1N3UzU2cKL2xyMnZKS1IvU2l5eEN1Q20vQWJkYnJMbXk0WjlSdm1jMGdpclA4T0lLQWxBRWZ2TzV5Z2hSKy8vd1RpTFlzUQp1SllDM0V2UE16ZGdKUzdGR2FscnFLZzlPTCsxVzROY05yNWdveVdSUUJ0cktKaWlTZEJVWmVxb0RvSUY5NHpCCndGbzJJT1JFdXFqcU51M3diMWZIM3p1dGdtalFra3IxVjJhd3hmcExLWlROQWdNQkFBRT0KLS0tLS1FTkQgUFVCTElDIEtFWS0tLS0tCg"
|
||||
}
|
284
My project/Library/PackageCache/com.unity.ide.rider/CHANGELOG.md
Normal file
284
My project/Library/PackageCache/com.unity.ide.rider/CHANGELOG.md
Normal file
@@ -0,0 +1,284 @@
|
||||
# Code Editor Package for Rider
|
||||
|
||||
|
||||
## [3.0.31] - 2024-06-17
|
||||
|
||||
fix RIDER-104519 Rider is reporting errors in scripts that work fine in Unity when utilizing DOTS - when Player project, by generating projects for all assemblies in "com.unity.entities", "com.unity.collections"
|
||||
fix RIDER-111622 Unity Rider package is not compatible with Rider Dev builds
|
||||
|
||||
|
||||
## [3.0.28] - 2024-02-20
|
||||
|
||||
- fix RIDER-103933 "PlayerSettings.suppressCommonWarnings" is not supported in Unity 2019.4.40f
|
||||
- fix https://github.com/JetBrains/resharper-unity/issues/2431 and [RIDER-104221](https://youtrack.jetbrains.com/issue/RIDER-104221)
|
||||
|
||||
|
||||
## [3.0.27] - 2023-11-30
|
||||
|
||||
- Restore the ability to select Rider installation from the custom location
|
||||
- Fix possible extra project regeneration on moving focus from Rider to Unity
|
||||
- Improve performance of code generation for very large projects
|
||||
|
||||
|
||||
## [3.0.26] - 2023-10-04
|
||||
|
||||
- https://github.com/JetBrains/resharper-unity/issues/2421
|
||||
- https://github.com/JetBrains/resharper-unity/issues/2422
|
||||
|
||||
|
||||
## [3.0.25] - 2023-08-18
|
||||
|
||||
- unification of functionality to search JetBrains installations and open solution and file in Rider
|
||||
|
||||
|
||||
## [3.0.22] - 2023-05-2
|
||||
|
||||
- RIDER-82999 Unity's plugin SyncAll does not regenerate project files, and instead does basically nothing.
|
||||
- #2401 Compilation issue with Unity 2021.3.0f1
|
||||
|
||||
|
||||
## [3.0.21] - 2023-04-18
|
||||
|
||||
[RIDER-92424](https://youtrack.jetbrains.com/issue/RIDER-92424) JetBrains Rider Editor 3.0.20 package Update for Unity, Cause's Rider to Slows to a Crawl after updating
|
||||
[RIDER-92419](https://youtrack.jetbrains.com/issue/RIDER-92419) JetBrains Rider Editor 3.0.20 for Unity has duplicate assemblies loaded into runtime
|
||||
|
||||
|
||||
## [3.0.20] - 2023-04-05
|
||||
|
||||
- fix loading Rider integration EditorPlugin on first switch of External Editor to Rider, see [RIDER-91185](https://youtrack.jetbrains.com/issue/RIDER-91185)
|
||||
- Keep the the PackageManager in sync with the Rider changes made to the manifest.json, it should help with [RIDER-77343](https://youtrack.jetbrains.com/issue/RIDER-77343)
|
||||
- Support CompilerOptions.RoslynAdditionalFilePaths and CompilerOptions.AnalyzerConfigPath
|
||||
|
||||
|
||||
## [3.0.18] - 2023-01-09
|
||||
|
||||
- [RIDER-74818](https://youtrack.jetbrains.com/issue/RIDER-74818) Unity doesn't get to play mode if Editor is not running and user starts debug or profiling
|
||||
- Improve performance of project generation - avoid using Directory.Exists
|
||||
- avoid doing ProjectGeneration twice on the first start-up
|
||||
|
||||
|
||||
## [3.0.17] - 2022-12-01
|
||||
|
||||
- Avoid adding asset project parts to both editor and player projects, fixes the following issues:
|
||||
- [RIDER-75500](https://youtrack.jetbrains.com/issue/RIDER-75500) Local package references completions shows duplicate entries if player projects are generated
|
||||
- [RIDER-73795](https://youtrack.jetbrains.com/issue/RIDER-73795) Conversion to guid is not offered for assemblies with generated player projects
|
||||
- [RIDER-71238](https://youtrack.jetbrains.com/issue/RIDER-71238) No usages can be found for the assembly if player projects are generated
|
||||
|
||||
|
||||
## [3.0.16] - 2022-09-09
|
||||
|
||||
- Update the changelog
|
||||
- Add folders to the generated csproj files
|
||||
- Avoid extra RequestScriptReload call on the first start
|
||||
- Fix shader support for folders in packages, but outside asmdef
|
||||
|
||||
|
||||
## [3.0.15] - 2022-05-24
|
||||
|
||||
- Cleanup cache after project generation to reduce memory consumption
|
||||
- Performance optimization
|
||||
- RIDER-76126 Rider package should generate an empty csproj for empty Unity project
|
||||
- RIDER-77206 Unity 2020.1.3 'PlayerSettings' does not contain a definition for 'suppressCommonWarnings
|
||||
|
||||
|
||||
## [3.0.14] - 2022-04-21
|
||||
|
||||
- Move Rider package persisted state to Library, to avoid vcs collisions or adding it specifically to gitignore
|
||||
|
||||
|
||||
## [3.0.13] - 2022-03-24
|
||||
|
||||
- fix RIDER-69927 "Test not run" status is shown for the test suite when running unit tests for Unity project
|
||||
- fix RIDER-74676 Unity plugin "JetBrainseRider Editor" completely breaks <= 2019.1.9
|
||||
- fix RIDER-71503 Unity Hang on "Domain Unload", caused by dispose of FileSystemWatcher
|
||||
|
||||
|
||||
## [3.0.12] - 2022-01-28
|
||||
|
||||
- Fix bug, which was introduced in 3.0.10: New script was not added to the csproj, because cached list of assemblies was used.
|
||||
|
||||
|
||||
## [3.0.10] - 2021-12-09
|
||||
|
||||
- Fix presentation of the TargetFramework in the csproj
|
||||
- Fix: Auto-generated solution doesn't compile when code overrides virtual functions in other assemblies
|
||||
- Fix RIDER-72234 Avoid full project generation, when only content of assembly was changed
|
||||
- Fix RIDER-71985 Building large Unity projects randomly fails
|
||||
- Fix RIDER-72174 Looking for Rider installed by dotUltimate installer
|
||||
|
||||
|
||||
## [3.0.9] - 2021-11-09
|
||||
|
||||
- Fix path for Roslyn analyser supplied with a package
|
||||
- Minimal requirement for roslyn analyzer scope is Unity 2020.3.6f1 and above
|
||||
|
||||
|
||||
## [3.0.8] - 2021-11-08
|
||||
|
||||
- Technical release
|
||||
|
||||
|
||||
## [3.0.7] - 2021-05-07
|
||||
|
||||
- RIDER-60815 Simplify extensions lists for Rider package
|
||||
- Fix csc.rsp `-nullable+` / `-nullable-` parsing https://github.com/van800/com.unity.ide.rider/issues/7
|
||||
- Support `-warnaserror`/`-warnaserror-:`/`-warnaserror+:` in csc.rsp
|
||||
|
||||
|
||||
## [3.0.6] - 2021-04-06
|
||||
|
||||
- Fix bug: For Unity 2021.1+ Switching external editor from VS => Rider won't create the connection between Unity and Rider.
|
||||
- When PlayerSettings.suppressCommonWarnings is true, it is reflected in the generated csproj with NoWarn "0169", "0649"
|
||||
- By default include T4 templates in the generated solution (RIDER-37159)
|
||||
- RIDER-60554 Unity crash in case of project without Unity Test Framework Package.
|
||||
- RIDER-60445 Fix presentation of Rider external editor, when it is installed in a custom location.
|
||||
- Improve project files generation performance
|
||||
- RIDER-60508 Project Generation for projects without any cs files - add reference to UnityEditor/UnityEngine, so that Rider would detect Unity path and version and provide rich features for shader file.
|
||||
|
||||
|
||||
## [3.0.5] - 2021-02-25
|
||||
|
||||
- More stable in case of possible Rider product code change, improve test. Allows using "Rider for Unreal" with Unity projects (https://youtrack.jetbrains.com/issue/RIDER-51203)
|
||||
- Remove implicit dependency to Test-Framework package
|
||||
- Fix "Unreachable code detected" warning (https://youtrack.jetbrains.com/issue/RIDER-57930)
|
||||
|
||||
|
||||
## [3.0.4] - 2021-01-26
|
||||
|
||||
- Use LangVersion provided by Unity for generated csproj
|
||||
- Improve documentation
|
||||
- Support nullable provided in csc,rsp
|
||||
- Avoid doing work in Unity secondary processes in UNITY_2021_1_OR_NEWER with UnityEditor.MPE.ProcessLevel.Secondary
|
||||
|
||||
|
||||
## [3.0.3] - 2020-11-18
|
||||
|
||||
- Update License
|
||||
- Avoid connecting Rider from secondary UnityEditor instances
|
||||
- Fix RIDER-53082 - Generate csproj without cs files, when there are any assets inside
|
||||
|
||||
|
||||
## [3.0.2] - 2020-10-27
|
||||
- Speedup ProjectGeneration
|
||||
- Fix RIDER-51958. Callbacks OnGeneratedCSProjectFiles would not work, but show a Warning instead.
|
||||
- Remove release configuration
|
||||
- Call RequestScriptReload, when External Editor is changed in Unity.
|
||||
|
||||
|
||||
## [3.0.1] - 2020-10-02
|
||||
|
||||
- RIDER-46658 Rider does not run PlayMode tests when ValueSource is combined with parameterized TestFixture
|
||||
- RIDER-49947 Invoking `PlayerSettings.SetScriptingDefineSymbolsForGroup()` does not update definitions in Rider.
|
||||
- Add static entrypoint `Packages.Rider.Editor.RiderScriptEditor.SyncSolution` to allow generating solution from commandline.
|
||||
|
||||
## [2.0.7] - 2020-08-18
|
||||
- Improve performance
|
||||
- Add support for asmdef Root Namespace in .csproj generation
|
||||
- ProjectGeneration for custom roslyn analysers https://docs.unity3d.com/2020.2/Documentation/Manual/roslyn-analyzers.html
|
||||
- Switch target platform in Unity would regenerate csproj files (https://github.com/JetBrains/resharper-unity/issues/1740)
|
||||
|
||||
|
||||
## [2.0.6] - 2020-08-10
|
||||
- Improve performance
|
||||
- Add support for asmdef Root Namespace in .csproj generation
|
||||
- ProjectGeneration for custom roslyn analysers https://docs.unity3d.com/2020.2/Documentation/Manual/roslyn-analyzers.html
|
||||
- Switch target platform in Unity would regenerate csproj files (https://github.com/JetBrains/resharper-unity/issues/1740)
|
||||
|
||||
|
||||
## [2.0.5] - 2020-05-27
|
||||
- Fix Regression in 2.0.3: In Unity 2019.2.9 on Mac, changing csproj and calling AssetDatabase.Refresh is not regenerating csproj.
|
||||
- Regenerate projects on changes in manifest.json and Project Settings (EditorOnlyScriptingUserSettings.json) (#51)
|
||||
- Fix: Assembly references to package assemblies break IDE projects.
|
||||
- Fix: Reporting test duration.
|
||||
|
||||
|
||||
## [2.0.2] - 2020-03-18
|
||||
- fix bug in searching Rider path on MacOS
|
||||
|
||||
|
||||
## [2.0.1] - 2020-03-05
|
||||
- Speed improvements,
|
||||
- ProjectTypeGuids for unity-generated project
|
||||
- Improve UI for Project Generation settings
|
||||
- Changes in csc.rsp would cause project-generation
|
||||
- Remove NoWarn 0169 from generated csproj
|
||||
- Support custom JetBrains Toolbox installation location
|
||||
|
||||
## [1.2.1] - 2019-12-09
|
||||
|
||||
- Load optimised EditorPlugin version compiled to net 461, with fallback to previous version.
|
||||
- On ExternalEditor settings page: reorder Generate all ... after Extensions handled
|
||||
- Better presentation for Rider of some version in ExternalEditors list
|
||||
- Initial support for Code Coverage with dotCover plugin in Rider
|
||||
- Added support for Player Project generation
|
||||
|
||||
## [1.1.4] - 2019-11-21
|
||||
- Fix warning - unreachable code
|
||||
|
||||
## [1.1.3] - 2019-10-17
|
||||
|
||||
- Update External Editor, when new toolbox build was installed
|
||||
- Add xaml to default list of extensions to include in csproj
|
||||
- Avoid initializing Rider package in secondary Unity process, which does Asset processing
|
||||
- Reflect multiple csc.rsp arguments to generated csproj files: https://github.com/JetBrains/resharper-unity/issues/1337
|
||||
- Setting, which allowed to override LangVersion removed in favor of langversion in csc.rsp
|
||||
- Environment.NewLine is used in generated project files instead of Windows line separator.
|
||||
|
||||
## [1.1.2] - 2019-09-18
|
||||
|
||||
performance optimizations:
|
||||
- avoid multiple evaluations
|
||||
- avoid reflection in DisableSyncSolutionOnceCallBack
|
||||
- project generation optimization
|
||||
fixes:
|
||||
- avoid compilation error with incompatible `Test Framework` package
|
||||
|
||||
## [1.1.1] - 2019-08-26
|
||||
|
||||
parse nowarn in csc.rsp
|
||||
warning, when Unity was started from Rider, but external editor was different
|
||||
improved unit test support
|
||||
workaround to avoid Unity internal project-generation (fix #28)
|
||||
|
||||
|
||||
## [1.1.0] - 2019-07-02
|
||||
|
||||
new setting to manage list of extensions to be opened with Rider
|
||||
avoid breaking everything on any unhandled exception in RiderScriptEditor cctor
|
||||
hide Rider settings, when different Editor is selected
|
||||
dynamically load only newer rider plugins
|
||||
path detection (work on unix symlinks)
|
||||
speed up for project generation
|
||||
lots of bug fixing
|
||||
|
||||
## [1.0.8] - 2019-05-20
|
||||
|
||||
Fix NullReferenceException when External editor was pointing to non-existing Rider everything was broken by null-ref.
|
||||
|
||||
## [1.0.7] - 2019-05-16
|
||||
|
||||
Initial migration steps from rider plugin to package.
|
||||
Fix OSX check and opening of files.
|
||||
|
||||
## [1.0.6] - 2019-04-30
|
||||
|
||||
Ensure asset database is refreshed when generating csproj and solution files.
|
||||
|
||||
## [1.0.5] - 2019-04-27
|
||||
|
||||
Add support for generating all csproj files.
|
||||
|
||||
## [1.0.4] - 2019-04-18
|
||||
|
||||
Fix relative package paths.
|
||||
Fix opening editor on mac.
|
||||
|
||||
## [1.0.3] - 2019-04-12
|
||||
|
||||
Fixing null reference issue for callbacks to Asset pipeline.
|
||||
|
||||
## [1.0.2] - 2019-01-01
|
||||
|
||||
### This is the first release of *Unity Package rider_editor*.
|
||||
|
||||
Using the newly created api to integrate Rider with Unity.
|
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8645aa9c3c74fb34ba9499e14fb332b5
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,6 @@
|
||||
# Contributing
|
||||
|
||||
## All contributions are subject to the [Unity Contribution Agreement(UCA)](https://unity3d.com/legal/licenses/Unity_Contribution_Agreement)
|
||||
By making a pull request, you are confirming agreement to the terms and conditions of the UCA, including that your Contributions are your original creation and that you have complete right and authority to make your Contributions.
|
||||
|
||||
## Once you have a change ready following these ground rules. Simply make a pull request
|
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5e83f8baac96eaa47bdd9ca781cd2002
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,4 @@
|
||||
# Code Editor Package for Rider
|
||||
|
||||
This package is not intended to be modified by users.
|
||||
Nor does it provide any api intended to be included in user projects.
|
@@ -0,0 +1,2 @@
|
||||
* [About JetBrains Rider Editor](index.md)
|
||||
* [Using the JetBrains Rider Editor package](using-the-jetbrains-rider-editor-package.md)
|
Binary file not shown.
After Width: | Height: | Size: 26 KiB |
Binary file not shown.
After Width: | Height: | Size: 69 KiB |
@@ -0,0 +1,32 @@
|
||||
# About JetBrains Rider Editor
|
||||
|
||||
The JetBrains Rider editor package integrates support for the [JetBrains Rider](https://www.jetbrains.com/rider/) .NET Integrated Development Environment (IDE), into the Unity Editor. This package provides an end-point for Rider to call different Unity APIs and to generate .csproj and .sln files, which Rider uses to implement support for Unity in its [plug-in](https://github.com/JetBrains/resharper-unity).
|
||||
|
||||
This package ensures that IDE features like autocomplete suggestions and flagging dependency conflicts work in Rider. It uses .cproj and .sln files which store information about your project such as:
|
||||
|
||||
* Versioning information
|
||||
* Build files
|
||||
* Platform requirements
|
||||
* Web server or database settings
|
||||
|
||||
Not all code in Unity is directly visible to code editors, particularly when using packages. This is because packages don’t provide their own .csproj files, and Unity doesn’t create them for installed packages by default. This means that IDE features like autocomplete suggestions and flagging dependency conflicts do not work with code in these packages. The purpose of this package is to produce the .csproj files that make these features possible by default when you use Rider.
|
||||
|
||||
## Installation
|
||||
|
||||
As of Unity version 2019.2, this package comes as a part of the default Unity installation. If you are updating your project from an older version of Unity, you might need to install this package via the Package Manager.
|
||||
|
||||
## Requirements
|
||||
|
||||
This version of the JetBrains Rider editor package is compatible with the following versions of the Unity Editor:
|
||||
|
||||
* 2019.2.6 or later
|
||||
|
||||
To use this package, you must have the following third-party products installed:
|
||||
|
||||
* JetBrains Rider version 2019.3 or newer
|
||||
|
||||
For more information about the Rider IDE, see the [JetBrains Rider documentation](https://www.jetbrains.com/rider/documentation/).
|
||||
|
||||
### Submitting issues
|
||||
|
||||
This package is maintained by JetBrains and Unity. Submit issues to the [JetBrains/resharper-unity/issues GitHub page](https://github.com/JetBrains/resharper-unity/issues). Unity intends for this package to become accessible to the public on GitHub in the future.
|
@@ -0,0 +1,55 @@
|
||||
|
||||
# Using the JetBrains Rider Editor package
|
||||
|
||||
To use the package, go to **Edit > Preferences > External Tools**, click on the **External Script Editor** dropdown menu and select your version of **Rider**. When you select this option, the window reloads.
|
||||
|
||||
After the window reloads, new settings that control production of .csproj files become available.
|
||||
|
||||
 <br/>
|
||||
*External Tools tab in the Preferences window*
|
||||
|
||||
## Commandline endpoints
|
||||
|
||||
Q: Generate sln/csproj files for CI?
|
||||
|
||||
A: `Unity -batchmode -quit -projectPath ProjectPath -executeMethod Packages.Rider.Editor.RiderScriptEditor.SyncSolution`
|
||||
|
||||
Q: Generate sln/csproj and open External Editor?
|
||||
|
||||
A: `Unity -batchmode -quit -projectPath ProjectPath -executeMethod Packages.Rider.Editor.RiderScriptEditor.SyncSolutionAndOpenExternalEditor`
|
||||
|
||||
## Package preferences
|
||||
|
||||
|**Property:** |**Description:** |
|
||||
|:---|:---|
|
||||
|__Extensions handled__| This field lists the file extensions that open in JetBrains Rider. This field contains a variety of extensions by default. |
|
||||
|__Generate .csproj files for:__ | Each setting in this list enables or disables production of .csproj files for a different type of package. The **Regenerate project files** button updates existing .csproj files and creates the necessary new ones based on the settings you choose. These settings control whether to generate .csproj files for any installed packages. For more information on how to install packages, see the [Adding and removing packages documentation](https://docs.unity3d.com/Manual/upm-ui-actions.html). |
|
||||
|__ Embedded packages__ | Any package that appears under your project’s Packages folder is an embedded package. An embedded package is not necessarily built-in; you can create your own packages and embed them inside your project. This setting is enabled by default. For more information on embedded packages, see the [Embedded dependencies documentation](https://docs.unity3d.com/Manual/upm-embed.html). |
|
||||
|__ Local packages__ | Any package that you install from a local repository stored on your machine, but from outside of your Unity project. This setting is enabled by default. |
|
||||
|__ Registry packages__ | Any package that you install from either the official Unity registry or a custom registry. Packages in the Unity registry are available to install directly from the Package Manager. For more information about the Unity package registry, see the [Package Registry section of the Unity Package Manager documentation](https://docs.unity3d.com/Packages/com.unity.package-manager-ui@1.8/manual/index.html#PackManRegistry). For information on creating and using custom registries in addition to the Unity registry, see the [Scoped package registries documentation](https://docs.unity3d.com/Manual/upm-scoped.html). |
|
||||
|__ Git packages__ | Any package you install directly from a Git repository using a URL. |
|
||||
|__ Built-in packages__ | Any package that is already installed as part of the default Unity installation. |
|
||||
|__ Tarball packages__ | Any package you install from a GZip tarball archive on the local machine, outside of your Unity project. |
|
||||
|__ Unknown packages__ | Any package which Unity cannot determine an origin for. This could be because the package doesn’t list its origin, or that Unity doesn’t recognize the origin listed. |
|
||||
|__Player projects__ | For each player project, generate an additional .csproj file named 'originalProjectName.Player.csproj'. This allows different project types to have their code included in Rider’s systems, such as assembly definitions or testing suites. |
|
||||
|
||||
This package also adds a second tab under **Preferences** named **Rider**, pictured below.
|
||||
|
||||

|
||||
<br/>*Rider tab in the Preferences window*
|
||||
|
||||
> [!NOTE]
|
||||
> The Logging Level menu does not control the level of Unity's logging, only the level of log messages that Rider package logs in its own log file. For more information on controlling Unity's logging level, see the [Stack Trace Logging section of the Console Window documentation](https://docs.unity3d.com/Manual/Console.html#StackTraceLogging).
|
||||
|
||||
|**Property:** |**Description:** |
|
||||
|:---|:---|
|
||||
|__**Pass Console to Rider**__| If **Pass Console to Rider** is enabled, Rider can access data that Unity sends to the Unity Console and display it within its own environment instead. |
|
||||
|__**Log file**__ | The **Log file** field contains an **Open log** button. Select this button to open the log file inside the Rider IDE. This button is unavailable when **Logging Level** is set to **OFF**. |
|
||||
|__Logging Level__ | The **Logging Level** menu controls how detailed are the Rider package logs. Those logs may be used for troubleshooting communication between Rider and Unity. Rider package logs all messages of the type you select as well as any messages of a more severe type. For example, if you choose **WARN**, then Rider logs all **ERROR** and **FATAL** messages as well as **WARN** messages. The message types are listed below in order of severity, with **FATAL** as the most severe type of message and **TRACE** as the least severe. |
|
||||
|__**OFF**__ | Rider does not produce any logs. |
|
||||
|__**FATAL__ | Logs information relating to serious problems that cause the application to crash. This setting produces the smallest logs. |
|
||||
|__**ERROR**__ | Logs information about errors that prevent some functionality from working, but don’t cause the application to fail (for example, a failed database connection). |
|
||||
|__**WARN**__ | Logs information about possible problems, or any unusual behaviour. Warnings don’t indicate that something has gone wrong, but that Unity detects something that might potentially cause an issue if not investigated. |
|
||||
|__**INFO**__ | Logs information about normal operation of the application, such as a successful database connection attempt. |
|
||||
|__**VERBOSE**__ | Logs detailed but not exhaustive information about your code. This setting is helpful for checking how your code executes or providing diagnostic information for other developers. |
|
||||
|__**TRACE**__ | Logs as much information about the application as possible. This can create a very large and detailed log, so it’s good practice to only use it when attempting to find the cause of a specific issue with your code. |
|
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2019 Unity Technologies Copyright (c) 2019 JetBrains s.r.o. All rights reserved.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5598b14661b5f4c43bed757f34b6d172
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9129183a42052cd43b9c284d6dbd541e
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1b393f6b29a9ee84c803af1ab4944b71
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,111 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using JetBrains.Rider.PathLocator;
|
||||
using Packages.Rider.Editor.Util;
|
||||
using Unity.CodeEditor;
|
||||
|
||||
namespace Packages.Rider.Editor
|
||||
{
|
||||
internal interface IDiscovery
|
||||
{
|
||||
CodeEditor.Installation[] PathCallback();
|
||||
}
|
||||
|
||||
internal class Discovery : IDiscovery
|
||||
{
|
||||
public static readonly RiderPathLocator RiderPathLocator;
|
||||
public static readonly RiderFileOpener RiderFileOpener;
|
||||
|
||||
static Discovery()
|
||||
{
|
||||
var env = new RiderLocatorEnvironment();
|
||||
RiderPathLocator = new RiderPathLocator(env);
|
||||
RiderFileOpener = new RiderFileOpener(env);
|
||||
}
|
||||
|
||||
public CodeEditor.Installation[] PathCallback()
|
||||
{
|
||||
// still we want to search for installations, when Preferences is opened
|
||||
|
||||
var res = RiderPathLocator.GetAllRiderPaths()
|
||||
.Select(riderInfo => new CodeEditor.Installation
|
||||
{
|
||||
Path = riderInfo.Path,
|
||||
Name = riderInfo.Presentation
|
||||
})
|
||||
.ToList();
|
||||
|
||||
var editorPath = RiderScriptEditor.CurrentEditor;
|
||||
if (RiderScriptEditor.IsRiderOrFleetInstallation(editorPath) &&
|
||||
!res.Any(a => a.Path == editorPath) &&
|
||||
FileSystemUtil.EditorPathExists(editorPath))
|
||||
{
|
||||
// External editor manually set from custom location
|
||||
var info = new RiderPathLocator.RiderInfo(RiderPathLocator, editorPath, false);
|
||||
var installation = new CodeEditor.Installation
|
||||
{
|
||||
Path = info.Path,
|
||||
Name = info.Presentation
|
||||
};
|
||||
res.Add(installation);
|
||||
}
|
||||
|
||||
return res.ToArray();
|
||||
}
|
||||
}
|
||||
|
||||
internal class RiderLocatorEnvironment : IRiderLocatorEnvironment
|
||||
{
|
||||
public OS CurrentOS
|
||||
{
|
||||
get
|
||||
{
|
||||
switch (UnityEngine.SystemInfo.operatingSystemFamily)
|
||||
{
|
||||
case UnityEngine.OperatingSystemFamily.Windows:
|
||||
return OS.Windows;
|
||||
case UnityEngine.OperatingSystemFamily.MacOSX:
|
||||
return OS.MacOSX;
|
||||
case UnityEngine.OperatingSystemFamily.Linux:
|
||||
return OS.Linux;
|
||||
default:
|
||||
return OS.Other;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public T FromJson<T>(string json)
|
||||
{
|
||||
return (T)UnityEngine.JsonUtility.FromJson(json, typeof(T));
|
||||
}
|
||||
|
||||
public void Verbose(string message, Exception e = null)
|
||||
{
|
||||
// only writes to Editor.log
|
||||
Console.WriteLine(message);
|
||||
if (e != null)
|
||||
Console.WriteLine(e);
|
||||
}
|
||||
|
||||
public void Info(string message, Exception e = null)
|
||||
{
|
||||
UnityEngine.Debug.Log(message);
|
||||
if (e != null)
|
||||
UnityEngine.Debug.Log(e);
|
||||
}
|
||||
|
||||
public void Warn(string message, Exception e = null)
|
||||
{
|
||||
UnityEngine.Debug.LogWarning(message);
|
||||
if (e != null)
|
||||
UnityEngine.Debug.LogWarning(e);
|
||||
}
|
||||
|
||||
public void Error(string message, Exception e = null)
|
||||
{
|
||||
UnityEngine.Debug.LogError(message);
|
||||
if (e != null)
|
||||
UnityEngine.Debug.LogException(e);
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: dab656c79e1985c40b31faebcda44442
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,151 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using Debug = UnityEngine.Debug;
|
||||
|
||||
namespace Packages.Rider.Editor
|
||||
{
|
||||
internal static class EditorPluginInterop
|
||||
{
|
||||
private static string EditorPluginAssemblyNamePrefix = "JetBrains.Rider.Unity.Editor.Plugin.";
|
||||
public static readonly string EditorPluginAssemblyName = $"{EditorPluginAssemblyNamePrefix}Net46.Repacked";
|
||||
public static readonly string EditorPluginAssemblyNameFallback = $"{EditorPluginAssemblyNamePrefix}Full.Repacked";
|
||||
private static string ourEntryPointTypeName = "JetBrains.Rider.Unity.Editor.PluginEntryPoint";
|
||||
|
||||
private static Assembly ourEditorPluginAssembly;
|
||||
|
||||
public static Assembly EditorPluginAssembly
|
||||
{
|
||||
get
|
||||
{
|
||||
if (ourEditorPluginAssembly != null)
|
||||
return ourEditorPluginAssembly;
|
||||
var assemblies = AppDomain.CurrentDomain.GetAssemblies();
|
||||
ourEditorPluginAssembly = assemblies.FirstOrDefault(a =>
|
||||
{
|
||||
try
|
||||
{
|
||||
return a.GetName().Name.StartsWith(EditorPluginAssemblyNamePrefix); // some user assemblies may fail here
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
|
||||
return default;
|
||||
});
|
||||
return ourEditorPluginAssembly;
|
||||
}
|
||||
}
|
||||
|
||||
private static void DisableSyncSolutionOnceCallBack()
|
||||
{
|
||||
// RiderScriptableSingleton.Instance.CsprojProcessedOnce = true;
|
||||
// Otherwise EditorPlugin regenerates all on every AppDomain reload
|
||||
var assembly = EditorPluginAssembly;
|
||||
if (assembly == null) return;
|
||||
var type = assembly.GetType("JetBrains.Rider.Unity.Editor.Utils.RiderScriptableSingleton");
|
||||
if (type == null) return;
|
||||
var baseType = type.BaseType;
|
||||
if (baseType == null) return;
|
||||
var instance = baseType.GetProperty("Instance");
|
||||
if (instance == null) return;
|
||||
var instanceVal = instance.GetValue(null);
|
||||
var member = type.GetProperty("CsprojProcessedOnce");
|
||||
if (member==null) return;
|
||||
member.SetValue(instanceVal, true);
|
||||
}
|
||||
|
||||
public static string LogPath
|
||||
{
|
||||
get
|
||||
{
|
||||
try
|
||||
{
|
||||
var assembly = EditorPluginAssembly;
|
||||
if (assembly == null) return null;
|
||||
var type = assembly.GetType(ourEntryPointTypeName);
|
||||
if (type == null) return null;
|
||||
var field = type.GetField("LogPath", BindingFlags.NonPublic | BindingFlags.Static);
|
||||
if (field == null) return null;
|
||||
return field.GetValue(null) as string;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
Debug.Log("Unable to do OpenFile to Rider from dll, fallback to com.unity.ide.rider implementation.");
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool OpenFileDllImplementation(string path, int line, int column)
|
||||
{
|
||||
var openResult = false;
|
||||
// reflection for fast OpenFileLineCol, when Rider is started and protocol connection is established
|
||||
try
|
||||
{
|
||||
var assembly = EditorPluginAssembly;
|
||||
if (assembly == null) return false;
|
||||
var type = assembly.GetType(ourEntryPointTypeName);
|
||||
if (type == null) return false;
|
||||
var field = type.GetField("OpenAssetHandler", BindingFlags.NonPublic | BindingFlags.Static);
|
||||
if (field == null) return false;
|
||||
var handlerInstance = field.GetValue(null);
|
||||
var method = handlerInstance.GetType()
|
||||
.GetMethod("OnOpenedAsset", new[] {typeof(string), typeof(int), typeof(int)});
|
||||
if (method == null) return false;
|
||||
var assetFilePath = path;
|
||||
if (!string.IsNullOrEmpty(path))
|
||||
assetFilePath = Path.GetFullPath(path);
|
||||
|
||||
openResult = (bool) method.Invoke(handlerInstance, new object[] {assetFilePath, line, column});
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Log("Unable to do OpenFile to Rider from dll, fallback to com.unity.ide.rider implementation.");
|
||||
Debug.LogException(e);
|
||||
}
|
||||
|
||||
return openResult;
|
||||
}
|
||||
|
||||
public static bool EditorPluginIsLoadedFromAssets(Assembly assembly)
|
||||
{
|
||||
if (assembly == null)
|
||||
return false;
|
||||
var location = assembly.Location;
|
||||
var currentDir = Directory.GetCurrentDirectory();
|
||||
return location.StartsWith(currentDir, StringComparison.InvariantCultureIgnoreCase);
|
||||
}
|
||||
|
||||
|
||||
internal static void InitEntryPoint(Assembly assembly)
|
||||
{
|
||||
try
|
||||
{
|
||||
var version = RiderScriptEditorData.instance.editorBuildNumber;
|
||||
if (version != null)
|
||||
{
|
||||
if (version.Major < 192)
|
||||
DisableSyncSolutionOnceCallBack(); // is require for Rider prior to 2019.2
|
||||
}
|
||||
else
|
||||
DisableSyncSolutionOnceCallBack();
|
||||
|
||||
var type = assembly.GetType("JetBrains.Rider.Unity.Editor.AfterUnity56.EntryPoint");
|
||||
if (type == null)
|
||||
type = assembly.GetType("JetBrains.Rider.Unity.Editor.UnitTesting.EntryPoint"); // oldRider
|
||||
RuntimeHelpers.RunClassConstructor(type.TypeHandle);
|
||||
}
|
||||
catch (TypeInitializationException ex)
|
||||
{
|
||||
Debug.LogException(ex);
|
||||
if (ex.InnerException != null)
|
||||
Debug.LogException(ex.InnerException);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f9bd02a3a916be64c9b47b1305149423
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Binary file not shown.
@@ -0,0 +1,69 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ea3ec41b33345cd4f9298a51abdaa198
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 1
|
||||
isExplicitlyReferenced: 1
|
||||
validateReferences: 0
|
||||
platformData:
|
||||
- first:
|
||||
: Any
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
Exclude Editor: 0
|
||||
Exclude Linux64: 1
|
||||
Exclude OSXUniversal: 1
|
||||
Exclude Win: 1
|
||||
Exclude Win64: 1
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
DefaultValueInitialized: true
|
||||
OS: AnyOS
|
||||
- first:
|
||||
Standalone: Linux64
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
- first:
|
||||
Standalone: OSXUniversal
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: None
|
||||
- first:
|
||||
Standalone: Win
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: x86
|
||||
- first:
|
||||
Standalone: Win64
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: x86_64
|
||||
- first:
|
||||
Windows Store Apps: WindowsStoreApps
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,22 @@
|
||||
namespace Packages.Rider.Editor
|
||||
{
|
||||
internal enum LoggingLevel
|
||||
{
|
||||
/// <summary>
|
||||
/// Do not use it in logging. Only in config to disable logging.
|
||||
/// </summary>
|
||||
OFF,
|
||||
/// <summary>For errors that lead to application failure</summary>
|
||||
FATAL,
|
||||
/// <summary>For errors that must be shown in Exception Browser</summary>
|
||||
ERROR,
|
||||
/// <summary>Suspicious situations but not errors</summary>
|
||||
WARN,
|
||||
/// <summary>Regular level for important events</summary>
|
||||
INFO,
|
||||
/// <summary>Additional info for debbuging</summary>
|
||||
VERBOSE,
|
||||
/// <summary>Methods & callstacks tracing, more than verbose</summary>
|
||||
TRACE,
|
||||
}
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 71bb46b59a9a7a346bbab1e185c723df
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,111 @@
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Packages.Rider.Editor
|
||||
{
|
||||
internal static class PluginSettings
|
||||
{
|
||||
public static LoggingLevel SelectedLoggingLevel
|
||||
{
|
||||
get => (LoggingLevel) EditorPrefs.GetInt("Rider_SelectedLoggingLevel", 0);
|
||||
private set => EditorPrefs.SetInt("Rider_SelectedLoggingLevel", (int) value);
|
||||
}
|
||||
|
||||
public static bool LogEventsCollectorEnabled
|
||||
{
|
||||
get => EditorPrefs.GetBool("Rider_LogEventsCollectorEnabled", true);
|
||||
private set => EditorPrefs.SetBool("Rider_LogEventsCollectorEnabled", value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Preferences menu layout
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Contains all 3 toggles: Enable/Disable; Debug On/Off; Writing Launch File On/Off
|
||||
/// </remarks>
|
||||
[SettingsProvider]
|
||||
private static SettingsProvider RiderPreferencesItem()
|
||||
{
|
||||
if (!RiderScriptEditor.IsRiderOrFleetInstallation(RiderScriptEditor.CurrentEditor))
|
||||
return null;
|
||||
if (!RiderScriptEditorData.instance.shouldLoadEditorPlugin)
|
||||
return null;
|
||||
var provider = new SettingsProvider("Preferences/Rider", SettingsScope.User)
|
||||
{
|
||||
label = "Rider",
|
||||
keywords = new[] { "Rider" },
|
||||
guiHandler = (searchContext) =>
|
||||
{
|
||||
EditorGUIUtility.labelWidth = 200f;
|
||||
EditorGUILayout.BeginVertical();
|
||||
|
||||
GUILayout.BeginVertical();
|
||||
LogEventsCollectorEnabled =
|
||||
EditorGUILayout.Toggle(new GUIContent("Pass Console to Rider:"), LogEventsCollectorEnabled);
|
||||
|
||||
GUILayout.EndVertical();
|
||||
GUILayout.Label("");
|
||||
|
||||
if (!string.IsNullOrEmpty(EditorPluginInterop.LogPath))
|
||||
{
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
EditorGUILayout.PrefixLabel("Log file:");
|
||||
var previous = GUI.enabled;
|
||||
GUI.enabled = previous && SelectedLoggingLevel != LoggingLevel.OFF;
|
||||
var button = GUILayout.Button(new GUIContent("Open log"));
|
||||
if (button)
|
||||
{
|
||||
// would use Rider if `log` is on the list of extensions, otherwise would use editor configured in the OS
|
||||
UnityEditorInternal.InternalEditorUtility.OpenFileAtLineExternal(EditorPluginInterop.LogPath, 0);
|
||||
}
|
||||
|
||||
GUI.enabled = previous;
|
||||
GUILayout.EndHorizontal();
|
||||
}
|
||||
|
||||
var loggingMsg =
|
||||
@"Sets the amount of Rider Debug output. If you are about to report an issue, please select Verbose logging level and attach Unity console output to the issue.";
|
||||
SelectedLoggingLevel =
|
||||
(LoggingLevel) EditorGUILayout.EnumPopup(new GUIContent("Logging Level:", loggingMsg),
|
||||
SelectedLoggingLevel);
|
||||
|
||||
|
||||
EditorGUILayout.HelpBox(loggingMsg, MessageType.None);
|
||||
|
||||
const string url = "https://github.com/JetBrains/resharper-unity";
|
||||
if (LinkButton(url))
|
||||
Application.OpenURL(url);;
|
||||
|
||||
GUILayout.FlexibleSpace();
|
||||
GUILayout.BeginHorizontal();
|
||||
|
||||
GUILayout.FlexibleSpace();
|
||||
var assembly = EditorPluginInterop.EditorPluginAssembly;
|
||||
if (assembly != null)
|
||||
{
|
||||
var version = assembly.GetName().Version;
|
||||
GUILayout.Label("Plugin version: " + version, new GUIStyle(GUI.skin.label)
|
||||
{
|
||||
margin = new RectOffset(4, 4, 4, 4),
|
||||
});
|
||||
}
|
||||
|
||||
GUILayout.EndHorizontal();
|
||||
|
||||
EditorGUILayout.EndVertical();
|
||||
}
|
||||
};
|
||||
return provider;
|
||||
}
|
||||
|
||||
public static bool LinkButton(string url)
|
||||
{
|
||||
var bClicked = GUILayout.Button(url, RiderStyles.LinkLabelStyle);
|
||||
var rect = GUILayoutUtility.GetLastRect();
|
||||
rect.width = RiderStyles.LinkLabelStyle.CalcSize(new GUIContent(url)).x;
|
||||
EditorGUIUtility.AddCursorRect(rect, MouseCursor.Link);
|
||||
|
||||
return bClicked;
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1bfe12aa306c0c74db4f4f1a1a0ae5ce
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: aa290bd9a165a0543a4bf85ac73914bc
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,16 @@
|
||||
using Unity.CodeEditor;
|
||||
using UnityEditor;
|
||||
|
||||
namespace Packages.Rider.Editor.PostProcessors
|
||||
{
|
||||
internal class RiderAssetPostprocessor: AssetPostprocessor
|
||||
{
|
||||
public static bool OnPreGeneratingCSProjectFiles()
|
||||
{
|
||||
var path = RiderScriptEditor.GetEditorRealPath(CodeEditor.CurrentEditorInstallation);
|
||||
if (RiderScriptEditor.IsRiderOrFleetInstallation(path))
|
||||
return !ProjectGeneration.ProjectGeneration.isRiderProjectGeneration;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 45471ad7b8c1f964da5e3c07d57fbf4f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 313cbe17019f1934397f91069831062c
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,253 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEditor;
|
||||
using UnityEditor.Compilation;
|
||||
using UnityEditor.PackageManager;
|
||||
using PackageInfo = UnityEditor.PackageManager.PackageInfo;
|
||||
|
||||
namespace Packages.Rider.Editor.ProjectGeneration
|
||||
{
|
||||
internal class AssemblyNameProvider : IAssemblyNameProvider
|
||||
{
|
||||
private readonly Dictionary<string, PackageInfo> m_PackageInfoCache = new Dictionary<string, PackageInfo>();
|
||||
private readonly Dictionary<string, ResponseFileData> m_ResponseFilesCache = new Dictionary<string, ResponseFileData>();
|
||||
private readonly string[] _specialPackagesForProjectGen = new[] { "com.unity.entities", "com.unity.collections" };
|
||||
|
||||
ProjectGenerationFlag m_ProjectGenerationFlag = (ProjectGenerationFlag)EditorPrefs.GetInt("unity_project_generation_flag", 3);
|
||||
|
||||
public string[] ProjectSupportedExtensions => EditorSettings.projectGenerationUserExtensions;
|
||||
|
||||
public string ProjectGenerationRootNamespace => EditorSettings.projectGenerationRootNamespace;
|
||||
|
||||
private Assembly[] m_AllEditorAssemblies;
|
||||
private Assembly[] m_AllPlayerAssemblies;
|
||||
private Assembly[] m_AllAssemblies;
|
||||
|
||||
public ProjectGenerationFlag ProjectGenerationFlag
|
||||
{
|
||||
get => m_ProjectGenerationFlag;
|
||||
private set
|
||||
{
|
||||
EditorPrefs.SetInt("unity_project_generation_flag", (int)value);
|
||||
m_ProjectGenerationFlag = value;
|
||||
}
|
||||
}
|
||||
|
||||
public string GetAssemblyNameFromScriptPath(string path)
|
||||
{
|
||||
return CompilationPipeline.GetAssemblyNameFromScriptPath(path);
|
||||
}
|
||||
|
||||
public Assembly[] GetAllAssemblies()
|
||||
{
|
||||
if (m_AllEditorAssemblies == null)
|
||||
{
|
||||
m_AllEditorAssemblies = GetAssembliesByType(AssembliesType.Editor);
|
||||
m_AllAssemblies = m_AllEditorAssemblies;
|
||||
}
|
||||
|
||||
if (ProjectGenerationFlag.HasFlag(ProjectGenerationFlag.PlayerAssemblies))
|
||||
{
|
||||
if (m_AllPlayerAssemblies == null)
|
||||
{
|
||||
m_AllPlayerAssemblies = GetAssembliesByType(AssembliesType.Player);
|
||||
m_AllAssemblies = new Assembly[m_AllEditorAssemblies.Length + m_AllPlayerAssemblies.Length];
|
||||
Array.Copy(m_AllEditorAssemblies, m_AllAssemblies, m_AllEditorAssemblies.Length);
|
||||
Array.Copy(m_AllPlayerAssemblies, 0, m_AllAssemblies, m_AllEditorAssemblies.Length, m_AllPlayerAssemblies.Length);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return m_AllAssemblies;
|
||||
}
|
||||
|
||||
private static Assembly[] GetAssembliesByType(AssembliesType type)
|
||||
{
|
||||
// This is a very expensive Unity call...
|
||||
var compilationPipelineAssemblies = CompilationPipeline.GetAssemblies(type);
|
||||
var assemblies = new Assembly[compilationPipelineAssemblies.Length];
|
||||
var i = 0;
|
||||
foreach (var compilationPipelineAssembly in compilationPipelineAssemblies)
|
||||
{
|
||||
// The CompilationPipeline's assemblies have an output path of Libraries/ScriptAssemblies
|
||||
// TODO: It might be worth using the app's copy of Assembly and updating output path when we need it
|
||||
// But that requires tracking editor and player assemblies separately
|
||||
var outputPath = type == AssembliesType.Editor
|
||||
? $@"Temp\Bin\Debug\{compilationPipelineAssembly.name}\"
|
||||
: $@"Temp\Bin\Debug\{compilationPipelineAssembly.name}\Player\";
|
||||
assemblies[i] = new Assembly(
|
||||
compilationPipelineAssembly.name,
|
||||
outputPath,
|
||||
compilationPipelineAssembly.sourceFiles,
|
||||
compilationPipelineAssembly.defines,
|
||||
compilationPipelineAssembly.assemblyReferences,
|
||||
compilationPipelineAssembly.compiledAssemblyReferences,
|
||||
compilationPipelineAssembly.flags,
|
||||
compilationPipelineAssembly.compilerOptions
|
||||
#if UNITY_2020_2_OR_NEWER
|
||||
, compilationPipelineAssembly.rootNamespace
|
||||
#endif
|
||||
);
|
||||
i++;
|
||||
}
|
||||
|
||||
return assemblies;
|
||||
}
|
||||
|
||||
public Assembly GetNamedAssembly(string name)
|
||||
{
|
||||
foreach (var assembly in GetAllAssemblies())
|
||||
{
|
||||
if (assembly.name == name)
|
||||
return assembly;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public string GetProjectName(string name, string[] defines)
|
||||
{
|
||||
if (!ProjectGenerationFlag.HasFlag(ProjectGenerationFlag.PlayerAssemblies))
|
||||
return name;
|
||||
return !defines.Contains("UNITY_EDITOR") ? name + ".Player" : name;
|
||||
}
|
||||
|
||||
public IEnumerable<string> GetAllAssetPaths()
|
||||
{
|
||||
return AssetDatabase.GetAllAssetPaths();
|
||||
}
|
||||
|
||||
private static string GetPackageRootDirectoryName(string assetPath)
|
||||
{
|
||||
const string packagesPrefix = "packages/";
|
||||
if (!assetPath.StartsWith(packagesPrefix, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
var followupSeparator = assetPath.IndexOf('/', packagesPrefix.Length);
|
||||
// Note that we return the first path segment without modifying/normalising case!
|
||||
return followupSeparator == -1 ? assetPath : assetPath.Substring(0, followupSeparator);
|
||||
}
|
||||
|
||||
public PackageInfo GetPackageInfoForAssetPath(string assetPath)
|
||||
{
|
||||
var packageName = GetPackageRootDirectoryName(assetPath);
|
||||
if (packageName == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
// Assume the package name casing is consistent. If it's not, we'll fall back to an uppercase variant that's
|
||||
// saved in the same dictionary. This gives us cheaper case sensitive matching, with a fallback if our assumption
|
||||
// is incorrect
|
||||
if (m_PackageInfoCache.TryGetValue(packageName, out var cachedPackageInfo))
|
||||
return cachedPackageInfo;
|
||||
|
||||
var packageNameUpper = packageName.ToUpperInvariant();
|
||||
if (m_PackageInfoCache.TryGetValue(packageNameUpper, out cachedPackageInfo))
|
||||
return cachedPackageInfo;
|
||||
|
||||
var result = PackageInfo.FindForAssetPath(packageName);
|
||||
m_PackageInfoCache[packageName] = result;
|
||||
m_PackageInfoCache[packageNameUpper] = result;
|
||||
return result;
|
||||
}
|
||||
|
||||
public void ResetCaches()
|
||||
{
|
||||
m_PackageInfoCache.Clear();
|
||||
m_ResponseFilesCache.Clear();
|
||||
m_AllEditorAssemblies = null;
|
||||
m_AllPlayerAssemblies = null;
|
||||
}
|
||||
|
||||
public bool IsInternalizedPackagePath(string path)
|
||||
{
|
||||
if (string.IsNullOrEmpty(path))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var packageInfo = GetPackageInfoForAssetPath(path);
|
||||
if (packageInfo == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (ProjectGenerationFlag.HasFlag(ProjectGenerationFlag.PlayerAssemblies) && _specialPackagesForProjectGen.Contains(packageInfo.name))
|
||||
{
|
||||
// special case for RIDER-104519 Rider is reporting errors in scripts that work fine in Unity when utilizing DOTS
|
||||
// it would be better to only generate .Player projects and not Editor ones, but that would require big changes in ProjectGeneration
|
||||
return false;
|
||||
}
|
||||
|
||||
var packageSource = packageInfo.source;
|
||||
switch (packageSource)
|
||||
{
|
||||
case PackageSource.Embedded:
|
||||
return !ProjectGenerationFlag.HasFlag(ProjectGenerationFlag.Embedded);
|
||||
case PackageSource.Registry:
|
||||
return !ProjectGenerationFlag.HasFlag(ProjectGenerationFlag.Registry);
|
||||
case PackageSource.BuiltIn:
|
||||
return !ProjectGenerationFlag.HasFlag(ProjectGenerationFlag.BuiltIn);
|
||||
case PackageSource.Unknown:
|
||||
return !ProjectGenerationFlag.HasFlag(ProjectGenerationFlag.Unknown);
|
||||
case PackageSource.Local:
|
||||
return !ProjectGenerationFlag.HasFlag(ProjectGenerationFlag.Local);
|
||||
case PackageSource.Git:
|
||||
return !ProjectGenerationFlag.HasFlag(ProjectGenerationFlag.Git);
|
||||
#if UNITY_2019_3_OR_NEWER
|
||||
case PackageSource.LocalTarball:
|
||||
return !ProjectGenerationFlag.HasFlag(ProjectGenerationFlag.LocalTarBall);
|
||||
#endif
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public ResponseFileData ParseResponseFile(string responseFilePath, string projectDirectory,
|
||||
ApiCompatibilityLevel apiCompatibilityLevel)
|
||||
{
|
||||
var key = responseFilePath + ":" + (int) apiCompatibilityLevel;
|
||||
if (!m_ResponseFilesCache.TryGetValue(key, out var responseFileData))
|
||||
{
|
||||
var systemReferenceDirectories =
|
||||
CompilationPipeline.GetSystemAssemblyDirectories(apiCompatibilityLevel);
|
||||
responseFileData = CompilationPipeline.ParseResponseFile(
|
||||
responseFilePath,
|
||||
projectDirectory,
|
||||
systemReferenceDirectories
|
||||
);
|
||||
m_ResponseFilesCache.Add(key, responseFileData);
|
||||
}
|
||||
|
||||
return responseFileData;
|
||||
}
|
||||
|
||||
public IEnumerable<string> GetRoslynAnalyzerPaths()
|
||||
{
|
||||
return PluginImporter.GetAllImporters()
|
||||
.Where(i => !i.isNativePlugin && AssetDatabase.GetLabels(i).SingleOrDefault(l => l == "RoslynAnalyzer") != null)
|
||||
.Select(i => i.assetPath);
|
||||
}
|
||||
|
||||
public void ToggleProjectGeneration(ProjectGenerationFlag preference)
|
||||
{
|
||||
if (ProjectGenerationFlag.HasFlag(preference))
|
||||
{
|
||||
ProjectGenerationFlag ^= preference;
|
||||
}
|
||||
else
|
||||
{
|
||||
ProjectGenerationFlag |= preference;
|
||||
}
|
||||
}
|
||||
|
||||
public void ResetProjectGenerationFlag()
|
||||
{
|
||||
ProjectGenerationFlag = ProjectGenerationFlag.None;
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 56c8c6e437b14f8e9a91e9832c11bc1a
|
||||
timeCreated: 1580717719
|
@@ -0,0 +1,51 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Security;
|
||||
using System.Text;
|
||||
using Packages.Rider.Editor.Util;
|
||||
|
||||
namespace Packages.Rider.Editor.ProjectGeneration {
|
||||
class FileIOProvider : IFileIO
|
||||
{
|
||||
public bool Exists(string path)
|
||||
{
|
||||
return File.Exists(path);
|
||||
}
|
||||
|
||||
public TextReader GetReader(string path)
|
||||
{
|
||||
return new StreamReader(path);
|
||||
}
|
||||
|
||||
public string ReadAllText(string path)
|
||||
{
|
||||
return File.ReadAllText(path);
|
||||
}
|
||||
|
||||
public void WriteAllText(string path, string content)
|
||||
{
|
||||
File.WriteAllText(path, content, Encoding.UTF8);
|
||||
LastWriteTracker.UpdateLastWriteIfNeeded(path);
|
||||
}
|
||||
|
||||
public string EscapedRelativePathFor(string file, string rootDirectoryFullPath)
|
||||
{
|
||||
// We have to normalize the path, because the PackageManagerRemapper assumes
|
||||
// dir seperators will be os specific.
|
||||
var absolutePath = Path.GetFullPath(file.NormalizePath());
|
||||
var path = SkipPathPrefix(absolutePath, rootDirectoryFullPath);
|
||||
|
||||
return SecurityElement.Escape(path);
|
||||
}
|
||||
|
||||
private static string SkipPathPrefix(string path, string prefix)
|
||||
{
|
||||
var root = prefix[prefix.Length - 1] == Path.DirectorySeparatorChar
|
||||
? prefix
|
||||
: prefix + Path.DirectorySeparatorChar;
|
||||
return path.StartsWith(root, StringComparison.Ordinal)
|
||||
? path.Substring(root.Length)
|
||||
: path;
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a6ba838b1348d5e46a7eaacd1646c1d3
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,9 @@
|
||||
namespace Packages.Rider.Editor.ProjectGeneration {
|
||||
class GUIDProvider : IGUIDGenerator
|
||||
{
|
||||
public string ProjectGuid(string name)
|
||||
{
|
||||
return SolutionGuidGenerator.GuidForProject(name);
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8cfde1a59fb35574189691a9de1df93b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEditor;
|
||||
using UnityEditor.Compilation;
|
||||
|
||||
namespace Packages.Rider.Editor.ProjectGeneration
|
||||
{
|
||||
internal interface IAssemblyNameProvider
|
||||
{
|
||||
string[] ProjectSupportedExtensions { get; }
|
||||
string ProjectGenerationRootNamespace { get; }
|
||||
ProjectGenerationFlag ProjectGenerationFlag { get; }
|
||||
|
||||
string GetAssemblyNameFromScriptPath(string path);
|
||||
string GetProjectName(string name, string[] defines);
|
||||
bool IsInternalizedPackagePath(string path);
|
||||
Assembly[] GetAllAssemblies();
|
||||
Assembly GetNamedAssembly(string name);
|
||||
IEnumerable<string> GetAllAssetPaths();
|
||||
UnityEditor.PackageManager.PackageInfo GetPackageInfoForAssetPath(string assetPath);
|
||||
ResponseFileData ParseResponseFile(string responseFilePath, string projectDirectory, ApiCompatibilityLevel systemReferenceDirectories);
|
||||
IEnumerable<string> GetRoslynAnalyzerPaths();
|
||||
void ToggleProjectGeneration(ProjectGenerationFlag preference);
|
||||
void ResetCaches();
|
||||
}
|
||||
}
|
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5eea837708474d7e9c1cb4b2eca0213f
|
||||
timeCreated: 1580717710
|
@@ -0,0 +1,17 @@
|
||||
using System.IO;
|
||||
|
||||
namespace Packages.Rider.Editor.ProjectGeneration
|
||||
{
|
||||
internal interface IFileIO
|
||||
{
|
||||
bool Exists(string path);
|
||||
|
||||
TextReader GetReader(string path);
|
||||
string ReadAllText(string path);
|
||||
void WriteAllText(string path, string content);
|
||||
|
||||
// rootDirectoryFullPath is assumed to be the result of Path.GetFullPath
|
||||
// Passing the directory with a trailing slash (Path.DirectorySeparatorChar) will avoid an allocation
|
||||
string EscapedRelativePathFor(string path, string rootDirectoryFullPath);
|
||||
}
|
||||
}
|
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1bdab5b8331b4506bf4eae379235c053
|
||||
timeCreated: 1580717666
|
@@ -0,0 +1,7 @@
|
||||
namespace Packages.Rider.Editor.ProjectGeneration
|
||||
{
|
||||
internal interface IGUIDGenerator
|
||||
{
|
||||
string ProjectGuid(string name);
|
||||
}
|
||||
}
|
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8c7e8e301f8b4c30bbf9db502d637f0f
|
||||
timeCreated: 1580717700
|
@@ -0,0 +1,13 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Packages.Rider.Editor.ProjectGeneration
|
||||
{
|
||||
internal interface IGenerator
|
||||
{
|
||||
bool SyncIfNeeded(IEnumerable<string> affectedFiles, IEnumerable<string> reimportedFiles, bool checkProjectFiles = false);
|
||||
void Sync();
|
||||
bool HasSolutionBeenGenerated();
|
||||
string SolutionFile();
|
||||
IAssemblyNameProvider AssemblyNameProvider { get; }
|
||||
}
|
||||
}
|
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 39cb9ab8a3b2452cbf58ffbea841d203
|
||||
timeCreated: 1580717654
|
@@ -0,0 +1,50 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
namespace Packages.Rider.Editor.ProjectGeneration
|
||||
{
|
||||
internal static class LastWriteTracker
|
||||
{
|
||||
internal static bool HasLastWriteTimeChanged()
|
||||
{
|
||||
if (!IsUnityCompatible()) return false;
|
||||
|
||||
// any external changes of sln/csproj should cause their regeneration
|
||||
// Directory.GetCurrentDirectory(), "*.csproj", "*.sln"
|
||||
var files = new List<FileInfo>();
|
||||
|
||||
var directoryInfo = new DirectoryInfo(Directory.GetCurrentDirectory());
|
||||
files.AddRange(directoryInfo.GetFiles("*.csproj"));
|
||||
files.Add(new FileInfo(Path.Combine(directoryInfo.FullName, directoryInfo.Name + ".sln")));
|
||||
|
||||
return files.Any(a => a.LastWriteTime > RiderScriptEditorPersistedState.instance.LastWrite);
|
||||
}
|
||||
|
||||
internal static void UpdateLastWriteIfNeeded(string path)
|
||||
{
|
||||
if (!IsUnityCompatible()) return;
|
||||
|
||||
var fileInfo = new FileInfo(path);
|
||||
if (fileInfo.Directory == null)
|
||||
return;
|
||||
var directoryInfo = new DirectoryInfo(Directory.GetCurrentDirectory());
|
||||
if (fileInfo.Directory.FullName.Equals(directoryInfo.FullName, StringComparison.OrdinalIgnoreCase) &&
|
||||
(fileInfo.Extension.Equals(".csproj", StringComparison.OrdinalIgnoreCase)
|
||||
|| fileInfo.Name.Equals(directoryInfo.Name + ".sln", StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
RiderScriptEditorPersistedState.instance.LastWrite = fileInfo.LastWriteTime;
|
||||
}
|
||||
}
|
||||
|
||||
internal static bool IsUnityCompatible()
|
||||
{
|
||||
#if UNITY_2020_1_OR_NEWER
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7019e230344c48d4b81602e2e978e5de
|
||||
timeCreated: 1645608955
|
@@ -0,0 +1,41 @@
|
||||
using System.IO;
|
||||
|
||||
#if UNITY_2020_1_OR_NEWER
|
||||
using UnityEditor.PackageManager;
|
||||
#endif
|
||||
|
||||
namespace Packages.Rider.Editor.ProjectGeneration
|
||||
{
|
||||
internal static class PackageManagerTracker
|
||||
{
|
||||
private static bool HasManifestJsonLastWriteTimeChanged()
|
||||
{
|
||||
if (!LastWriteTracker.IsUnityCompatible()) return false;
|
||||
var directoryInfo = new DirectoryInfo(Directory.GetCurrentDirectory());
|
||||
var manifestFile = new FileInfo(Path.Combine(directoryInfo.FullName, "Packages/manifest.json"));
|
||||
if (manifestFile.Exists)
|
||||
{
|
||||
// for the manifest.json, we store the LastWriteTime here
|
||||
var res = manifestFile.LastWriteTime > RiderScriptEditorPersistedState.instance.ManifestJsonLastWrite;
|
||||
if (res) RiderScriptEditorPersistedState.instance.ManifestJsonLastWrite = manifestFile.LastWriteTime;
|
||||
return res;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// If the manifest.json was changed outside Unity and Rider calls Unity to Refresh, we should call PM to Refresh its state also
|
||||
/// </summary>
|
||||
/// <param name="checkProjectFiles"></param>
|
||||
internal static void SyncIfNeeded(bool checkProjectFiles)
|
||||
{
|
||||
#if UNITY_2020_1_OR_NEWER
|
||||
if (checkProjectFiles && HasManifestJsonLastWriteTimeChanged())
|
||||
{
|
||||
Client.Resolve();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 32e50e97779a4753a461190076119a99
|
||||
timeCreated: 1676882821
|
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7078f19173ceac84fb9e29b9f6175201
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user