├── .config └── dotnet-tools.json ├── .editorconfig ├── .gitattributes ├── .github ├── actions │ ├── checkout │ │ └── action.yml │ └── update-upm-packages │ │ ├── action.yml │ │ └── update-upm-packages.ps1 ├── dependabot.yml └── workflows │ ├── activation.yml │ ├── main.yml │ └── update-upm-packages.yml ├── .pre-commit-config.yaml ├── .prettierrc.yaml ├── LICENSE ├── README.md ├── docs └── img │ ├── RootTestProject-generated-by-this-package.png │ ├── RootTestProject-generated-by-unity.png │ ├── attach-to-unity.png │ ├── attach-unity-debuger.png │ └── settings.png ├── src ├── Directory.Build.props ├── GlobalShared.DotSettings ├── TestProjects │ └── RootTestProject │ │ ├── .gitignore │ │ ├── .vsconfig │ │ ├── Assets │ │ ├── Module1.meta │ │ ├── Module1 │ │ │ ├── Module1Script.cs │ │ │ ├── Module1Script.cs.meta │ │ │ ├── RootTestProject.Module1.asmdef │ │ │ └── RootTestProject.Module1.asmdef.meta │ │ ├── Module2.meta │ │ ├── Module2 │ │ │ ├── Module2Script.cs │ │ │ ├── Module2Script.cs.meta │ │ │ ├── RootTestProject.Module2.asmdef │ │ │ └── RootTestProject.Module2.asmdef.meta │ │ ├── RootScript.cs │ │ ├── RootScript.cs.meta │ │ ├── RootTestProject.asmdef │ │ ├── RootTestProject.asmdef.meta │ │ ├── Scenes.meta │ │ └── Scenes │ │ │ ├── SampleScene.unity │ │ │ └── SampleScene.unity.meta │ │ ├── Packages │ │ ├── manifest.json │ │ └── packages-lock.json │ │ └── ProjectSettings │ │ ├── AudioManager.asset │ │ ├── ClusterInputManager.asset │ │ ├── DynamicsManager.asset │ │ ├── EditorBuildSettings.asset │ │ ├── EditorSettings.asset │ │ ├── GraphicsSettings.asset │ │ ├── InputManager.asset │ │ ├── MemorySettings.asset │ │ ├── MultiplayerManager.asset │ │ ├── NavMeshAreas.asset │ │ ├── PackageManagerSettings.asset │ │ ├── Packages │ │ ├── com.github-joc0de.visual-studio-solution-generator │ │ │ └── Settings.json │ │ └── com.unity.testtools.codecoverage │ │ │ └── Settings.json │ │ ├── Physics2DSettings.asset │ │ ├── PresetManager.asset │ │ ├── ProjectSettings.asset │ │ ├── ProjectVersion.txt │ │ ├── QualitySettings.asset │ │ ├── SceneTemplateSettings.json │ │ ├── TagManager.asset │ │ ├── TimeManager.asset │ │ ├── UnityConnectSettings.asset │ │ ├── VFXManager.asset │ │ ├── VersionControlSettings.asset │ │ └── XRSettings.asset ├── UnityVisualStudioSolutionGenerator.Tests │ ├── .gitignore │ ├── .vsconfig │ ├── Assets │ │ ├── Editor.meta │ │ ├── Editor │ │ │ ├── Tests.meta │ │ │ └── Tests │ │ │ │ ├── .editorconfig │ │ │ │ ├── SolutionFileTest.cs │ │ │ │ ├── SolutionFileTest.cs.meta │ │ │ │ ├── SourceCodeFilesHandlerTest.cs │ │ │ │ ├── SourceCodeFilesHandlerTest.cs.meta │ │ │ │ ├── UnityVisualStudioSolutionGenerator.Tests.asmdef │ │ │ │ ├── UnityVisualStudioSolutionGenerator.Tests.asmdef.meta │ │ │ │ ├── UnityVisualStudioSolutionGenerator.Tests.csproj.DotSettings │ │ │ │ └── UnityVisualStudioSolutionGenerator.Tests.csproj.DotSettings.meta │ │ ├── Scenes.meta │ │ └── Scenes │ │ │ ├── SampleScene.unity │ │ │ └── SampleScene.unity.meta │ ├── Packages │ │ ├── manifest.json │ │ └── packages-lock.json │ ├── ProjectSettings │ │ ├── AudioManager.asset │ │ ├── ClusterInputManager.asset │ │ ├── DynamicsManager.asset │ │ ├── EditorBuildSettings.asset │ │ ├── EditorSettings.asset │ │ ├── GraphicsSettings.asset │ │ ├── InputManager.asset │ │ ├── MemorySettings.asset │ │ ├── NavMeshAreas.asset │ │ ├── PackageManagerSettings.asset │ │ ├── Packages │ │ │ ├── com.github-joc0de.visual-studio-solution-generator │ │ │ │ └── Settings.json │ │ │ └── com.unity.testtools.codecoverage │ │ │ │ └── Settings.json │ │ ├── Physics2DSettings.asset │ │ ├── PresetManager.asset │ │ ├── ProjectSettings.asset │ │ ├── ProjectVersion.txt │ │ ├── QualitySettings.asset │ │ ├── SceneTemplateSettings.json │ │ ├── TagManager.asset │ │ ├── TimeManager.asset │ │ ├── UnityConnectSettings.asset │ │ ├── VFXManager.asset │ │ ├── VersionControlSettings.asset │ │ └── XRSettings.asset │ └── UnityVisualStudioSolutionGenerator.Tests.sln.DotSettings └── UnityVisualStudioSolutionGenerator │ ├── .gitignore │ ├── .vsconfig │ ├── Assets │ ├── Editor.meta │ ├── Editor │ │ ├── Configuration.meta │ │ ├── Configuration │ │ │ ├── GeneratorSettings.cs │ │ │ ├── GeneratorSettings.cs.meta │ │ │ ├── GeneratorSettingsManager.cs │ │ │ ├── GeneratorSettingsManager.cs.meta │ │ │ ├── GeneratorSettingsProvider.cs │ │ │ ├── GeneratorSettingsProvider.cs.meta │ │ │ ├── GeneratorSettingsValue.cs │ │ │ ├── GeneratorSettingsValue.cs.meta │ │ │ ├── PropertyGroupSetting.cs │ │ │ ├── PropertyGroupSetting.cs.meta │ │ │ ├── SettingsUiAdditionalIncludedProjectFiles.cs │ │ │ ├── SettingsUiAdditionalIncludedProjectFiles.cs.meta │ │ │ ├── SettingsUiAdditionalIncludedSolutions.cs │ │ │ ├── SettingsUiAdditionalIncludedSolutions.cs.meta │ │ │ ├── SettingsUiExcludedAnalyzers.cs │ │ │ ├── SettingsUiExcludedAnalyzers.cs.meta │ │ │ ├── SettingsUiListHelper.cs │ │ │ ├── SettingsUiListHelper.cs.meta │ │ │ ├── SettingsUiSdkAdditionalProperties.cs │ │ │ ├── SettingsUiSdkAdditionalProperties.cs.meta │ │ │ ├── SettingsUiSdkExcludedFilePatterns.cs │ │ │ ├── SettingsUiSdkExcludedFilePatterns.cs.meta │ │ │ ├── SettingsUiVisualStudioEditorIntegration.cs │ │ │ └── SettingsUiVisualStudioEditorIntegration.cs.meta │ │ ├── LogHelper.cs │ │ ├── LogHelper.cs.meta │ │ ├── MenuItemProvider.cs │ │ ├── MenuItemProvider.cs.meta │ │ ├── ProjectFile.cs │ │ ├── ProjectFile.cs.meta │ │ ├── ProjectFileGeneratorBase.cs │ │ ├── ProjectFileGeneratorBase.cs.meta │ │ ├── ProjectFileGeneratorLegacyStyle.cs │ │ ├── ProjectFileGeneratorLegacyStyle.cs.meta │ │ ├── ProjectFileGeneratorSdkStyle.cs │ │ ├── ProjectFileGeneratorSdkStyle.cs.meta │ │ ├── ProjectFileParser.cs │ │ ├── ProjectFileParser.cs.meta │ │ ├── ProjectSourceCodeWatcherManager.cs │ │ ├── ProjectSourceCodeWatcherManager.cs.meta │ │ ├── ReSharperProjectSettingsGenerator.cs │ │ ├── ReSharperProjectSettingsGenerator.cs.meta │ │ ├── SolutionFile.cs │ │ ├── SolutionFile.cs.meta │ │ ├── SolutionFileParser.cs │ │ ├── SolutionFileParser.cs.meta │ │ ├── SolutionFileWriter.cs │ │ ├── SolutionFileWriter.cs.meta │ │ ├── SourceCodeFileWatcher.cs │ │ ├── SourceCodeFileWatcher.cs.meta │ │ ├── SourceCodeFilesHandler.cs │ │ ├── SourceCodeFilesHandler.cs.meta │ │ ├── UnityVisualStudioSolutionGenerator.asmdef │ │ ├── UnityVisualStudioSolutionGenerator.asmdef.meta │ │ ├── UnityVisualStudioSolutionGenerator.csproj.DotSettings │ │ ├── UnityVisualStudioSolutionGenerator.csproj.DotSettings.meta │ │ ├── VisualStudioAssetPostprocessor.cs │ │ └── VisualStudioAssetPostprocessor.cs.meta │ ├── LICENSE.md │ ├── LICENSE.md.meta │ ├── package.json │ └── package.json.meta │ ├── Packages │ ├── manifest.json │ └── packages-lock.json │ ├── ProjectSettings │ ├── AudioManager.asset │ ├── ClusterInputManager.asset │ ├── DynamicsManager.asset │ ├── EditorBuildSettings.asset │ ├── EditorSettings.asset │ ├── GraphicsSettings.asset │ ├── InputManager.asset │ ├── MemorySettings.asset │ ├── MultiplayerManager.asset │ ├── NavMeshAreas.asset │ ├── PackageManagerSettings.asset │ ├── Packages │ │ ├── com.github-joc0de.visual-studio-solution-generator │ │ │ └── Settings.json │ │ └── com.unity.testtools.codecoverage │ │ │ └── Settings.json │ ├── Physics2DSettings.asset │ ├── PresetManager.asset │ ├── ProjectSettings.asset │ ├── ProjectVersion.txt │ ├── QualitySettings.asset │ ├── ShaderGraphSettings.asset │ ├── TagManager.asset │ ├── TimeManager.asset │ ├── UnityConnectSettings.asset │ ├── VFXManager.asset │ ├── VersionControlSettings.asset │ └── XRSettings.asset │ └── UnityVisualStudioSolutionGenerator.sln.DotSettings └── tools ├── format-all.ps1 ├── format-staged.ps1 ├── remove-byte-order-marker.py ├── resharper-cleanupcode.py └── update-tools.ps1 /.config/dotnet-tools.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "isRoot": true, 4 | "tools": { 5 | "jetbrains.resharper.globaltools": { 6 | "version": "2023.3.3", 7 | "commands": [ 8 | "jb" 9 | ] 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | # Custom for Visual Studio 4 | *.cs diff=csharp 5 | # Standard to msysgit 6 | *.doc diff=astextplain 7 | *.DOC diff=astextplain 8 | *.docx diff=astextplain 9 | *.DOCX diff=astextplain 10 | *.dot diff=astextplain 11 | *.DOT diff=astextplain 12 | *.pdf diff=astextplain 13 | *.PDF diff=astextplain 14 | *.rtf diff=astextplain 15 | *.RTF diff=astextplain 16 | *.png filter=lfs diff=lfs merge=lfs -text 17 | *.jpg filter=lfs diff=lfs merge=lfs -text 18 | *.jpeg filter=lfs diff=lfs merge=lfs -text 19 | -------------------------------------------------------------------------------- /.github/actions/checkout/action.yml: -------------------------------------------------------------------------------- 1 | name: Checkout 2 | description: Checkout the source code. For pull requests it checks out the merged code. 3 | runs: 4 | using: composite 5 | steps: 6 | - name: clear .git from previous checkout 7 | shell: bash 8 | run: rm -r .git 9 | 10 | - name: Checkout normal 11 | uses: actions/checkout@v4 12 | if: github.event_name != 'pull_request_target' 13 | with: 14 | fetch-depth: 0 15 | lfs: true 16 | 17 | - name: Checkout merged PR 18 | uses: actions/checkout@v4 19 | if: github.event_name == 'pull_request_target' 20 | with: 21 | ref: refs/pull/${{ github.event.number }}/merge 22 | fetch-depth: 0 23 | lfs: true 24 | 25 | - name: Get changed files in the .github folder 26 | if: github.event_name == 'pull_request_target' 27 | id: changedWorkflowFiles 28 | uses: tj-actions/changed-files@v46 29 | with: 30 | files: | 31 | .github/** 32 | 33 | - name: Fail if any workflow file is changed 34 | if: | 35 | github.event_name == 'pull_request_target' && 36 | steps.changedWorkflowFiles.outputs.any_changed == 'true' && 37 | github.event.pull_request.user.login != 'JoC0de' && 38 | github.event.pull_request.user.login != 'dependabot[bot]' 39 | shell: bash 40 | run: | 41 | echo "One or more files in the .github folder has changed." 42 | echo "List all the files that have changed: ${{ steps.changedWorkflowFiles.outputs.all_changed_files }}" 43 | exit 1 44 | -------------------------------------------------------------------------------- /.github/actions/update-upm-packages/action.yml: -------------------------------------------------------------------------------- 1 | name: Update UPM packages 2 | description: Check for updates of any UPM package and update it inside the package.json 3 | inputs: 4 | project-root-path: 5 | description: The root path of the Unity project. The folder containing the Assets folder. 6 | required: true 7 | package-json-files-to-update: 8 | required: false 9 | description: A list of 'package.json' files that should be updated so that its dependency version numbers match the one from the updated packages. Each value should be a path to a 'package.json' file relative to 'project-root-path' separated by a new line. 10 | default: "" 11 | github-token: 12 | required: true 13 | description: The GitHub token to use for communication with the GitHub API 14 | runs: 15 | using: composite 16 | steps: 17 | - name: Update used package version numbers 18 | shell: pwsh 19 | run: > 20 | & $env:GITHUB_ACTION_PATH/update-upm-packages.ps1 21 | -ProjectPath '${{ inputs.project-root-path }}' 22 | -PackageJsonFilesToUpdate ('${{ inputs.package-json-files-to-update }}'.Split([string[]]@("`n", "`r`n"), [StringSplitOptions]::RemoveEmptyEntries)) 23 | 24 | - name: Check changes 25 | id: check-changes 26 | shell: pwsh 27 | run: | 28 | git diff 29 | $gitStatus = git status --porcelain 30 | echo "has-changes=$($gitStatus.Length -ne 0)" >> $env:GITHUB_OUTPUT 31 | 32 | - name: Create Issue with update 33 | shell: pwsh 34 | if: | 35 | steps.check-changes.outputs.has-changes == 'True' 36 | run: | 37 | $gitDiff = git diff | Out-String 38 | Set-Content -Path body.txt -Value " 39 | ## Diff containing updates: 40 | ``````diff 41 | $gitDiff 42 | `````` 43 | " 44 | gh issue create --label "dependencies" --title "Update UPM package dependencies" --repo $env:GITHUB_REPOSITORY --body-file body.txt 45 | Remove-Item -Path 'body.txt' 46 | env: 47 | GITHUB_TOKEN: ${{ inputs.github-token }} 48 | -------------------------------------------------------------------------------- /.github/actions/update-upm-packages/update-upm-packages.ps1: -------------------------------------------------------------------------------- 1 | [CmdletBinding()] 2 | param ( 3 | [Parameter(Mandatory = $true, 4 | Position = 0, 5 | ParameterSetName = 'ProjectPath', 6 | ValueFromPipeline = $true, 7 | ValueFromPipelineByPropertyName = $true, 8 | HelpMessage = 'Path to root of the Unity project.')] 9 | [ValidateNotNullOrEmpty()] 10 | [string] 11 | $ProjectPath, 12 | 13 | [Parameter(Mandatory = $true, 14 | HelpMessage = 'List of package.json files that should also be updated with the new version numbers.')] 15 | [string[]] 16 | $PackageJsonFilesToUpdate 17 | ) 18 | 19 | $ErrorActionPreference = 'Stop' 20 | 21 | $ProjectPath = $ProjectPath.Trim() 22 | $PackageJsonFilesToUpdate = $PackageJsonFilesToUpdate | ForEach-Object { $_.Trim() } 23 | $oldLocation = Get-Location 24 | try { 25 | Set-Location $ProjectPath 26 | 27 | if (-not (Test-Path -Path $PackageJsonFilesToUpdate -PathType Leaf)) { 28 | throw "One of the provided package.json files doesn't exists: ['$($PackageJsonFilesToUpdate -join "'; '")']" 29 | } 30 | 31 | $manifestObject = Get-Content -Path 'Packages\manifest.json' -Encoding utf8 | ConvertFrom-Json -Depth 10 32 | $packagesLockObject = Get-Content -Path "Packages\packages-lock.json" -Encoding utf8 | ConvertFrom-Json -Depth 10 33 | $availableUpdates = New-Object Collections.Generic.List[PsObject] 34 | foreach ($dependency in $manifestObject.dependencies.PsObject.Properties) { 35 | $packageName = $dependency.Name 36 | $currentVersion = $dependency.Value 37 | $packageLockData = $packagesLockObject.dependencies.PsObject.Properties[$packageName].Value 38 | if ($packageLockData.source -ne 'registry') { 39 | continue 40 | } 41 | 42 | $repositoryBaseUrl = $packageLockData.url 43 | $packageMetadata = Invoke-WebRequest -Uri "$repositoryBaseUrl/$packageName" | ConvertFrom-Json -Depth 10 44 | $latestVersion = $packageMetadata.'dist-tags'.latest 45 | if ($currentVersion.Contains('-')) { 46 | # current is pre-release -> allow pre-release 47 | $latestVersion = $packageMetadata.'dist-tags'.latest 48 | } 49 | else { 50 | $latestVersion = ($packageMetadata.versions.PsObject.Properties | Where-Object { -not $_.Name.Contains('-') } | 51 | ForEach-Object { [System.Version]::Parse($_.Name) } | Sort-Object -Descending | Select-Object -First 1).ToString() 52 | } 53 | 54 | if ([System.String]::IsNullOrEmpty($latestVersion)) { 55 | throw "Failed to get latest version number for package: '$packageName'. Received the following from the registry: '$repositoryBaseUrl': $packageMetadata" 56 | } 57 | 58 | if ($currentVersion -eq $latestVersion) { 59 | continue 60 | } 61 | 62 | Write-Host "Update available for package '$packageName': $currentVersion -> $latestVersion" 63 | $availableUpdates.Add([PSCustomObject]@{ 64 | Name = $packageName 65 | NewVersion = $latestVersion 66 | }) 67 | $dependency.Value = $latestVersion 68 | } 69 | 70 | if ($availableUpdates.Count -eq 0) { 71 | return 72 | } 73 | 74 | Write-Host "Update Packages/manifest.json of Unity project at: '$ProjectPath'" 75 | ConvertTo-Json -InputObject $manifestObject -Depth 10 | Set-Content -Path 'Packages\manifest.json' -Encoding utf8 76 | 77 | foreach ($packageJsonFile in $PackageJsonFilesToUpdate) { 78 | $packageJsonContent = Get-Content -Path $packageJsonFile -Encoding utf8 79 | $packageObject = $packageJsonContent | ConvertFrom-Json 80 | $changed = $false 81 | foreach ($update in $availableUpdates) { 82 | $dependency = $packageObject.dependencies.PsObject.Properties[$update.Name] 83 | if ($dependency) { 84 | $dependency.Value = $update.NewVersion 85 | $changed = $true 86 | } 87 | } 88 | 89 | if (-not $changed) { 90 | continue 91 | } 92 | 93 | Write-Host "Update $packageJsonFile of Unity project at: '$ProjectPath'" 94 | $inputIndent = try { $packageJsonContent[1].Substring(0, $packageJsonContent[1].Length - $packageJsonContent[1].TrimStart().Length) } catch { ' ' } 95 | 96 | # ConvertTo-Json produced a single string with 'double space' as indent, we split the lines and replace the indent with the input indent 97 | $outputJsonContent = (ConvertTo-Json -InputObject $packageObject).Split([System.Environment]::NewLine) 98 | $outputJsonContent = $outputJsonContent -replace '(^|\G) ', $inputIndent 99 | $outputJsonContent | Set-Content -Path $packageJsonFile -Encoding utf8 100 | } 101 | } 102 | finally { 103 | Set-Location $oldLocation 104 | } 105 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | # Check for updates to GitHub Actions every week 4 | - package-ecosystem: "github-actions" 5 | directory: "/" 6 | schedule: 7 | interval: "weekly" 8 | -------------------------------------------------------------------------------- /.github/workflows/activation.yml: -------------------------------------------------------------------------------- 1 | name: Acquire Unity activation file 2 | on: 3 | workflow_dispatch: {} 4 | jobs: 5 | activation: 6 | name: Request manual activation file 🔑 7 | runs-on: ubuntu-latest 8 | steps: 9 | # Request manual activation file 10 | - name: Request manual activation file 11 | id: getManualLicenseFile 12 | uses: game-ci/unity-request-activation-file@v2 13 | # Upload artifact (Unity_v20XX.X.XXXX.alf) 14 | - name: Expose as artifact 15 | uses: actions/upload-artifact@v4 16 | with: 17 | name: ${{ steps.getManualLicenseFile.outputs.filePath }} 18 | path: ${{ steps.getManualLicenseFile.outputs.filePath }} 19 | -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: Build and Test 2 | 3 | on: 4 | push: 5 | branches: 6 | - "main" 7 | - "dependabot/github_actions/**" 8 | tags: ["v*"] 9 | pull_request_target: 10 | branches: ["main"] 11 | 12 | permissions: 13 | actions: read 14 | checks: write 15 | contents: read 16 | statuses: write 17 | 18 | jobs: 19 | testOnLinux: 20 | name: Test on Linux 21 | runs-on: ubuntu-latest 22 | if: | 23 | github.event_name != 'pull_request_target' || 24 | !startsWith(github.head_ref, 'dependabot/github_actions/') 25 | steps: 26 | - name: Checkout only action file 27 | uses: actions/checkout@v4 28 | with: 29 | sparse-checkout: | 30 | .github/actions/checkout/action.yml 31 | fetch-depth: 1 32 | 33 | - name: Checkout 34 | uses: ./.github/actions/checkout 35 | 36 | - name: Unity - Run tests 37 | uses: game-ci/unity-test-runner@v4.1.1 38 | env: 39 | UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} 40 | UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} 41 | UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} 42 | with: 43 | projectPath: src/UnityVisualStudioSolutionGenerator.Tests 44 | githubToken: ${{ secrets.GITHUB_TOKEN }} 45 | testMode: EditMode 46 | -------------------------------------------------------------------------------- /.github/workflows/update-upm-packages.yml: -------------------------------------------------------------------------------- 1 | name: Update UPM packages 2 | 3 | on: 4 | workflow_dispatch: {} 5 | schedule: 6 | - cron: "29 6 * * 0" # each Sunday at 06:29 7 | 8 | permissions: 9 | actions: read 10 | contents: read 11 | issues: write 12 | 13 | jobs: 14 | update-upm-packages: 15 | name: Update UPM packages 16 | runs-on: ubuntu-latest 17 | steps: 18 | - name: Checkout 19 | uses: actions/checkout@v4 20 | 21 | - name: Update UPM packages files 22 | uses: ./.github/actions/update-upm-packages 23 | with: 24 | project-root-path: src/UnityVisualStudioSolutionGenerator 25 | package-json-files-to-update: | 26 | Assets/package.json 27 | github-token: ${{ secrets.GITHUB_TOKEN }} 28 | -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | # See https://pre-commit.com for more information 2 | # See https://pre-commit.com/hooks.html for more hooks 3 | exclude: "^.git$|/ProjectSettings/Packages/" 4 | repos: 5 | - repo: https://github.com/JoC0de/pre-commit-prettier 6 | rev: v3.5.3 7 | hooks: 8 | - id: prettier 9 | additional_dependencies: 10 | - prettier@3.5.3 11 | - "@prettier/plugin-xml@3.4.1" 12 | - "prettier-plugin-ini@1.3.0" 13 | args: 14 | - --plugin=prettier-plugin-ini 15 | files: Directory\.Build\.props$|(\.(json|xml|html|config|csproj|DotSettings|yaml|yml|js|md|xrml|xaml|css|editorconfig)$) 16 | - repo: local 17 | hooks: 18 | - id: remove-byte-order-marker 19 | name: Remove UTF8-bom 20 | entry: python ./tools/remove-byte-order-marker.py 21 | language: system 22 | files: \.(cs|yaml|yml|json)$ 23 | pass_filenames: true 24 | - id: resharper-cleanupcode-all 25 | name: ReSharper Code Cleanup (all files) 26 | entry: python ./tools/resharper-cleanupcode.py 27 | language: system 28 | pass_filenames: false 29 | require_serial: true 30 | stages: [manual] 31 | - id: resharper-cleanupcode-changed 32 | name: ReSharper Code Cleanup (only changed) 33 | entry: python ./tools/resharper-cleanupcode.py 34 | language: system 35 | files: \.cs$ 36 | pass_filenames: true 37 | require_serial: true 38 | stages: [pre-commit, pre-merge-commit] 39 | - repo: https://github.com/pre-commit/pre-commit-hooks 40 | rev: v5.0.0 41 | hooks: 42 | - id: trailing-whitespace 43 | exclude: \.(pdf|meta|prefab|shader|controller|asset|cginc|mat|unity|anim|shadergraph)$ 44 | - id: end-of-file-fixer 45 | exclude: \.(asmdef|pdf|meta|prefab|shader|controller|asset|cginc|mat|unity|anim|shadergraph)$ 46 | - id: check-merge-conflict 47 | -------------------------------------------------------------------------------- /.prettierrc.yaml: -------------------------------------------------------------------------------- 1 | # see https://prettier.io/docs/en/options.html 2 | 3 | # Specify the line length that the printer will wrap on. 4 | printWidth: 150 5 | 6 | # Specify the number of spaces per indentation-level. 7 | tabWidth: 4 8 | 9 | endOfLine: "crlf" 10 | 11 | # Whitespaces are considered insensitive. 12 | htmlWhitespaceSensitivity: "ignore" 13 | xmlWhitespaceSensitivity: "ignore" 14 | 15 | # Overrides for some file types 16 | overrides: 17 | # .config files are xml style e.g. package.config 18 | - files: "*.config" 19 | options: 20 | parser: "xml" 21 | 22 | # comply with the same formatting used by NuGetForUnity 23 | - files: 24 | - "packages.config" 25 | - "NuGet.config" 26 | options: 27 | tabWidth: 2 28 | 29 | - files: 30 | - "*.csproj" 31 | - "Directory.Build.props" 32 | options: 33 | parser: "xml" 34 | 35 | - files: "*.xlf" 36 | options: 37 | parser: "xml" 38 | 39 | - files: "*.DotSettings" 40 | options: 41 | parser: "xml" 42 | printWidth: 30000 43 | 44 | - files: "*.inputactions" 45 | options: 46 | parser: "json" 47 | 48 | - files: 49 | - "*.yml" 50 | - "*.yaml" 51 | - "*.meta" 52 | options: 53 | parser: "yaml" 54 | tabWidth: 2 55 | 56 | - files: 57 | - manifest.json 58 | - packages-lock.json 59 | options: 60 | parser: "json" 61 | tabWidth: 2 62 | 63 | - files: ".editorconfig" 64 | options: 65 | parser: "ini" 66 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 JoC0de 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![openupm](https://img.shields.io/npm/v/com.github-joc0de.visual-studio-solution-generator?label=openupm®istry_uri=https://package.openupm.com)](https://openupm.com/packages/com.github-joc0de.visual-studio-solution-generator/) ![main github action workflow](https://github.com/JoC0de/UnityVisualStudioSolutionGenerator/actions/workflows/main.yml/badge.svg) [![MIT license](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE) [![GitHub Release](https://img.shields.io/github/v/release/JoC0de/UnityVisualStudioSolutionGenerator.svg)](https://github.com/JoC0de/UnityVisualStudioSolutionGenerator/releases/latest) 2 | 3 | # Unity Visual Studio Solution Generator 4 | 5 | Visual Studio Solution Generator for Unity to improve developer productivity when working with multi-package unity projects. 6 | This package intercepts the Visual Studio Solution generation done by Unity's [Visual Studio C# integration](https://docs.unity3d.com/Manual/VisualStudioIntegration.html). It preforms the following changes to the solution / project files: 7 | 8 | ## Reduced project hierarchy 9 | 10 | Placing projects next to code so the file hierarchy inside Visual Studio Solution Explorer is cleaner. 11 | 12 | | Solution generated by Unity | Solution generated by this package | 13 | | :-------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------: | 14 | | ![Solution Explorer with Assets root folder](docs/img/RootTestProject-generated-by-unity.png) | ![Solution Explorer with only required folders](docs/img/RootTestProject-generated-by-this-package.png) | 15 | 16 | ## Allow renaming files from local package dependencies 17 | 18 | In the normal Solution generated by Unity projects of local package dependencies are referenced as a `Link`. This has the side effect that you can't rename the file using Visual Studio. The Visual Studio Solution generated by this package creates the project file (the `.csproj`) inside the folder containing the local package therefore the `.cs` files are imported as normal files -> they can be renamed. 19 | 20 | ## Allow generating project file in the new SDK-Style 21 | 22 | Currently the C# project files (`.csproj`) generated by the Unity Visual Studio integration are using the legacy (non-SDK-style) project format normally used by .NET Framework. We provide a option to generate SDK-style project files. 23 | 24 | Advantages of using SDK-style projects: 25 | 26 | - More default enabled [code analyzers](https://learn.microsoft.com/en-us/visualstudio/code-quality/roslyn-analyzers-overview) 27 | - Better tooling support so e.g. it provides the ability to add additional [code analyzers](https://learn.microsoft.com/en-us/visualstudio/code-quality/roslyn-analyzers-overview) as NuGet package e.g. [StyleCop](https://www.nuget.org/packages/StyleCop.Analyzers/) or [Sonar Analyzer](https://www.nuget.org/packages/SonarAnalyzer.CSharp/). Just create a `Directory.Build.props` in any parent directory of your Unity project (the settings apply to all .csproj files below it) and add the NuGet packages as `PackageReference` items for example see [src/Directory.Build.props](src/Directory.Build.props) and [Microsoft documentation](https://learn.microsoft.com/en-us/visualstudio/msbuild/customize-by-directory). 28 | 29 | > **Note:** All changes related to the generated `.csproj` files or settings changes using `Directory.Build.props` only work inside Visual Studio, Unity build doesn't recognize them. So e.g. analyzer warnings of analyzers configured inside `Directory.Build.props` are only visible inside Visual Studio, not inside Unity build logs. 30 | 31 | Disadvantages of using SDK-style projects: 32 | 33 | - The Visual Studio Unity Plugin doesn't detect the projects as Unity Projects this leads to some changes in the behavior of Visual Studio so e.g. to start debugging instead of `Attach to Unity` you need to use `Debug -> Attach Unity Debugger`
34 | ![Attach to Unity menu item](docs/img/attach-to-unity.png) ![Debug -> Attach Unity Debugger menu item](docs/img/attach-unity-debuger.png). 35 | 36 | ## Settings 37 | 38 | This package tries to be customizable to match individual requirements. So it has many configuration options, they can changed using the Preferences UI that can be opened directly using the custom menu item `Visual Studio` -> `Preferences` or using `Edit` -> `Project Settings` -> `Visual Studio Solution Generator`. All settings are stored per project inside the file: `ProjectSettings/Packages/com.github-joc0de.visual-studio-solution-generator/Settings.json`. ![Screenshot of available settings](docs/img/settings.png) 39 | -------------------------------------------------------------------------------- /docs/img/RootTestProject-generated-by-this-package.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:4b21e8546f99a1cf3e28132c0fc6e233b4ce6690fb8afdb580f47b0370b7e985 3 | size 19423 4 | -------------------------------------------------------------------------------- /docs/img/RootTestProject-generated-by-unity.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:5e8e2c641b12959c4326e5f2d6b4ffbd6f69de6b4bdc23f701d363dac2b7740f 3 | size 36807 4 | -------------------------------------------------------------------------------- /docs/img/attach-to-unity.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:82d99c263b19ebe2b7ad5d61ae7330e200d18a5898bc721712da6302d363ca1a 3 | size 7051 4 | -------------------------------------------------------------------------------- /docs/img/attach-unity-debuger.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:2cc7052735a3ae7887c2b21428cf10b3272929029b7c26aaed49e459e4416ba7 3 | size 8287 4 | -------------------------------------------------------------------------------- /docs/img/settings.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:9d045084c99091f40030ddfc21c456945d0e0e222d6a0c249aff1248a5a296bf 3 | size 86948 4 | -------------------------------------------------------------------------------- /src/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | true 4 | 5 | 6 | 7 | 8 | all 9 | runtime; build; native; contentfiles; analyzers; buildtransitive 10 | 11 | 12 | all 13 | runtime; build; native; contentfiles; analyzers 14 | 15 | 16 | all 17 | runtime; build; native; contentfiles; analyzers 18 | 19 | 20 | all 21 | runtime; build; native; contentfiles; analyzers 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/TestProjects/RootTestProject/.gitignore: -------------------------------------------------------------------------------- 1 | # This .gitignore file should be placed at the root of your Unity project directory 2 | # 3 | # Get latest from https://github.com/github/gitignore/blob/master/Unity.gitignore 4 | # 5 | /[Ll]ibrary/ 6 | /[Tt]emp/ 7 | /[Oo]bj/ 8 | /[Bb]uild/ 9 | /[Bb]uilds/ 10 | /[Ll]ogs/ 11 | /[Uu]ser[Ss]ettings/ 12 | 13 | # MemoryCaptures can get excessive in size. 14 | # They also could contain extremely sensitive data 15 | /[Mm]emoryCaptures/ 16 | 17 | # Asset meta data should only be ignored when the corresponding asset is also ignored 18 | !/[Aa]ssets/**/*.meta 19 | 20 | # Uncomment this line if you wish to ignore the asset store tools plugin 21 | # /[Aa]ssets/AssetStoreTools* 22 | 23 | # Autogenerated Jetbrains Rider plugin 24 | /[Aa]ssets/Plugins/Editor/JetBrains* 25 | 26 | # Visual Studio cache directory 27 | .vs/ 28 | 29 | # Gradle cache directory 30 | .gradle/ 31 | 32 | # Autogenerated VS/MD/Consulo solution and project files 33 | ExportedObj/ 34 | .consulo/ 35 | *.csproj 36 | *.csproj.meta 37 | *.unityproj 38 | *.sln 39 | *.sln.meta 40 | *.suo 41 | *.tmp 42 | *.user 43 | *.user.meta 44 | *.userprefs 45 | *.pidb 46 | *.booproj 47 | *.svd 48 | *.pdb 49 | *.mdb 50 | *.opendb 51 | *.VC.db 52 | 53 | # Unity3D generated meta files 54 | *.pidb.meta 55 | *.pdb.meta 56 | *.mdb.meta 57 | 58 | # Unity3D generated file on crash reports 59 | sysinfo.txt 60 | 61 | # Builds 62 | *.apk 63 | *.aab 64 | *.unitypackage 65 | 66 | # Crashlytics generated file 67 | crashlytics-build.properties 68 | 69 | # Packed Addressables 70 | /[Aa]ssets/[Aa]ddressable[Aa]ssets[Dd]ata/*/*.bin* 71 | 72 | # Temporary auto-generated Android Assets 73 | /[Aa]ssets/[Ss]treamingAssets/aa.meta 74 | /[Aa]ssets/[Ss]treamingAssets/aa/* 75 | 76 | 77 | # NugetForUnity Packages folder 78 | /[Aa]ssets/[Pp]ackages.meta 79 | /[Aa]ssets/[Pp]ackages/ 80 | -------------------------------------------------------------------------------- /src/TestProjects/RootTestProject/.vsconfig: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0", 3 | "components": [ 4 | "Microsoft.VisualStudio.Workload.ManagedGame" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /src/TestProjects/RootTestProject/Assets/Module1.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 417e24d51267e6e489256b793afe5b51 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /src/TestProjects/RootTestProject/Assets/Module1/Module1Script.cs: -------------------------------------------------------------------------------- 1 | namespace RootTestProject.Module1 2 | { 3 | public static class Module1Script 4 | { 5 | public static string GetName() 6 | { 7 | return typeof(Module1Script).ToString(); 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/TestProjects/RootTestProject/Assets/Module1/Module1Script.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ce0ceaaaa6b3dc143a34798713bf0f6b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/TestProjects/RootTestProject/Assets/Module1/RootTestProject.Module1.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "RootTestProject.Module1", 3 | "rootNamespace": "RootTestProject.Module1", 4 | "references": [], 5 | "includePlatforms": [], 6 | "excludePlatforms": [], 7 | "allowUnsafeCode": false, 8 | "overrideReferences": false, 9 | "precompiledReferences": [], 10 | "autoReferenced": true, 11 | "defineConstraints": [], 12 | "versionDefines": [], 13 | "noEngineReferences": false 14 | } -------------------------------------------------------------------------------- /src/TestProjects/RootTestProject/Assets/Module1/RootTestProject.Module1.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2d3db89ad17b3d34fa3ff0e8becc31c4 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /src/TestProjects/RootTestProject/Assets/Module2.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ed2a4859bf454404da3ad7df597525fb 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /src/TestProjects/RootTestProject/Assets/Module2/Module2Script.cs: -------------------------------------------------------------------------------- 1 | namespace RootTestProject.Module2 2 | { 3 | public static class Module2Script 4 | { 5 | public static string GetName() 6 | { 7 | return typeof(Module2Script).ToString(); 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/TestProjects/RootTestProject/Assets/Module2/Module2Script.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c1f4497072bd80b4ba15b7bff10f64e9 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/TestProjects/RootTestProject/Assets/Module2/RootTestProject.Module2.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "RootTestProject.Module2", 3 | "rootNamespace": "RootTestProject.Module2", 4 | "references": [], 5 | "includePlatforms": [], 6 | "excludePlatforms": [], 7 | "allowUnsafeCode": false, 8 | "overrideReferences": false, 9 | "precompiledReferences": [], 10 | "autoReferenced": true, 11 | "defineConstraints": [], 12 | "versionDefines": [], 13 | "noEngineReferences": false 14 | } 15 | -------------------------------------------------------------------------------- /src/TestProjects/RootTestProject/Assets/Module2/RootTestProject.Module2.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e255c11adb66d164692f1cc957741ee3 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /src/TestProjects/RootTestProject/Assets/RootScript.cs: -------------------------------------------------------------------------------- 1 | using RootTestProject.Module1; 2 | using RootTestProject.Module2; 3 | using UnityEngine; 4 | 5 | public class RootScript : MonoBehaviour 6 | { 7 | private void OnEnable() 8 | { 9 | var cube1 = GameObject.CreatePrimitive(PrimitiveType.Cube); 10 | cube1.name = Module1Script.GetName(); 11 | cube1.transform.parent = transform; 12 | cube1.transform.position = Vector3.left; 13 | var cube2 = GameObject.CreatePrimitive(PrimitiveType.Cube); 14 | cube2.name = Module2Script.GetName(); 15 | cube2.transform.parent = transform; 16 | cube2.transform.position = Vector3.right; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/TestProjects/RootTestProject/Assets/RootScript.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d36c528e2c3e24142931d5e435b647c7 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/TestProjects/RootTestProject/Assets/RootTestProject.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "RootTestProject", 3 | "rootNamespace": "RootTestProject", 4 | "references": [ 5 | "GUID:2d3db89ad17b3d34fa3ff0e8becc31c4", 6 | "GUID:e255c11adb66d164692f1cc957741ee3" 7 | ], 8 | "includePlatforms": [], 9 | "excludePlatforms": [], 10 | "allowUnsafeCode": false, 11 | "overrideReferences": false, 12 | "precompiledReferences": [], 13 | "autoReferenced": true, 14 | "defineConstraints": [], 15 | "versionDefines": [], 16 | "noEngineReferences": false 17 | } -------------------------------------------------------------------------------- /src/TestProjects/RootTestProject/Assets/RootTestProject.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5b224ee3f56b07e43b5cdf25196e8d4c 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /src/TestProjects/RootTestProject/Assets/Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2028e05ea77f29045ba65cc7e6d831fa 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /src/TestProjects/RootTestProject/Assets/Scenes/SampleScene.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9fc0d4010bbf28b4594072e72b8655ab 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /src/TestProjects/RootTestProject/Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.github-joc0de.visual-studio-solution-generator": "file:../../../UnityVisualStudioSolutionGenerator/Assets", 4 | "com.unity.modules.accessibility": "1.0.0" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/TestProjects/RootTestProject/Packages/packages-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.github-joc0de.visual-studio-solution-generator": { 4 | "version": "file:../../../UnityVisualStudioSolutionGenerator/Assets", 5 | "depth": 0, 6 | "source": "local", 7 | "dependencies": { 8 | "com.unity.ide.visualstudio": "2.0.22", 9 | "com.unity.settings-manager": "2.0.1" 10 | } 11 | }, 12 | "com.unity.ext.nunit": { 13 | "version": "2.0.5", 14 | "depth": 3, 15 | "source": "registry", 16 | "dependencies": {}, 17 | "url": "https://packages.unity.com" 18 | }, 19 | "com.unity.ide.visualstudio": { 20 | "version": "2.0.22", 21 | "depth": 1, 22 | "source": "registry", 23 | "dependencies": { 24 | "com.unity.test-framework": "1.1.9" 25 | }, 26 | "url": "https://packages.unity.com" 27 | }, 28 | "com.unity.settings-manager": { 29 | "version": "2.0.1", 30 | "depth": 1, 31 | "source": "registry", 32 | "dependencies": {}, 33 | "url": "https://packages.unity.com" 34 | }, 35 | "com.unity.test-framework": { 36 | "version": "1.3.9", 37 | "depth": 2, 38 | "source": "registry", 39 | "dependencies": { 40 | "com.unity.ext.nunit": "2.0.3", 41 | "com.unity.modules.imgui": "1.0.0", 42 | "com.unity.modules.jsonserialize": "1.0.0" 43 | }, 44 | "url": "https://packages.unity.com" 45 | }, 46 | "com.unity.modules.accessibility": { 47 | "version": "1.0.0", 48 | "depth": 0, 49 | "source": "builtin", 50 | "dependencies": {} 51 | }, 52 | "com.unity.modules.imgui": { 53 | "version": "1.0.0", 54 | "depth": 3, 55 | "source": "builtin", 56 | "dependencies": {} 57 | }, 58 | "com.unity.modules.jsonserialize": { 59 | "version": "1.0.0", 60 | "depth": 3, 61 | "source": "builtin", 62 | "dependencies": {} 63 | } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /src/TestProjects/RootTestProject/ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!11 &1 4 | AudioManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Volume: 1 8 | Rolloff Scale: 1 9 | Doppler Factor: 1 10 | Default Speaker Mode: 2 11 | m_SampleRate: 0 12 | m_DSPBufferSize: 1024 13 | m_VirtualVoiceCount: 512 14 | m_RealVoiceCount: 32 15 | m_SpatializerPlugin: 16 | m_AmbisonicDecoderPlugin: 17 | m_DisableAudio: 0 18 | m_VirtualizeEffects: 1 19 | m_RequestedDSPBufferSize: 1024 20 | -------------------------------------------------------------------------------- /src/TestProjects/RootTestProject/ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!236 &1 4 | ClusterInputManager: 5 | m_ObjectHideFlags: 0 6 | m_Inputs: [] 7 | -------------------------------------------------------------------------------- /src/TestProjects/RootTestProject/ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!55 &1 4 | PhysicsManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 11 7 | m_Gravity: {x: 0, y: -9.81, z: 0} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_BounceThreshold: 2 10 | m_SleepThreshold: 0.005 11 | m_DefaultContactOffset: 0.01 12 | m_DefaultSolverIterations: 6 13 | m_DefaultSolverVelocityIterations: 1 14 | m_QueriesHitBackfaces: 0 15 | m_QueriesHitTriggers: 1 16 | m_EnableAdaptiveForce: 0 17 | m_ClothInterCollisionDistance: 0 18 | m_ClothInterCollisionStiffness: 0 19 | m_ContactsGeneration: 1 20 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 21 | m_AutoSimulation: 1 22 | m_AutoSyncTransforms: 0 23 | m_ReuseCollisionCallbacks: 1 24 | m_ClothInterCollisionSettingsToggle: 0 25 | m_ContactPairsMode: 0 26 | m_BroadphaseType: 0 27 | m_WorldBounds: 28 | m_Center: {x: 0, y: 0, z: 0} 29 | m_Extent: {x: 250, y: 250, z: 250} 30 | m_WorldSubdivisions: 8 31 | m_FrictionType: 0 32 | m_EnableEnhancedDeterminism: 0 33 | m_EnableUnifiedHeightmaps: 1 34 | m_DefaultMaxAngluarSpeed: 7 35 | -------------------------------------------------------------------------------- /src/TestProjects/RootTestProject/ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1045 &1 4 | EditorBuildSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Scenes: [] 8 | m_configObjects: {} 9 | -------------------------------------------------------------------------------- /src/TestProjects/RootTestProject/ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!159 &1 4 | EditorSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 11 7 | m_ExternalVersionControlSupport: Visible Meta Files 8 | m_SerializationMode: 2 9 | m_LineEndingsForNewScripts: 0 10 | m_DefaultBehaviorMode: 0 11 | m_PrefabRegularEnvironment: {fileID: 0} 12 | m_PrefabUIEnvironment: {fileID: 0} 13 | m_SpritePackerMode: 0 14 | m_SpritePackerPaddingPower: 1 15 | m_EtcTextureCompressorBehavior: 1 16 | m_EtcTextureFastCompressor: 1 17 | m_EtcTextureNormalCompressor: 2 18 | m_EtcTextureBestCompressor: 4 19 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;rsp;asmref 20 | m_ProjectGenerationRootNamespace: 21 | m_CollabEditorSettings: 22 | inProgressEnabled: 1 23 | m_EnableTextureStreamingInEditMode: 1 24 | m_EnableTextureStreamingInPlayMode: 1 25 | m_AsyncShaderCompilation: 1 26 | m_EnterPlayModeOptionsEnabled: 0 27 | m_EnterPlayModeOptions: 3 28 | m_ShowLightmapResolutionOverlay: 1 29 | m_UseLegacyProbeSampleCount: 0 30 | m_SerializeInlineMappingsOnOneLine: 1 31 | -------------------------------------------------------------------------------- /src/TestProjects/RootTestProject/ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!30 &1 4 | GraphicsSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 13 7 | m_Deferred: 8 | m_Mode: 1 9 | m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} 10 | m_DeferredReflections: 11 | m_Mode: 1 12 | m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} 13 | m_ScreenSpaceShadows: 14 | m_Mode: 1 15 | m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} 16 | m_LegacyDeferred: 17 | m_Mode: 1 18 | m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} 19 | m_DepthNormals: 20 | m_Mode: 1 21 | m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} 22 | m_MotionVectors: 23 | m_Mode: 1 24 | m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} 25 | m_LightHalo: 26 | m_Mode: 1 27 | m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} 28 | m_LensFlare: 29 | m_Mode: 1 30 | m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} 31 | m_AlwaysIncludedShaders: 32 | - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 33 | - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} 34 | - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} 35 | - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} 36 | - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} 37 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 38 | m_PreloadedShaders: [] 39 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, 40 | type: 0} 41 | m_CustomRenderPipeline: {fileID: 0} 42 | m_TransparencySortMode: 0 43 | m_TransparencySortAxis: {x: 0, y: 0, z: 1} 44 | m_DefaultRenderingPath: 1 45 | m_DefaultMobileRenderingPath: 1 46 | m_TierSettings: [] 47 | m_LightmapStripping: 0 48 | m_FogStripping: 0 49 | m_InstancingStripping: 0 50 | m_LightmapKeepPlain: 1 51 | m_LightmapKeepDirCombined: 1 52 | m_LightmapKeepDynamicPlain: 1 53 | m_LightmapKeepDynamicDirCombined: 1 54 | m_LightmapKeepShadowMask: 1 55 | m_LightmapKeepSubtractive: 1 56 | m_FogKeepLinear: 1 57 | m_FogKeepExp: 1 58 | m_FogKeepExp2: 1 59 | m_AlbedoSwatchInfos: [] 60 | m_LightsUseLinearIntensity: 0 61 | m_LightsUseColorTemperature: 0 62 | m_LogWhenShaderIsCompiled: 0 63 | m_AllowEnlightenSupportForUpgradedProject: 0 64 | -------------------------------------------------------------------------------- /src/TestProjects/RootTestProject/ProjectSettings/MemorySettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!387306366 &1 4 | MemorySettings: 5 | m_ObjectHideFlags: 0 6 | m_EditorMemorySettings: 7 | m_MainAllocatorBlockSize: -1 8 | m_ThreadAllocatorBlockSize: -1 9 | m_MainGfxBlockSize: -1 10 | m_ThreadGfxBlockSize: -1 11 | m_CacheBlockSize: -1 12 | m_TypetreeBlockSize: -1 13 | m_ProfilerBlockSize: -1 14 | m_ProfilerEditorBlockSize: -1 15 | m_BucketAllocatorGranularity: -1 16 | m_BucketAllocatorBucketsCount: -1 17 | m_BucketAllocatorBlockSize: -1 18 | m_BucketAllocatorBlockCount: -1 19 | m_ProfilerBucketAllocatorGranularity: -1 20 | m_ProfilerBucketAllocatorBucketsCount: -1 21 | m_ProfilerBucketAllocatorBlockSize: -1 22 | m_ProfilerBucketAllocatorBlockCount: -1 23 | m_TempAllocatorSizeMain: -1 24 | m_JobTempAllocatorBlockSize: -1 25 | m_BackgroundJobTempAllocatorBlockSize: -1 26 | m_JobTempAllocatorReducedBlockSize: -1 27 | m_TempAllocatorSizeGIBakingWorker: -1 28 | m_TempAllocatorSizeNavMeshWorker: -1 29 | m_TempAllocatorSizeAudioWorker: -1 30 | m_TempAllocatorSizeCloudWorker: -1 31 | m_TempAllocatorSizeGfx: -1 32 | m_TempAllocatorSizeJobWorker: -1 33 | m_TempAllocatorSizeBackgroundWorker: -1 34 | m_TempAllocatorSizePreloadManager: -1 35 | m_PlatformMemorySettings: {} 36 | -------------------------------------------------------------------------------- /src/TestProjects/RootTestProject/ProjectSettings/MultiplayerManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!655991488 &1 4 | MultiplayerManager: 5 | m_ObjectHideFlags: 0 6 | m_EnableMultiplayerRoles: 0 7 | m_ActiveMultiplayerRole: 0 8 | -------------------------------------------------------------------------------- /src/TestProjects/RootTestProject/ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!126 &1 4 | NavMeshProjectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | areas: 8 | - name: Walkable 9 | cost: 1 10 | - name: Not Walkable 11 | cost: 1 12 | - name: Jump 13 | cost: 2 14 | - name: 15 | cost: 1 16 | - name: 17 | cost: 1 18 | - name: 19 | cost: 1 20 | - name: 21 | cost: 1 22 | - name: 23 | cost: 1 24 | - name: 25 | cost: 1 26 | - name: 27 | cost: 1 28 | - name: 29 | cost: 1 30 | - name: 31 | cost: 1 32 | - name: 33 | cost: 1 34 | - name: 35 | cost: 1 36 | - name: 37 | cost: 1 38 | - name: 39 | cost: 1 40 | - name: 41 | cost: 1 42 | - name: 43 | cost: 1 44 | - name: 45 | cost: 1 46 | - name: 47 | cost: 1 48 | - name: 49 | cost: 1 50 | - name: 51 | cost: 1 52 | - name: 53 | cost: 1 54 | - name: 55 | cost: 1 56 | - name: 57 | cost: 1 58 | - name: 59 | cost: 1 60 | - name: 61 | cost: 1 62 | - name: 63 | cost: 1 64 | - name: 65 | cost: 1 66 | - name: 67 | cost: 1 68 | - name: 69 | cost: 1 70 | - name: 71 | cost: 1 72 | m_LastAgentTypeID: -887442657 73 | m_Settings: 74 | - serializedVersion: 2 75 | agentTypeID: 0 76 | agentRadius: 0.5 77 | agentHeight: 2 78 | agentSlope: 45 79 | agentClimb: 0.75 80 | ledgeDropHeight: 0 81 | maxJumpAcrossDistance: 0 82 | minRegionArea: 2 83 | manualCellSize: 0 84 | cellSize: 0.16666667 85 | manualTileSize: 0 86 | tileSize: 256 87 | accuratePlacement: 0 88 | debug: 89 | m_Flags: 0 90 | m_SettingNames: 91 | - Humanoid 92 | -------------------------------------------------------------------------------- /src/TestProjects/RootTestProject/ProjectSettings/PackageManagerSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &1 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 61 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 13964, guid: 0000000000000000e000000000000000, type: 0} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | m_EnablePreReleasePackages: 0 16 | m_EnablePackageDependencies: 0 17 | m_AdvancedSettingsExpanded: 1 18 | m_ScopedRegistriesSettingsExpanded: 1 19 | m_SeeAllPackageVersions: 0 20 | oneTimeWarningShown: 0 21 | m_Registries: 22 | - m_Id: main 23 | m_Name: 24 | m_Url: https://packages.unity.com 25 | m_Scopes: [] 26 | m_IsDefault: 1 27 | m_Capabilities: 7 28 | m_UserSelectedRegistryName: 29 | m_UserAddingNewScopedRegistry: 0 30 | m_RegistryInfoDraft: 31 | m_Modified: 0 32 | m_ErrorMessage: 33 | m_UserModificationsInstanceId: -830 34 | m_OriginalInstanceId: -832 35 | m_LoadAssets: 0 36 | -------------------------------------------------------------------------------- /src/TestProjects/RootTestProject/ProjectSettings/Packages/com.github-joc0de.visual-studio-solution-generator/Settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "m_Dictionary": { 3 | "m_DictionaryValues": [ 4 | { 5 | "type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", 6 | "key": "general.IsEnabled", 7 | "value": "{\"m_Value\":true}" 8 | }, 9 | { 10 | "type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", 11 | "key": "general.GenerateSdkStyleProjects", 12 | "value": "{\"m_Value\":true}" 13 | }, 14 | { 15 | "type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", 16 | "key": "general.LogVerbose", 17 | "value": "{\"m_Value\":false}" 18 | }, 19 | { 20 | "type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", 21 | "key": "general.GenerateReSharperProjectSettings", 22 | "value": "{\"m_Value\":false}" 23 | }, 24 | { 25 | "type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", 26 | "key": "general.TrackMetaDeletion", 27 | "value": "{\"m_Value\":false}" 28 | }, 29 | { 30 | "type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", 31 | "key": "general.EnableNullableReferenceTypes", 32 | "value": "{\"m_Value\":false}" 33 | }, 34 | { 35 | "type": "System.Collections.Generic.List`1[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", 36 | "key": "legacy-style.ExcludedAnalyzers", 37 | "value": "{\"m_Value\":[\"*/Unity.SourceGenerators.dll\"]}" 38 | }, 39 | { 40 | "type": "System.Collections.Generic.List`1[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", 41 | "key": "sdk-style.SdkExcludedFilePatterns", 42 | "value": "{\"m_Value\":[\"**/*.meta\",\"**/*.asset\",\"**/*.prefab\"]}" 43 | }, 44 | { 45 | "type": "System.Collections.Generic.List`1[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", 46 | "key": "general.AdditionalIncludedSolutions", 47 | "value": "{\"m_Value\":[]}" 48 | }, 49 | { 50 | "type": "System.Collections.Generic.List`1[[UnityVisualStudioSolutionGenerator.Configuration.PropertyGroupSetting, UnityVisualStudioSolutionGenerator, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", 51 | "key": "sdk-style.SdkAdditionalProperties", 52 | "value": "{\"m_Value\":[{\"k__BackingField\":\"EnableNETAnalyzers\",\"k__BackingField\":\"true\"},{\"k__BackingField\":\"AnalysisLevel\",\"k__BackingField\":\"latest\"},{\"k__BackingField\":\"AnalysisMode\",\"k__BackingField\":\"AllEnabledByDefault\"}]}" 53 | } 54 | ] 55 | } 56 | } -------------------------------------------------------------------------------- /src/TestProjects/RootTestProject/ProjectSettings/Packages/com.unity.testtools.codecoverage/Settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "m_Dictionary": { 3 | "m_DictionaryValues": [] 4 | } 5 | } -------------------------------------------------------------------------------- /src/TestProjects/RootTestProject/ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!19 &1 4 | Physics2DSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 4 7 | m_Gravity: {x: 0, y: -9.81} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_VelocityIterations: 8 10 | m_PositionIterations: 3 11 | m_VelocityThreshold: 1 12 | m_MaxLinearCorrection: 0.2 13 | m_MaxAngularCorrection: 8 14 | m_MaxTranslationSpeed: 100 15 | m_MaxRotationSpeed: 360 16 | m_BaumgarteScale: 0.2 17 | m_BaumgarteTimeOfImpactScale: 0.75 18 | m_TimeToSleep: 0.5 19 | m_LinearSleepTolerance: 0.01 20 | m_AngularSleepTolerance: 2 21 | m_DefaultContactOffset: 0.01 22 | m_JobOptions: 23 | serializedVersion: 2 24 | useMultithreading: 0 25 | useConsistencySorting: 0 26 | m_InterpolationPosesPerJob: 100 27 | m_NewContactsPerJob: 30 28 | m_CollideContactsPerJob: 100 29 | m_ClearFlagsPerJob: 200 30 | m_ClearBodyForcesPerJob: 200 31 | m_SyncDiscreteFixturesPerJob: 50 32 | m_SyncContinuousFixturesPerJob: 50 33 | m_FindNearestContactsPerJob: 100 34 | m_UpdateTriggerContactsPerJob: 100 35 | m_IslandSolverCostThreshold: 100 36 | m_IslandSolverBodyCostScale: 1 37 | m_IslandSolverContactCostScale: 10 38 | m_IslandSolverJointCostScale: 10 39 | m_IslandSolverBodiesPerJob: 50 40 | m_IslandSolverContactsPerJob: 50 41 | m_AutoSimulation: 1 42 | m_QueriesHitTriggers: 1 43 | m_QueriesStartInColliders: 1 44 | m_CallbacksOnDisable: 1 45 | m_ReuseCollisionCallbacks: 1 46 | m_AutoSyncTransforms: 0 47 | m_AlwaysShowColliders: 0 48 | m_ShowColliderSleep: 1 49 | m_ShowColliderContacts: 0 50 | m_ShowColliderAABB: 0 51 | m_ContactArrowScale: 0.2 52 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} 53 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} 54 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} 55 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} 56 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 57 | -------------------------------------------------------------------------------- /src/TestProjects/RootTestProject/ProjectSettings/PresetManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1386491679 &1 4 | PresetManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_DefaultPresets: {} 8 | -------------------------------------------------------------------------------- /src/TestProjects/RootTestProject/ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2023.2.6f1 2 | m_EditorVersionWithRevision: 2023.2.6f1 (57daeefc879b) 3 | -------------------------------------------------------------------------------- /src/TestProjects/RootTestProject/ProjectSettings/SceneTemplateSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "templatePinStates": [], 3 | "dependencyTypeInfos": [ 4 | { 5 | "userAdded": false, 6 | "type": "UnityEngine.AnimationClip", 7 | "ignore": false, 8 | "defaultInstantiationMode": 0, 9 | "supportsModification": true 10 | }, 11 | { 12 | "userAdded": false, 13 | "type": "UnityEditor.Animations.AnimatorController", 14 | "ignore": false, 15 | "defaultInstantiationMode": 0, 16 | "supportsModification": true 17 | }, 18 | { 19 | "userAdded": false, 20 | "type": "UnityEngine.AnimatorOverrideController", 21 | "ignore": false, 22 | "defaultInstantiationMode": 0, 23 | "supportsModification": true 24 | }, 25 | { 26 | "userAdded": false, 27 | "type": "UnityEditor.Audio.AudioMixerController", 28 | "ignore": false, 29 | "defaultInstantiationMode": 0, 30 | "supportsModification": true 31 | }, 32 | { 33 | "userAdded": false, 34 | "type": "UnityEngine.ComputeShader", 35 | "ignore": true, 36 | "defaultInstantiationMode": 1, 37 | "supportsModification": true 38 | }, 39 | { 40 | "userAdded": false, 41 | "type": "UnityEngine.Cubemap", 42 | "ignore": false, 43 | "defaultInstantiationMode": 0, 44 | "supportsModification": true 45 | }, 46 | { 47 | "userAdded": false, 48 | "type": "UnityEngine.GameObject", 49 | "ignore": false, 50 | "defaultInstantiationMode": 0, 51 | "supportsModification": true 52 | }, 53 | { 54 | "userAdded": false, 55 | "type": "UnityEditor.LightingDataAsset", 56 | "ignore": false, 57 | "defaultInstantiationMode": 0, 58 | "supportsModification": false 59 | }, 60 | { 61 | "userAdded": false, 62 | "type": "UnityEngine.LightingSettings", 63 | "ignore": false, 64 | "defaultInstantiationMode": 0, 65 | "supportsModification": true 66 | }, 67 | { 68 | "userAdded": false, 69 | "type": "UnityEngine.Material", 70 | "ignore": false, 71 | "defaultInstantiationMode": 0, 72 | "supportsModification": true 73 | }, 74 | { 75 | "userAdded": false, 76 | "type": "UnityEditor.MonoScript", 77 | "ignore": true, 78 | "defaultInstantiationMode": 1, 79 | "supportsModification": true 80 | }, 81 | { 82 | "userAdded": false, 83 | "type": "UnityEngine.PhysicMaterial", 84 | "ignore": false, 85 | "defaultInstantiationMode": 0, 86 | "supportsModification": true 87 | }, 88 | { 89 | "userAdded": false, 90 | "type": "UnityEngine.PhysicsMaterial2D", 91 | "ignore": false, 92 | "defaultInstantiationMode": 0, 93 | "supportsModification": true 94 | }, 95 | { 96 | "userAdded": false, 97 | "type": "UnityEngine.Rendering.PostProcessing.PostProcessProfile", 98 | "ignore": false, 99 | "defaultInstantiationMode": 0, 100 | "supportsModification": true 101 | }, 102 | { 103 | "userAdded": false, 104 | "type": "UnityEngine.Rendering.PostProcessing.PostProcessResources", 105 | "ignore": false, 106 | "defaultInstantiationMode": 0, 107 | "supportsModification": true 108 | }, 109 | { 110 | "userAdded": false, 111 | "type": "UnityEngine.Rendering.VolumeProfile", 112 | "ignore": false, 113 | "defaultInstantiationMode": 0, 114 | "supportsModification": true 115 | }, 116 | { 117 | "userAdded": false, 118 | "type": "UnityEditor.SceneAsset", 119 | "ignore": false, 120 | "defaultInstantiationMode": 1, 121 | "supportsModification": true 122 | }, 123 | { 124 | "userAdded": false, 125 | "type": "UnityEngine.Shader", 126 | "ignore": true, 127 | "defaultInstantiationMode": 1, 128 | "supportsModification": true 129 | }, 130 | { 131 | "userAdded": false, 132 | "type": "UnityEngine.ShaderVariantCollection", 133 | "ignore": true, 134 | "defaultInstantiationMode": 1, 135 | "supportsModification": true 136 | }, 137 | { 138 | "userAdded": false, 139 | "type": "UnityEngine.Texture", 140 | "ignore": false, 141 | "defaultInstantiationMode": 0, 142 | "supportsModification": true 143 | }, 144 | { 145 | "userAdded": false, 146 | "type": "UnityEngine.Texture2D", 147 | "ignore": false, 148 | "defaultInstantiationMode": 0, 149 | "supportsModification": true 150 | }, 151 | { 152 | "userAdded": false, 153 | "type": "UnityEngine.Timeline.TimelineAsset", 154 | "ignore": false, 155 | "defaultInstantiationMode": 0, 156 | "supportsModification": true 157 | } 158 | ], 159 | "defaultDependencyTypeInfo": { 160 | "userAdded": false, 161 | "type": "", 162 | "ignore": false, 163 | "defaultInstantiationMode": 1, 164 | "supportsModification": true 165 | }, 166 | "newSceneOverride": 0 167 | } 168 | -------------------------------------------------------------------------------- /src/TestProjects/RootTestProject/ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!78 &1 4 | TagManager: 5 | serializedVersion: 2 6 | tags: [] 7 | layers: 8 | - Default 9 | - TransparentFX 10 | - Ignore Raycast 11 | - 12 | - Water 13 | - UI 14 | - 15 | - 16 | - 17 | - 18 | - 19 | - 20 | - 21 | - 22 | - 23 | - 24 | - 25 | - 26 | - 27 | - 28 | - 29 | - 30 | - 31 | - 32 | - 33 | - 34 | - 35 | - 36 | - 37 | - 38 | - 39 | - 40 | m_SortingLayers: 41 | - name: Default 42 | uniqueID: 0 43 | locked: 0 44 | -------------------------------------------------------------------------------- /src/TestProjects/RootTestProject/ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!5 &1 4 | TimeManager: 5 | m_ObjectHideFlags: 0 6 | Fixed Timestep: 0.02 7 | Maximum Allowed Timestep: 0.33333334 8 | m_TimeScale: 1 9 | Maximum Particle Timestep: 0.03 10 | -------------------------------------------------------------------------------- /src/TestProjects/RootTestProject/ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!310 &1 4 | UnityConnectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 1 7 | m_Enabled: 0 8 | m_TestMode: 0 9 | m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events 10 | m_EventUrl: https://cdp.cloud.unity3d.com/v1/events 11 | m_ConfigUrl: https://config.uca.cloud.unity3d.com 12 | m_DashboardUrl: https://dashboard.unity3d.com 13 | m_TestInitMode: 0 14 | CrashReportingSettings: 15 | m_EventUrl: https://perf-events.cloud.unity3d.com 16 | m_Enabled: 0 17 | m_LogBufferSize: 10 18 | m_CaptureEditorExceptions: 1 19 | UnityPurchasingSettings: 20 | m_Enabled: 0 21 | m_TestMode: 0 22 | UnityAnalyticsSettings: 23 | m_Enabled: 0 24 | m_TestMode: 0 25 | m_InitializeOnStartup: 1 26 | m_PackageRequiringCoreStatsPresent: 0 27 | UnityAdsSettings: 28 | m_Enabled: 0 29 | m_InitializeOnStartup: 1 30 | m_TestMode: 0 31 | m_IosGameId: 32 | m_AndroidGameId: 33 | m_GameIds: {} 34 | m_GameId: 35 | PerformanceReportingSettings: 36 | m_Enabled: 0 37 | -------------------------------------------------------------------------------- /src/TestProjects/RootTestProject/ProjectSettings/VFXManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!937362698 &1 4 | VFXManager: 5 | m_ObjectHideFlags: 0 6 | m_IndirectShader: {fileID: 0} 7 | m_CopyBufferShader: {fileID: 0} 8 | m_SortShader: {fileID: 0} 9 | m_StripUpdateShader: {fileID: 0} 10 | m_RenderPipeSettingsPath: 11 | m_FixedTimeStep: 0.016666668 12 | m_MaxDeltaTime: 0.05 13 | -------------------------------------------------------------------------------- /src/TestProjects/RootTestProject/ProjectSettings/VersionControlSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!890905787 &1 4 | VersionControlSettings: 5 | m_ObjectHideFlags: 0 6 | m_Mode: Visible Meta Files 7 | m_CollabEditorSettings: 8 | inProgressEnabled: 1 9 | -------------------------------------------------------------------------------- /src/TestProjects/RootTestProject/ProjectSettings/XRSettings.asset: -------------------------------------------------------------------------------- 1 | { 2 | "m_SettingKeys": [ 3 | "VR Device Disabled", 4 | "VR Device User Alert" 5 | ], 6 | "m_SettingValues": [ 7 | "False", 8 | "False" 9 | ] 10 | } -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator.Tests/.gitignore: -------------------------------------------------------------------------------- 1 | # This .gitignore file should be placed at the root of your Unity project directory 2 | # 3 | # Get latest from https://github.com/github/gitignore/blob/master/Unity.gitignore 4 | # 5 | /[Ll]ibrary/ 6 | /[Tt]emp/ 7 | /[Oo]bj/ 8 | /[Bb]uild/ 9 | /[Bb]uilds/ 10 | /[Ll]ogs/ 11 | /[Uu]ser[Ss]ettings/ 12 | 13 | # MemoryCaptures can get excessive in size. 14 | # They also could contain extremely sensitive data 15 | /[Mm]emoryCaptures/ 16 | 17 | # Asset meta data should only be ignored when the corresponding asset is also ignored 18 | !/[Aa]ssets/**/*.meta 19 | 20 | # Uncomment this line if you wish to ignore the asset store tools plugin 21 | # /[Aa]ssets/AssetStoreTools* 22 | 23 | # Autogenerated Jetbrains Rider plugin 24 | /[Aa]ssets/Plugins/Editor/JetBrains* 25 | 26 | # Visual Studio cache directory 27 | .vs/ 28 | 29 | # Gradle cache directory 30 | .gradle/ 31 | 32 | # Autogenerated VS/MD/Consulo solution and project files 33 | ExportedObj/ 34 | .consulo/ 35 | *.csproj 36 | *.csproj.meta 37 | *.unityproj 38 | *.sln 39 | *.sln.meta 40 | *.suo 41 | *.tmp 42 | *.user 43 | *.user.meta 44 | *.userprefs 45 | *.pidb 46 | *.booproj 47 | *.svd 48 | *.pdb 49 | *.mdb 50 | *.opendb 51 | *.VC.db 52 | 53 | # Unity3D generated meta files 54 | *.pidb.meta 55 | *.pdb.meta 56 | *.mdb.meta 57 | 58 | # Unity3D generated file on crash reports 59 | sysinfo.txt 60 | 61 | # Builds 62 | *.apk 63 | *.aab 64 | *.unitypackage 65 | 66 | # Crashlytics generated file 67 | crashlytics-build.properties 68 | 69 | # Packed Addressables 70 | /[Aa]ssets/[Aa]ddressable[Aa]ssets[Dd]ata/*/*.bin* 71 | 72 | # Temporary auto-generated Android Assets 73 | /[Aa]ssets/[Ss]treamingAssets/aa.meta 74 | /[Aa]ssets/[Ss]treamingAssets/aa/* 75 | 76 | 77 | # NugetForUnity Packages folder 78 | /[Aa]ssets/[Pp]ackages.meta 79 | /[Aa]ssets/[Pp]ackages/ 80 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator.Tests/.vsconfig: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0", 3 | "components": [ 4 | "Microsoft.VisualStudio.Workload.ManagedGame" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator.Tests/Assets/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e5e8ee3735cd65a4a92e1212805fc7ae 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator.Tests/Assets/Editor/Tests.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5be935e1a4bd94645950a8848350bd4e 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator.Tests/Assets/Editor/Tests/.editorconfig: -------------------------------------------------------------------------------- 1 | [*.cs] 2 | # disable some warnings in test code 3 | # SA1600: missing a documentation 4 | dotnet_diagnostic.SA1600.severity=none 5 | # CS1591: missing xml doc 6 | dotnet_diagnostic.CS1591.severity=none 7 | # CA1062: nullability check fo input parameter 8 | dotnet_diagnostic.CA1062.severity=none 9 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator.Tests/Assets/Editor/Tests/SolutionFileTest.cs: -------------------------------------------------------------------------------- 1 | #nullable enable 2 | 3 | using System; 4 | using System.Collections.Generic; 5 | using System.IO; 6 | using NUnit.Framework; 7 | 8 | namespace UnityVisualStudioSolutionGenerator.Tests 9 | { 10 | public class SolutionFileTest 11 | { 12 | private static readonly string TestSolutionContent = @"Microsoft Visual Studio Solution File, Format Version 12.00 13 | # Visual Studio Version 17 14 | VisualStudioVersion = 17.0.32014.148 15 | MinimumVisualStudioVersion = 10.0.40219.1 16 | Project(""{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"") = ""UnityVisualStudioSolutionGenerator"", ""../UnityVisualStudioSolutionGenerator/Assets/Editor/UnityVisualStudioSolutionGenerator.csproj"", ""{91E92C9C-24FB-0F81-A436-50F1D483A5F4}"" 17 | EndProject 18 | Project(""{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"") = ""UnityVisualStudioSolutionGenerator.Tests"", ""Assets/Editor/Tests/UnityVisualStudioSolutionGenerator.Tests.csproj"", ""{50330BEB-948C-A36A-8379-F379D799AF9A}"" 19 | EndProject 20 | Global 21 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 22 | Debug|Any CPU = Debug|Any CPU 23 | Release|Any CPU = Release|Any CPU 24 | EndGlobalSection 25 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 26 | {91E92C9C-24FB-0F81-A436-50F1D483A5F4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 27 | {91E92C9C-24FB-0F81-A436-50F1D483A5F4}.Debug|Any CPU.Build.0 = Debug|Any CPU 28 | {91E92C9C-24FB-0F81-A436-50F1D483A5F4}.Release|Any CPU.ActiveCfg = Release|Any CPU 29 | {91E92C9C-24FB-0F81-A436-50F1D483A5F4}.Release|Any CPU.Build.0 = Release|Any CPU 30 | {50330BEB-948C-A36A-8379-F379D799AF9A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 31 | {50330BEB-948C-A36A-8379-F379D799AF9A}.Debug|Any CPU.Build.0 = Debug|Any CPU 32 | {50330BEB-948C-A36A-8379-F379D799AF9A}.Release|Any CPU.ActiveCfg = Release|Any CPU 33 | {50330BEB-948C-A36A-8379-F379D799AF9A}.Release|Any CPU.Build.0 = Release|Any CPU 34 | EndGlobalSection 35 | GlobalSection(SolutionProperties) = preSolution 36 | HideSolutionNode = FALSE 37 | EndGlobalSection 38 | EndGlobal 39 | ".Replace('/', Path.DirectorySeparatorChar); 40 | 41 | private static readonly string SolutionDirectoryPath = Path.GetFullPath(Directory.GetCurrentDirectory()); 42 | 43 | private static readonly ProjectFile[] TestSolutionProjectFiles = 44 | { 45 | new( 46 | Path.GetFullPath( 47 | Path.Combine( 48 | SolutionDirectoryPath, 49 | "../UnityVisualStudioSolutionGenerator/Assets/Editor/UnityVisualStudioSolutionGenerator.csproj")), 50 | "{91E92C9C-24FB-0F81-A436-50F1D483A5F4}"), 51 | new( 52 | Path.GetFullPath(Path.Combine(SolutionDirectoryPath, "Assets/Editor/Tests/UnityVisualStudioSolutionGenerator.Tests.csproj")), 53 | "{50330BEB-948C-A36A-8379-F379D799AF9A}"), 54 | }; 55 | 56 | [Test] 57 | public void ParseSolutionTest() 58 | { 59 | var (projectFiles, _) = SolutionFileParser.Parse(TestSolutionContent, SolutionDirectoryPath, false); 60 | 61 | Assert.That(projectFiles, Is.EqualTo(TestSolutionProjectFiles).Using(new ProjectFileEqualityComparer())); 62 | } 63 | 64 | [Test] 65 | public void WriteSolutionTest() 66 | { 67 | var generatedSolutionContent = SolutionFileWriter.WriteToText(SolutionDirectoryPath, TestSolutionProjectFiles); 68 | 69 | Assert.That(generatedSolutionContent, Is.EqualTo(TestSolutionContent)); 70 | } 71 | 72 | private sealed class ProjectFileEqualityComparer : IEqualityComparer 73 | { 74 | public bool Equals(ProjectFile? x, ProjectFile? y) 75 | { 76 | if (ReferenceEquals(x, y)) 77 | { 78 | return true; 79 | } 80 | 81 | if (x is null || y is null) 82 | { 83 | return false; 84 | } 85 | 86 | return x.FilePath == y.FilePath && x.Id == y.Id; 87 | } 88 | 89 | public int GetHashCode(ProjectFile obj) 90 | { 91 | return HashCode.Combine(obj.FilePath, obj.Id); 92 | } 93 | } 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator.Tests/Assets/Editor/Tests/SolutionFileTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fa699e42503a1f84cb1cb30244b66015 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator.Tests/Assets/Editor/Tests/SourceCodeFilesHandlerTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6b297390da881dd4bb219570584628b8 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator.Tests/Assets/Editor/Tests/UnityVisualStudioSolutionGenerator.Tests.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "UnityVisualStudioSolutionGenerator.Tests", 3 | "rootNamespace": "UnityVisualStudioSolutionGenerator.Tests", 4 | "references": [ 5 | "UnityEditor.TestRunner", 6 | "UnityVisualStudioSolutionGenerator" 7 | ], 8 | "includePlatforms": [ 9 | "Editor" 10 | ], 11 | "excludePlatforms": [], 12 | "allowUnsafeCode": false, 13 | "overrideReferences": true, 14 | "precompiledReferences": [ 15 | "nunit.framework.dll" 16 | ], 17 | "autoReferenced": false, 18 | "defineConstraints": [ 19 | "UNITY_INCLUDE_TESTS" 20 | ], 21 | "versionDefines": [], 22 | "noEngineReferences": false 23 | } -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator.Tests/Assets/Editor/Tests/UnityVisualStudioSolutionGenerator.Tests.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1d10abb833e609c468a4c8cf559fb057 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator.Tests/Assets/Editor/Tests/UnityVisualStudioSolutionGenerator.Tests.csproj.DotSettings: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator.Tests/Assets/Editor/Tests/UnityVisualStudioSolutionGenerator.Tests.csproj.DotSettings.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 17c6db56f184ac84e82fdb8ed7683db1 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator.Tests/Assets/Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 98a75d1edc198dc4696c9465c8cb6138 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator.Tests/Assets/Scenes/SampleScene.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9fc0d4010bbf28b4594072e72b8655ab 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator.Tests/Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.github-joc0de.visual-studio-solution-generator": "file:../../UnityVisualStudioSolutionGenerator/Assets" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator.Tests/Packages/packages-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.github-joc0de.visual-studio-solution-generator": { 4 | "version": "file:../../UnityVisualStudioSolutionGenerator/Assets", 5 | "depth": 0, 6 | "source": "local", 7 | "dependencies": { 8 | "com.unity.ide.visualstudio": "2.0.21", 9 | "com.unity.settings-manager": "2.0.1" 10 | } 11 | }, 12 | "com.unity.ext.nunit": { 13 | "version": "2.0.3", 14 | "depth": 3, 15 | "source": "registry", 16 | "dependencies": {}, 17 | "url": "https://packages.unity.com" 18 | }, 19 | "com.unity.ide.visualstudio": { 20 | "version": "2.0.21", 21 | "depth": 1, 22 | "source": "registry", 23 | "dependencies": { 24 | "com.unity.test-framework": "1.1.9" 25 | }, 26 | "url": "https://packages.unity.com" 27 | }, 28 | "com.unity.settings-manager": { 29 | "version": "2.0.1", 30 | "depth": 1, 31 | "source": "registry", 32 | "dependencies": {}, 33 | "url": "https://packages.unity.com" 34 | }, 35 | "com.unity.test-framework": { 36 | "version": "1.3.7", 37 | "depth": 2, 38 | "source": "registry", 39 | "dependencies": { 40 | "com.unity.ext.nunit": "2.0.3", 41 | "com.unity.modules.imgui": "1.0.0", 42 | "com.unity.modules.jsonserialize": "1.0.0" 43 | }, 44 | "url": "https://packages.unity.com" 45 | }, 46 | "com.unity.modules.imgui": { 47 | "version": "1.0.0", 48 | "depth": 3, 49 | "source": "builtin", 50 | "dependencies": {} 51 | }, 52 | "com.unity.modules.jsonserialize": { 53 | "version": "1.0.0", 54 | "depth": 3, 55 | "source": "builtin", 56 | "dependencies": {} 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator.Tests/ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!11 &1 4 | AudioManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Volume: 1 8 | Rolloff Scale: 1 9 | Doppler Factor: 1 10 | Default Speaker Mode: 2 11 | m_SampleRate: 0 12 | m_DSPBufferSize: 1024 13 | m_VirtualVoiceCount: 512 14 | m_RealVoiceCount: 32 15 | m_SpatializerPlugin: 16 | m_AmbisonicDecoderPlugin: 17 | m_DisableAudio: 0 18 | m_VirtualizeEffects: 1 19 | m_RequestedDSPBufferSize: 1024 20 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator.Tests/ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!236 &1 4 | ClusterInputManager: 5 | m_ObjectHideFlags: 0 6 | m_Inputs: [] 7 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator.Tests/ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!55 &1 4 | PhysicsManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 11 7 | m_Gravity: {x: 0, y: -9.81, z: 0} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_BounceThreshold: 2 10 | m_SleepThreshold: 0.005 11 | m_DefaultContactOffset: 0.01 12 | m_DefaultSolverIterations: 6 13 | m_DefaultSolverVelocityIterations: 1 14 | m_QueriesHitBackfaces: 0 15 | m_QueriesHitTriggers: 1 16 | m_EnableAdaptiveForce: 0 17 | m_ClothInterCollisionDistance: 0 18 | m_ClothInterCollisionStiffness: 0 19 | m_ContactsGeneration: 1 20 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 21 | m_AutoSimulation: 1 22 | m_AutoSyncTransforms: 0 23 | m_ReuseCollisionCallbacks: 1 24 | m_ClothInterCollisionSettingsToggle: 0 25 | m_ContactPairsMode: 0 26 | m_BroadphaseType: 0 27 | m_WorldBounds: 28 | m_Center: {x: 0, y: 0, z: 0} 29 | m_Extent: {x: 250, y: 250, z: 250} 30 | m_WorldSubdivisions: 8 31 | m_FrictionType: 0 32 | m_EnableEnhancedDeterminism: 0 33 | m_EnableUnifiedHeightmaps: 1 34 | m_DefaultMaxAngluarSpeed: 7 35 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator.Tests/ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1045 &1 4 | EditorBuildSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Scenes: [] 8 | m_configObjects: {} 9 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator.Tests/ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!159 &1 4 | EditorSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 11 7 | m_ExternalVersionControlSupport: Visible Meta Files 8 | m_SerializationMode: 2 9 | m_LineEndingsForNewScripts: 0 10 | m_DefaultBehaviorMode: 0 11 | m_PrefabRegularEnvironment: {fileID: 0} 12 | m_PrefabUIEnvironment: {fileID: 0} 13 | m_SpritePackerMode: 0 14 | m_SpritePackerPaddingPower: 1 15 | m_EtcTextureCompressorBehavior: 1 16 | m_EtcTextureFastCompressor: 1 17 | m_EtcTextureNormalCompressor: 2 18 | m_EtcTextureBestCompressor: 4 19 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;rsp;asmref 20 | m_ProjectGenerationRootNamespace: 21 | m_CollabEditorSettings: 22 | inProgressEnabled: 1 23 | m_EnableTextureStreamingInEditMode: 1 24 | m_EnableTextureStreamingInPlayMode: 1 25 | m_AsyncShaderCompilation: 1 26 | m_EnterPlayModeOptionsEnabled: 0 27 | m_EnterPlayModeOptions: 3 28 | m_ShowLightmapResolutionOverlay: 1 29 | m_UseLegacyProbeSampleCount: 0 30 | m_SerializeInlineMappingsOnOneLine: 1 31 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator.Tests/ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!30 &1 4 | GraphicsSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 13 7 | m_Deferred: 8 | m_Mode: 1 9 | m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} 10 | m_DeferredReflections: 11 | m_Mode: 1 12 | m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} 13 | m_ScreenSpaceShadows: 14 | m_Mode: 1 15 | m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} 16 | m_LegacyDeferred: 17 | m_Mode: 1 18 | m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} 19 | m_DepthNormals: 20 | m_Mode: 1 21 | m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} 22 | m_MotionVectors: 23 | m_Mode: 1 24 | m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} 25 | m_LightHalo: 26 | m_Mode: 1 27 | m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} 28 | m_LensFlare: 29 | m_Mode: 1 30 | m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} 31 | m_AlwaysIncludedShaders: 32 | - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 33 | - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} 34 | - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} 35 | - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} 36 | - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} 37 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 38 | m_PreloadedShaders: [] 39 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, 40 | type: 0} 41 | m_CustomRenderPipeline: {fileID: 0} 42 | m_TransparencySortMode: 0 43 | m_TransparencySortAxis: {x: 0, y: 0, z: 1} 44 | m_DefaultRenderingPath: 1 45 | m_DefaultMobileRenderingPath: 1 46 | m_TierSettings: [] 47 | m_LightmapStripping: 0 48 | m_FogStripping: 0 49 | m_InstancingStripping: 0 50 | m_LightmapKeepPlain: 1 51 | m_LightmapKeepDirCombined: 1 52 | m_LightmapKeepDynamicPlain: 1 53 | m_LightmapKeepDynamicDirCombined: 1 54 | m_LightmapKeepShadowMask: 1 55 | m_LightmapKeepSubtractive: 1 56 | m_FogKeepLinear: 1 57 | m_FogKeepExp: 1 58 | m_FogKeepExp2: 1 59 | m_AlbedoSwatchInfos: [] 60 | m_LightsUseLinearIntensity: 0 61 | m_LightsUseColorTemperature: 0 62 | m_LogWhenShaderIsCompiled: 0 63 | m_AllowEnlightenSupportForUpgradedProject: 0 64 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator.Tests/ProjectSettings/MemorySettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!387306366 &1 4 | MemorySettings: 5 | m_ObjectHideFlags: 0 6 | m_EditorMemorySettings: 7 | m_MainAllocatorBlockSize: -1 8 | m_ThreadAllocatorBlockSize: -1 9 | m_MainGfxBlockSize: -1 10 | m_ThreadGfxBlockSize: -1 11 | m_CacheBlockSize: -1 12 | m_TypetreeBlockSize: -1 13 | m_ProfilerBlockSize: -1 14 | m_ProfilerEditorBlockSize: -1 15 | m_BucketAllocatorGranularity: -1 16 | m_BucketAllocatorBucketsCount: -1 17 | m_BucketAllocatorBlockSize: -1 18 | m_BucketAllocatorBlockCount: -1 19 | m_ProfilerBucketAllocatorGranularity: -1 20 | m_ProfilerBucketAllocatorBucketsCount: -1 21 | m_ProfilerBucketAllocatorBlockSize: -1 22 | m_ProfilerBucketAllocatorBlockCount: -1 23 | m_TempAllocatorSizeMain: -1 24 | m_JobTempAllocatorBlockSize: -1 25 | m_BackgroundJobTempAllocatorBlockSize: -1 26 | m_JobTempAllocatorReducedBlockSize: -1 27 | m_TempAllocatorSizeGIBakingWorker: -1 28 | m_TempAllocatorSizeNavMeshWorker: -1 29 | m_TempAllocatorSizeAudioWorker: -1 30 | m_TempAllocatorSizeCloudWorker: -1 31 | m_TempAllocatorSizeGfx: -1 32 | m_TempAllocatorSizeJobWorker: -1 33 | m_TempAllocatorSizeBackgroundWorker: -1 34 | m_TempAllocatorSizePreloadManager: -1 35 | m_PlatformMemorySettings: {} 36 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator.Tests/ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!126 &1 4 | NavMeshProjectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | areas: 8 | - name: Walkable 9 | cost: 1 10 | - name: Not Walkable 11 | cost: 1 12 | - name: Jump 13 | cost: 2 14 | - name: 15 | cost: 1 16 | - name: 17 | cost: 1 18 | - name: 19 | cost: 1 20 | - name: 21 | cost: 1 22 | - name: 23 | cost: 1 24 | - name: 25 | cost: 1 26 | - name: 27 | cost: 1 28 | - name: 29 | cost: 1 30 | - name: 31 | cost: 1 32 | - name: 33 | cost: 1 34 | - name: 35 | cost: 1 36 | - name: 37 | cost: 1 38 | - name: 39 | cost: 1 40 | - name: 41 | cost: 1 42 | - name: 43 | cost: 1 44 | - name: 45 | cost: 1 46 | - name: 47 | cost: 1 48 | - name: 49 | cost: 1 50 | - name: 51 | cost: 1 52 | - name: 53 | cost: 1 54 | - name: 55 | cost: 1 56 | - name: 57 | cost: 1 58 | - name: 59 | cost: 1 60 | - name: 61 | cost: 1 62 | - name: 63 | cost: 1 64 | - name: 65 | cost: 1 66 | - name: 67 | cost: 1 68 | - name: 69 | cost: 1 70 | - name: 71 | cost: 1 72 | m_LastAgentTypeID: -887442657 73 | m_Settings: 74 | - serializedVersion: 2 75 | agentTypeID: 0 76 | agentRadius: 0.5 77 | agentHeight: 2 78 | agentSlope: 45 79 | agentClimb: 0.75 80 | ledgeDropHeight: 0 81 | maxJumpAcrossDistance: 0 82 | minRegionArea: 2 83 | manualCellSize: 0 84 | cellSize: 0.16666667 85 | manualTileSize: 0 86 | tileSize: 256 87 | accuratePlacement: 0 88 | debug: 89 | m_Flags: 0 90 | m_SettingNames: 91 | - Humanoid 92 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator.Tests/ProjectSettings/PackageManagerSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &1 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 61 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 13964, guid: 0000000000000000e000000000000000, type: 0} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | m_EnablePreReleasePackages: 0 16 | m_EnablePackageDependencies: 0 17 | m_AdvancedSettingsExpanded: 1 18 | m_ScopedRegistriesSettingsExpanded: 1 19 | m_SeeAllPackageVersions: 0 20 | oneTimeWarningShown: 0 21 | m_Registries: 22 | - m_Id: main 23 | m_Name: 24 | m_Url: https://packages.unity.com 25 | m_Scopes: [] 26 | m_IsDefault: 1 27 | m_Capabilities: 7 28 | m_UserSelectedRegistryName: 29 | m_UserAddingNewScopedRegistry: 0 30 | m_RegistryInfoDraft: 31 | m_Modified: 0 32 | m_ErrorMessage: 33 | m_UserModificationsInstanceId: -830 34 | m_OriginalInstanceId: -832 35 | m_LoadAssets: 0 36 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator.Tests/ProjectSettings/Packages/com.github-joc0de.visual-studio-solution-generator/Settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "m_Dictionary": { 3 | "m_DictionaryValues": [ 4 | { 5 | "type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", 6 | "key": "general.IsEnabled", 7 | "value": "{\"m_Value\":true}" 8 | }, 9 | { 10 | "type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", 11 | "key": "general.GenerateSdkStyleProjects", 12 | "value": "{\"m_Value\":true}" 13 | }, 14 | { 15 | "type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", 16 | "key": "general.LogVerbose", 17 | "value": "{\"m_Value\":true}" 18 | }, 19 | { 20 | "type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", 21 | "key": "general.EnableNullableReferenceTypes", 22 | "value": "{\"m_Value\":true}" 23 | }, 24 | { 25 | "type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", 26 | "key": "general.TrackMetaDeletion", 27 | "value": "{\"m_Value\":true}" 28 | }, 29 | { 30 | "type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", 31 | "key": "general.GenerateReSharperProjectSettings", 32 | "value": "{\"m_Value\":true}" 33 | }, 34 | { 35 | "type": "System.Collections.Generic.List`1[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", 36 | "key": "legacy-style.ExcludedAnalyzers", 37 | "value": "{\"m_Value\":[\"*/Unity.SourceGenerators.dll\"]}" 38 | }, 39 | { 40 | "type": "System.Collections.Generic.List`1[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", 41 | "key": "sdk-style.SdkExcludedFilePatterns", 42 | "value": "{\"m_Value\":[\"**/*.meta\",\"**/*.asset\",\"**/*.prefab\"]}" 43 | }, 44 | { 45 | "type": "System.Collections.Generic.List`1[[UnityVisualStudioSolutionGenerator.Configuration.PropertyGroupSetting, UnityVisualStudioSolutionGenerator, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", 46 | "key": "sdk-style.SdkAdditionalProperties", 47 | "value": "{\"m_Value\":[{\"k__BackingField\":\"EnableNETAnalyzers\",\"k__BackingField\":\"true\"},{\"k__BackingField\":\"AnalysisLevel\",\"k__BackingField\":\"latest\"},{\"k__BackingField\":\"AnalysisMode\",\"k__BackingField\":\"AllEnabledByDefault\"}]}" 48 | } 49 | ] 50 | } 51 | } -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator.Tests/ProjectSettings/Packages/com.unity.testtools.codecoverage/Settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "m_Dictionary": { 3 | "m_DictionaryValues": [] 4 | } 5 | } -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator.Tests/ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!19 &1 4 | Physics2DSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 4 7 | m_Gravity: {x: 0, y: -9.81} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_VelocityIterations: 8 10 | m_PositionIterations: 3 11 | m_VelocityThreshold: 1 12 | m_MaxLinearCorrection: 0.2 13 | m_MaxAngularCorrection: 8 14 | m_MaxTranslationSpeed: 100 15 | m_MaxRotationSpeed: 360 16 | m_BaumgarteScale: 0.2 17 | m_BaumgarteTimeOfImpactScale: 0.75 18 | m_TimeToSleep: 0.5 19 | m_LinearSleepTolerance: 0.01 20 | m_AngularSleepTolerance: 2 21 | m_DefaultContactOffset: 0.01 22 | m_JobOptions: 23 | serializedVersion: 2 24 | useMultithreading: 0 25 | useConsistencySorting: 0 26 | m_InterpolationPosesPerJob: 100 27 | m_NewContactsPerJob: 30 28 | m_CollideContactsPerJob: 100 29 | m_ClearFlagsPerJob: 200 30 | m_ClearBodyForcesPerJob: 200 31 | m_SyncDiscreteFixturesPerJob: 50 32 | m_SyncContinuousFixturesPerJob: 50 33 | m_FindNearestContactsPerJob: 100 34 | m_UpdateTriggerContactsPerJob: 100 35 | m_IslandSolverCostThreshold: 100 36 | m_IslandSolverBodyCostScale: 1 37 | m_IslandSolverContactCostScale: 10 38 | m_IslandSolverJointCostScale: 10 39 | m_IslandSolverBodiesPerJob: 50 40 | m_IslandSolverContactsPerJob: 50 41 | m_AutoSimulation: 1 42 | m_QueriesHitTriggers: 1 43 | m_QueriesStartInColliders: 1 44 | m_CallbacksOnDisable: 1 45 | m_ReuseCollisionCallbacks: 1 46 | m_AutoSyncTransforms: 0 47 | m_AlwaysShowColliders: 0 48 | m_ShowColliderSleep: 1 49 | m_ShowColliderContacts: 0 50 | m_ShowColliderAABB: 0 51 | m_ContactArrowScale: 0.2 52 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} 53 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} 54 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} 55 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} 56 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 57 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator.Tests/ProjectSettings/PresetManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1386491679 &1 4 | PresetManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_DefaultPresets: {} 8 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator.Tests/ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2023.1.1f1 2 | m_EditorVersionWithRevision: 2023.1.1f1 (46620eadcc07) 3 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator.Tests/ProjectSettings/SceneTemplateSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "templatePinStates": [], 3 | "dependencyTypeInfos": [ 4 | { 5 | "userAdded": false, 6 | "type": "UnityEngine.AnimationClip", 7 | "ignore": false, 8 | "defaultInstantiationMode": 0, 9 | "supportsModification": true 10 | }, 11 | { 12 | "userAdded": false, 13 | "type": "UnityEditor.Animations.AnimatorController", 14 | "ignore": false, 15 | "defaultInstantiationMode": 0, 16 | "supportsModification": true 17 | }, 18 | { 19 | "userAdded": false, 20 | "type": "UnityEngine.AnimatorOverrideController", 21 | "ignore": false, 22 | "defaultInstantiationMode": 0, 23 | "supportsModification": true 24 | }, 25 | { 26 | "userAdded": false, 27 | "type": "UnityEditor.Audio.AudioMixerController", 28 | "ignore": false, 29 | "defaultInstantiationMode": 0, 30 | "supportsModification": true 31 | }, 32 | { 33 | "userAdded": false, 34 | "type": "UnityEngine.ComputeShader", 35 | "ignore": true, 36 | "defaultInstantiationMode": 1, 37 | "supportsModification": true 38 | }, 39 | { 40 | "userAdded": false, 41 | "type": "UnityEngine.Cubemap", 42 | "ignore": false, 43 | "defaultInstantiationMode": 0, 44 | "supportsModification": true 45 | }, 46 | { 47 | "userAdded": false, 48 | "type": "UnityEngine.GameObject", 49 | "ignore": false, 50 | "defaultInstantiationMode": 0, 51 | "supportsModification": true 52 | }, 53 | { 54 | "userAdded": false, 55 | "type": "UnityEditor.LightingDataAsset", 56 | "ignore": false, 57 | "defaultInstantiationMode": 0, 58 | "supportsModification": false 59 | }, 60 | { 61 | "userAdded": false, 62 | "type": "UnityEngine.LightingSettings", 63 | "ignore": false, 64 | "defaultInstantiationMode": 0, 65 | "supportsModification": true 66 | }, 67 | { 68 | "userAdded": false, 69 | "type": "UnityEngine.Material", 70 | "ignore": false, 71 | "defaultInstantiationMode": 0, 72 | "supportsModification": true 73 | }, 74 | { 75 | "userAdded": false, 76 | "type": "UnityEditor.MonoScript", 77 | "ignore": true, 78 | "defaultInstantiationMode": 1, 79 | "supportsModification": true 80 | }, 81 | { 82 | "userAdded": false, 83 | "type": "UnityEngine.PhysicMaterial", 84 | "ignore": false, 85 | "defaultInstantiationMode": 0, 86 | "supportsModification": true 87 | }, 88 | { 89 | "userAdded": false, 90 | "type": "UnityEngine.PhysicsMaterial2D", 91 | "ignore": false, 92 | "defaultInstantiationMode": 0, 93 | "supportsModification": true 94 | }, 95 | { 96 | "userAdded": false, 97 | "type": "UnityEngine.Rendering.PostProcessing.PostProcessProfile", 98 | "ignore": false, 99 | "defaultInstantiationMode": 0, 100 | "supportsModification": true 101 | }, 102 | { 103 | "userAdded": false, 104 | "type": "UnityEngine.Rendering.PostProcessing.PostProcessResources", 105 | "ignore": false, 106 | "defaultInstantiationMode": 0, 107 | "supportsModification": true 108 | }, 109 | { 110 | "userAdded": false, 111 | "type": "UnityEngine.Rendering.VolumeProfile", 112 | "ignore": false, 113 | "defaultInstantiationMode": 0, 114 | "supportsModification": true 115 | }, 116 | { 117 | "userAdded": false, 118 | "type": "UnityEditor.SceneAsset", 119 | "ignore": false, 120 | "defaultInstantiationMode": 1, 121 | "supportsModification": true 122 | }, 123 | { 124 | "userAdded": false, 125 | "type": "UnityEngine.Shader", 126 | "ignore": true, 127 | "defaultInstantiationMode": 1, 128 | "supportsModification": true 129 | }, 130 | { 131 | "userAdded": false, 132 | "type": "UnityEngine.ShaderVariantCollection", 133 | "ignore": true, 134 | "defaultInstantiationMode": 1, 135 | "supportsModification": true 136 | }, 137 | { 138 | "userAdded": false, 139 | "type": "UnityEngine.Texture", 140 | "ignore": false, 141 | "defaultInstantiationMode": 0, 142 | "supportsModification": true 143 | }, 144 | { 145 | "userAdded": false, 146 | "type": "UnityEngine.Texture2D", 147 | "ignore": false, 148 | "defaultInstantiationMode": 0, 149 | "supportsModification": true 150 | }, 151 | { 152 | "userAdded": false, 153 | "type": "UnityEngine.Timeline.TimelineAsset", 154 | "ignore": false, 155 | "defaultInstantiationMode": 0, 156 | "supportsModification": true 157 | } 158 | ], 159 | "defaultDependencyTypeInfo": { 160 | "userAdded": false, 161 | "type": "", 162 | "ignore": false, 163 | "defaultInstantiationMode": 1, 164 | "supportsModification": true 165 | }, 166 | "newSceneOverride": 0 167 | } 168 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator.Tests/ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!78 &1 4 | TagManager: 5 | serializedVersion: 2 6 | tags: [] 7 | layers: 8 | - Default 9 | - TransparentFX 10 | - Ignore Raycast 11 | - 12 | - Water 13 | - UI 14 | - 15 | - 16 | - 17 | - 18 | - 19 | - 20 | - 21 | - 22 | - 23 | - 24 | - 25 | - 26 | - 27 | - 28 | - 29 | - 30 | - 31 | - 32 | - 33 | - 34 | - 35 | - 36 | - 37 | - 38 | - 39 | - 40 | m_SortingLayers: 41 | - name: Default 42 | uniqueID: 0 43 | locked: 0 44 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator.Tests/ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!5 &1 4 | TimeManager: 5 | m_ObjectHideFlags: 0 6 | Fixed Timestep: 0.02 7 | Maximum Allowed Timestep: 0.33333334 8 | m_TimeScale: 1 9 | Maximum Particle Timestep: 0.03 10 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator.Tests/ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!310 &1 4 | UnityConnectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 1 7 | m_Enabled: 0 8 | m_TestMode: 0 9 | m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events 10 | m_EventUrl: https://cdp.cloud.unity3d.com/v1/events 11 | m_ConfigUrl: https://config.uca.cloud.unity3d.com 12 | m_DashboardUrl: https://dashboard.unity3d.com 13 | m_TestInitMode: 0 14 | CrashReportingSettings: 15 | m_EventUrl: https://perf-events.cloud.unity3d.com 16 | m_Enabled: 0 17 | m_LogBufferSize: 10 18 | m_CaptureEditorExceptions: 1 19 | UnityPurchasingSettings: 20 | m_Enabled: 0 21 | m_TestMode: 0 22 | UnityAnalyticsSettings: 23 | m_Enabled: 0 24 | m_TestMode: 0 25 | m_InitializeOnStartup: 1 26 | m_PackageRequiringCoreStatsPresent: 0 27 | UnityAdsSettings: 28 | m_Enabled: 0 29 | m_InitializeOnStartup: 1 30 | m_TestMode: 0 31 | m_IosGameId: 32 | m_AndroidGameId: 33 | m_GameIds: {} 34 | m_GameId: 35 | PerformanceReportingSettings: 36 | m_Enabled: 0 37 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator.Tests/ProjectSettings/VFXManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!937362698 &1 4 | VFXManager: 5 | m_ObjectHideFlags: 0 6 | m_IndirectShader: {fileID: 0} 7 | m_CopyBufferShader: {fileID: 0} 8 | m_SortShader: {fileID: 0} 9 | m_StripUpdateShader: {fileID: 0} 10 | m_RenderPipeSettingsPath: 11 | m_FixedTimeStep: 0.016666668 12 | m_MaxDeltaTime: 0.05 13 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator.Tests/ProjectSettings/VersionControlSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!890905787 &1 4 | VersionControlSettings: 5 | m_ObjectHideFlags: 0 6 | m_Mode: Visible Meta Files 7 | m_CollabEditorSettings: 8 | inProgressEnabled: 1 9 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator.Tests/ProjectSettings/XRSettings.asset: -------------------------------------------------------------------------------- 1 | { 2 | "m_SettingKeys": [ 3 | "VR Device Disabled", 4 | "VR Device User Alert" 5 | ], 6 | "m_SettingValues": [ 7 | "False", 8 | "False" 9 | ] 10 | } -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator.Tests/UnityVisualStudioSolutionGenerator.Tests.sln.DotSettings: -------------------------------------------------------------------------------- 1 |  2 | ..\..\GlobalShared.DotSettings 3 | True 4 | True 5 | 1 6 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/.gitignore: -------------------------------------------------------------------------------- 1 | # This .gitignore file should be placed at the root of your Unity project directory 2 | # 3 | # Get latest from https://github.com/github/gitignore/blob/master/Unity.gitignore 4 | # 5 | /[Ll]ibrary/ 6 | /[Tt]emp/ 7 | /[Oo]bj/ 8 | /[Bb]uild/ 9 | /[Bb]uilds/ 10 | /[Ll]ogs/ 11 | /[Uu]ser[Ss]ettings/ 12 | 13 | # MemoryCaptures can get excessive in size. 14 | # They also could contain extremely sensitive data 15 | /[Mm]emoryCaptures/ 16 | 17 | # Asset meta data should only be ignored when the corresponding asset is also ignored 18 | !/[Aa]ssets/**/*.meta 19 | 20 | # Uncomment this line if you wish to ignore the asset store tools plugin 21 | # /[Aa]ssets/AssetStoreTools* 22 | 23 | # Autogenerated Jetbrains Rider plugin 24 | /[Aa]ssets/Plugins/Editor/JetBrains* 25 | 26 | # Visual Studio cache directory 27 | .vs/ 28 | 29 | # Gradle cache directory 30 | .gradle/ 31 | 32 | # Autogenerated VS/MD/Consulo solution and project files 33 | ExportedObj/ 34 | .consulo/ 35 | *.csproj 36 | *.csproj.meta 37 | *.unityproj 38 | *.sln 39 | *.sln.meta 40 | *.suo 41 | *.tmp 42 | *.user 43 | *.user.meta 44 | *.userprefs 45 | *.pidb 46 | *.booproj 47 | *.svd 48 | *.pdb 49 | *.mdb 50 | *.opendb 51 | *.VC.db 52 | 53 | # Unity3D generated meta files 54 | *.pidb.meta 55 | *.pdb.meta 56 | *.mdb.meta 57 | 58 | # Unity3D generated file on crash reports 59 | sysinfo.txt 60 | 61 | # Builds 62 | *.apk 63 | *.aab 64 | *.unitypackage 65 | 66 | # Crashlytics generated file 67 | crashlytics-build.properties 68 | 69 | # Packed Addressables 70 | /[Aa]ssets/[Aa]ddressable[Aa]ssets[Dd]ata/*/*.bin* 71 | 72 | # Temporary auto-generated Android Assets 73 | /[Aa]ssets/[Ss]treamingAssets/aa.meta 74 | /[Aa]ssets/[Ss]treamingAssets/aa/* 75 | 76 | 77 | # NugetForUnity Packages folder 78 | /[Aa]ssets/[Pp]ackages.meta 79 | /[Aa]ssets/[Pp]ackages/ 80 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/.vsconfig: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0", 3 | "components": [ 4 | "Microsoft.VisualStudio.Workload.ManagedGame" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/Assets/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1d36d6823ba73164e8d32e3d72290e45 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/Assets/Editor/Configuration.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2d3f456e7b06d504f87b8ff01ae33248 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/Assets/Editor/Configuration/GeneratorSettings.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 28de116b047332a4b98518fb944fcf0c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/Assets/Editor/Configuration/GeneratorSettingsManager.cs: -------------------------------------------------------------------------------- 1 | #nullable enable 2 | 3 | using System; 4 | using UnityEditor.SettingsManagement; 5 | 6 | namespace UnityVisualStudioSolutionGenerator.Configuration 7 | { 8 | /// 9 | /// Stores the singleton instance of the settings of this package. 10 | /// 11 | internal static class GeneratorSettingsManager 12 | { 13 | private const string PackageName = "com.github-joc0de.visual-studio-solution-generator"; 14 | 15 | private static readonly Lazy LazyInstance = new(() => new Settings(PackageName)); 16 | 17 | /// 18 | /// Gets the singleton instance of the settings of this package. 19 | /// 20 | public static Settings Instance => LazyInstance.Value; 21 | 22 | /// 23 | /// Saves the settings to the file. 24 | /// 25 | public static void Save() 26 | { 27 | Instance.Save(); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/Assets/Editor/Configuration/GeneratorSettingsManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9a2e4cffb183bbe41b314dee3ce6527a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/Assets/Editor/Configuration/GeneratorSettingsProvider.cs: -------------------------------------------------------------------------------- 1 | #nullable enable 2 | 3 | using System.Diagnostics.CodeAnalysis; 4 | using UnityEditor; 5 | using UnityEditor.SettingsManagement; 6 | 7 | namespace UnityVisualStudioSolutionGenerator.Configuration 8 | { 9 | /// 10 | /// Provides the settings of this package to the Unity preferences window. 11 | /// 12 | internal static class GeneratorSettingsProvider 13 | { 14 | /// 15 | /// The path to the settings of this package in the Unity preferences window. 16 | /// 17 | internal const string PreferencesPath = "Project/Visual Studio Solution Generator"; 18 | 19 | /// 20 | /// Creates the settings provider for this package. 21 | /// This is called by the Unity preferences window. 22 | /// 23 | /// The settings provider / the class used to generate the UI to change the settings. 24 | [SettingsProvider] 25 | [SuppressMessage("CodeQuality", "IDE0051:Remove unused private members", Justification = "Called by Unity")] 26 | [SuppressMessage("Performance", "CA1859:Use concrete types when possible for improved performance", Justification = "Return type needed becaus of Unity.")] 27 | private static SettingsProvider CreateSettingsProvider() 28 | { 29 | return new UserSettingsProvider( 30 | PreferencesPath, 31 | GeneratorSettingsManager.Instance, 32 | new[] { typeof(GeneratorSettingsProvider).Assembly }, 33 | SettingsScope.Project); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/Assets/Editor/Configuration/GeneratorSettingsProvider.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9eb1b5412d3f9334d8e35bcaaae5edaa 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/Assets/Editor/Configuration/GeneratorSettingsValue.cs: -------------------------------------------------------------------------------- 1 | #nullable enable 2 | 3 | using UnityEditor.SettingsManagement; 4 | 5 | namespace UnityVisualStudioSolutionGenerator.Configuration 6 | { 7 | /// 8 | /// A setting value that is stored in the . 9 | /// 10 | /// The type of value stored in the setting. 11 | public class GeneratorSettingsValue : UserSetting 12 | { 13 | /// 14 | /// Initializes a new instance of the class. 15 | /// 16 | /// The name of the setting value. 17 | /// The current / initial value of the setting. 18 | public GeneratorSettingsValue(string key, T value) 19 | : base(GeneratorSettingsManager.Instance, key, value) 20 | { 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/Assets/Editor/Configuration/GeneratorSettingsValue.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0eba5822b6eb36c47b36b1675010f83b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/Assets/Editor/Configuration/PropertyGroupSetting.cs: -------------------------------------------------------------------------------- 1 | #nullable enable 2 | 3 | using System; 4 | using UnityEngine; 5 | 6 | namespace UnityVisualStudioSolutionGenerator.Configuration 7 | { 8 | /// 9 | /// Data container for a PropertyGroup that should be included in the generated .csproj file. 10 | /// 11 | [Serializable] 12 | public class PropertyGroupSetting 13 | { 14 | /// 15 | /// Initializes a new instance of the class. 16 | /// 17 | /// The name of the property. 18 | /// The property value. 19 | public PropertyGroupSetting(string name, string value) 20 | { 21 | Name = name; 22 | Value = value; 23 | } 24 | 25 | /// 26 | /// Gets or sets the name of the property. 27 | /// 28 | [field: SerializeField] 29 | public string Name { get; set; } 30 | 31 | /// 32 | /// Gets or sets the property value. 33 | /// 34 | [field: SerializeField] 35 | public string Value { get; set; } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/Assets/Editor/Configuration/PropertyGroupSetting.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 13979cdb247c229479e60fba8839fe8d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/Assets/Editor/Configuration/SettingsUiAdditionalIncludedProjectFiles.cs: -------------------------------------------------------------------------------- 1 | #nullable enable 2 | 3 | using System.Diagnostics.CodeAnalysis; 4 | using System.IO; 5 | using UnityEditor; 6 | using UnityEditor.SettingsManagement; 7 | using UnityEditorInternal; 8 | using UnityEngine; 9 | 10 | namespace UnityVisualStudioSolutionGenerator.Configuration 11 | { 12 | /// 13 | /// The part of the settings UI that handles the section for: . 14 | /// 15 | [SuppressMessage("ReSharper", "UnusedType.Global", Justification = "Used by 'UserSettingsProvider'")] 16 | public static class SettingsUiAdditionalIncludedProjectFiles 17 | { 18 | private static ReorderableList? editor; 19 | 20 | [UserSettingBlock("General Settings")] 21 | [SuppressMessage("CodeQuality", "IDE0051:Remove unused private members", Justification = "Called by 'UserSettingsProvider'")] 22 | [SuppressMessage("ReSharper", "UnusedMember.Local", Justification = "Called by 'UserSettingsProvider'")] 23 | [SuppressMessage("ReSharper", "UnusedParameter.Local", Justification = "Called by 'UserSettingsProvider'")] 24 | [SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Called by 'UserSettingsProvider'")] 25 | private static void AdditionalIncludedProjectFilesGui(string searchContext) 26 | { 27 | editor ??= new ReorderableList(GeneratorSettings.AdditionalIncludedProjectFilesSetting.value, typeof(string), true, false, true, true) 28 | { 29 | drawElementCallback = DrawAdditionalIncludedProjectFilesItems, 30 | }; 31 | 32 | SettingsUiListHelper.DrawEditableSettingsList( 33 | editor, 34 | "C# project files (.csproj) that should be added to the generated .sln", 35 | GeneratorSettings.AdditionalIncludedProjectFilesSetting); 36 | } 37 | 38 | private static void DrawAdditionalIncludedProjectFilesItems(Rect rect, int index, bool isActive, bool isFocused) 39 | { 40 | var currentValue = (string)editor!.list[index]; 41 | if (isActive) 42 | { 43 | const int buttonWidth = 80; 44 | const int spaceBetweenButton = 8; 45 | var buttonRect = new Rect(rect.x + rect.width - buttonWidth, rect.y, buttonWidth, rect.height); 46 | var textFieldRect = new Rect(rect.x, rect.y, rect.width - buttonWidth - spaceBetweenButton, rect.height); 47 | editor.list[index] = EditorGUI.TextField(textFieldRect, currentValue); 48 | if (!GUI.Button(buttonRect, "Browser")) 49 | { 50 | return; 51 | } 52 | 53 | var startDirectory = string.IsNullOrEmpty(currentValue) ? string.Empty : Path.GetDirectoryName(currentValue); 54 | var selectedPath = EditorUtility.OpenFilePanel("Additional C# project file", startDirectory, "csproj"); 55 | editor.list[index] = string.IsNullOrEmpty(selectedPath) ? null : Path.GetRelativePath(Application.dataPath, selectedPath); 56 | } 57 | else 58 | { 59 | EditorGUI.LabelField(rect, currentValue); 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/Assets/Editor/Configuration/SettingsUiAdditionalIncludedProjectFiles.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6a1eb0a28f7ba194cada3e3a823d2736 -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/Assets/Editor/Configuration/SettingsUiAdditionalIncludedSolutions.cs: -------------------------------------------------------------------------------- 1 | #nullable enable 2 | 3 | using System.Diagnostics.CodeAnalysis; 4 | using System.IO; 5 | using UnityEditor; 6 | using UnityEditor.SettingsManagement; 7 | using UnityEditorInternal; 8 | using UnityEngine; 9 | 10 | namespace UnityVisualStudioSolutionGenerator.Configuration 11 | { 12 | /// 13 | /// The part of the settings UI that handles the section for: . 14 | /// 15 | [SuppressMessage("ReSharper", "UnusedType.Global", Justification = "Used by 'UserSettingsProvider'")] 16 | public static class SettingsUiAdditionalIncludedSolutions 17 | { 18 | private static ReorderableList? editor; 19 | 20 | [UserSettingBlock("General Settings")] 21 | [SuppressMessage("CodeQuality", "IDE0051:Remove unused private members", Justification = "Called by 'UserSettingsProvider'")] 22 | [SuppressMessage("ReSharper", "UnusedMember.Local", Justification = "Called by 'UserSettingsProvider'")] 23 | [SuppressMessage("ReSharper", "UnusedParameter.Local", Justification = "Called by 'UserSettingsProvider'")] 24 | [SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Called by 'UserSettingsProvider'")] 25 | private static void AdditionalIncludedSolutionsGui(string searchContext) 26 | { 27 | editor ??= new ReorderableList(GeneratorSettings.AdditionalIncludedSolutionsSetting.value, typeof(string), true, false, true, true) 28 | { 29 | drawElementCallback = DrawAdditionalIncludedSolutionsItems, 30 | }; 31 | 32 | SettingsUiListHelper.DrawEditableSettingsList( 33 | editor, 34 | "Visual studio solutions (.sln) of which the projects should be added to the generated .sln", 35 | GeneratorSettings.AdditionalIncludedSolutionsSetting); 36 | } 37 | 38 | private static void DrawAdditionalIncludedSolutionsItems(Rect rect, int index, bool isActive, bool isFocused) 39 | { 40 | var currentValue = (string)editor!.list[index]; 41 | if (isActive) 42 | { 43 | const int buttonWidth = 80; 44 | const int spaceBetweenButton = 8; 45 | var buttonRect = new Rect(rect.x + rect.width - buttonWidth, rect.y, buttonWidth, rect.height); 46 | var textFieldRect = new Rect(rect.x, rect.y, rect.width - buttonWidth - spaceBetweenButton, rect.height); 47 | editor.list[index] = EditorGUI.TextField(textFieldRect, currentValue); 48 | if (!GUI.Button(buttonRect, "Browser")) 49 | { 50 | return; 51 | } 52 | 53 | var startDirectory = string.IsNullOrEmpty(currentValue) ? string.Empty : Path.GetDirectoryName(currentValue); 54 | var selectedPath = EditorUtility.OpenFilePanel("Additional visual studio solutions", startDirectory, "sln"); 55 | editor.list[index] = string.IsNullOrEmpty(selectedPath) ? null : Path.GetRelativePath(Application.dataPath, selectedPath); 56 | } 57 | else 58 | { 59 | EditorGUI.LabelField(rect, currentValue); 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/Assets/Editor/Configuration/SettingsUiAdditionalIncludedSolutions.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b0a01fa4f45c3174a9b269d24549cd8d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/Assets/Editor/Configuration/SettingsUiExcludedAnalyzers.cs: -------------------------------------------------------------------------------- 1 | #nullable enable 2 | 3 | using System.Diagnostics.CodeAnalysis; 4 | using UnityEditor; 5 | using UnityEditor.SettingsManagement; 6 | using UnityEditorInternal; 7 | using UnityEngine; 8 | 9 | namespace UnityVisualStudioSolutionGenerator.Configuration 10 | { 11 | /// 12 | /// The part of the settings UI that handles the section for: . 13 | /// 14 | [SuppressMessage("ReSharper", "UnusedType.Global", Justification = "Used by 'UserSettingsProvider'")] 15 | public static class SettingsUiExcludedAnalyzers 16 | { 17 | private static ReorderableList? editor; 18 | 19 | [UserSettingBlock("General Settings")] 20 | [SuppressMessage("CodeQuality", "IDE0051:Remove unused private members", Justification = "Called by 'UserSettingsProvider'")] 21 | [SuppressMessage("ReSharper", "UnusedMember.Local", Justification = "Called by 'UserSettingsProvider'")] 22 | [SuppressMessage("ReSharper", "UnusedParameter.Local", Justification = "Called by 'UserSettingsProvider'")] 23 | [SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Called by 'UserSettingsProvider'")] 24 | private static void ExcludedAnalyzersGui(string searchContext) 25 | { 26 | editor ??= new ReorderableList(GeneratorSettings.ExcludedAnalyzersSetting.value, typeof(string), true, true, true, true) 27 | { 28 | drawHeaderCallback = DrawHeader, drawElementCallback = DrawItems, 29 | }; 30 | 31 | SettingsUiListHelper.DrawEditableSettingsList( 32 | editor, 33 | "Analyzers to exclude from Project (e.g. because Visual Studio fails to load them)", 34 | GeneratorSettings.ExcludedAnalyzersSetting); 35 | EditorGUI.BeginChangeCheck(); 36 | } 37 | 38 | private static void DrawHeader(Rect rect) 39 | { 40 | EditorGUI.LabelField(rect, "Analyzer pattern (can contain '*')"); 41 | } 42 | 43 | private static void DrawItems(Rect rect, int index, bool isActive, bool isFocused) 44 | { 45 | if (isActive) 46 | { 47 | editor!.list[index] = EditorGUI.TextField(rect, (string)editor.list[index]); 48 | } 49 | else 50 | { 51 | EditorGUI.LabelField(rect, (string)editor!.list[index]); 52 | } 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/Assets/Editor/Configuration/SettingsUiExcludedAnalyzers.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8f54614881cbb344ba26df33aca98248 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/Assets/Editor/Configuration/SettingsUiListHelper.cs: -------------------------------------------------------------------------------- 1 | #nullable enable 2 | 3 | using System; 4 | using System.Collections; 5 | using UnityEditor; 6 | using UnityEditor.SettingsManagement; 7 | using UnityEditorInternal; 8 | using UnityEngine; 9 | 10 | namespace UnityVisualStudioSolutionGenerator.Configuration 11 | { 12 | /// 13 | /// Helper for drawing s in the settings UI. 14 | /// 15 | internal static class SettingsUiListHelper 16 | { 17 | /// 18 | /// Draws a in the settings UI. 19 | /// 20 | /// The 'list' to draw. 21 | /// An additional header text to show, if omitted no header will by rendered. 22 | /// The settings value that is edited by this UI, used to apply / persist changes done by the UI. 23 | public static void DrawEditableSettingsList(ReorderableList editor, string? headerText, IUserSetting setting) 24 | { 25 | _ = editor ?? throw new ArgumentNullException(nameof(editor)); 26 | _ = setting ?? throw new ArgumentNullException(nameof(setting)); 27 | 28 | EditorGUI.BeginChangeCheck(); 29 | 30 | if (!string.IsNullOrEmpty(headerText)) 31 | { 32 | GUILayout.Label(headerText); 33 | } 34 | 35 | EditorGUI.BeginChangeCheck(); 36 | editor.list = (IList)setting.GetValue(); // ensure list is correct reverence e.g. when it is retested 37 | editor.DoLayoutList(); 38 | 39 | // Because List is a reference type, we need to apply the changes to the backing repository 40 | if (EditorGUI.EndChangeCheck()) 41 | { 42 | setting.ApplyModifiedProperties(); 43 | } 44 | 45 | SettingsGUILayout.DoResetContextMenuForLastRect(setting); 46 | 47 | if (EditorGUI.EndChangeCheck()) 48 | { 49 | GeneratorSettingsManager.Save(); 50 | } 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/Assets/Editor/Configuration/SettingsUiListHelper.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a1cd99aa2e6192849b119a73f9aefd32 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/Assets/Editor/Configuration/SettingsUiSdkAdditionalProperties.cs: -------------------------------------------------------------------------------- 1 | #nullable enable 2 | 3 | using System.Diagnostics.CodeAnalysis; 4 | using UnityEditor; 5 | using UnityEditor.SettingsManagement; 6 | using UnityEditorInternal; 7 | using UnityEngine; 8 | 9 | namespace UnityVisualStudioSolutionGenerator.Configuration 10 | { 11 | /// 12 | /// The part of the settings UI that handles the section for: . 13 | /// 14 | [SuppressMessage("ReSharper", "UnusedType.Global", Justification = "Used by 'UserSettingsProvider'")] 15 | public static class SettingsUiSdkAdditionalProperties 16 | { 17 | private const string PropertiesDocumentationLink = "https://learn.microsoft.com/de-de/dotnet/core/project-sdk/msbuild-props"; 18 | 19 | private static ReorderableList? editor; 20 | 21 | [UserSettingBlock("Sdk-style Project Settings")] 22 | [SuppressMessage("CodeQuality", "IDE0051:Remove unused private members", Justification = "Called by 'UserSettingsProvider'")] 23 | [SuppressMessage("ReSharper", "UnusedMember.Local", Justification = "Called by 'UserSettingsProvider'")] 24 | [SuppressMessage("ReSharper", "UnusedParameter.Local", Justification = "Called by 'UserSettingsProvider'")] 25 | [SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Called by 'UserSettingsProvider'")] 26 | private static void SdkAdditionalPropertiesGui(string searchContext) 27 | { 28 | editor ??= new ReorderableList( 29 | GeneratorSettings.SdkAdditionalPropertiesSetting.value, 30 | typeof(PropertyGroupSetting), 31 | true, 32 | true, 33 | true, 34 | true) { drawHeaderCallback = DrawHeader, drawElementCallback = DrawSdkAdditionalPropertiesItems }; 35 | 36 | GUILayout.Label("Additional Project Properties (PropertyGroup)"); 37 | EditorGUILayout.HelpBox( 38 | "This project settings are only considered by Visual Studio. Unity building is not affected by them.", 39 | MessageType.Info); 40 | 41 | GUILayout.Label("Documentation about available properties see:"); 42 | if (EditorGUILayout.LinkButton(PropertiesDocumentationLink)) 43 | { 44 | Application.OpenURL(PropertiesDocumentationLink); 45 | } 46 | 47 | SettingsUiListHelper.DrawEditableSettingsList(editor, null, GeneratorSettings.SdkAdditionalPropertiesSetting); 48 | } 49 | 50 | private static void DrawHeader(Rect rect) 51 | { 52 | const int space = 5; 53 | var halfSpace = (rect.width - space) / 2; 54 | var firstHalfRect = new Rect(rect) { width = halfSpace }; 55 | var secondHalfRect = new Rect(rect) { width = halfSpace, x = rect.x + halfSpace + space }; 56 | EditorGUI.LabelField(firstHalfRect, "Name"); 57 | EditorGUI.LabelField(secondHalfRect, "Value"); 58 | } 59 | 60 | private static void DrawSdkAdditionalPropertiesItems(Rect rect, int index, bool isActive, bool isFocused) 61 | { 62 | var currentValue = (PropertyGroupSetting)editor!.list[index]; 63 | const int space = 5; 64 | var halfSpace = (rect.width - space) / 2; 65 | var firstHalfRect = new Rect(rect) { width = halfSpace }; 66 | var secondHalfRect = new Rect(rect) { width = halfSpace, x = rect.x + halfSpace + space }; 67 | if (isActive) 68 | { 69 | currentValue.Name = EditorGUI.TextField(firstHalfRect, currentValue.Name); 70 | currentValue.Value = EditorGUI.TextField(secondHalfRect, currentValue.Value); 71 | } 72 | else 73 | { 74 | EditorGUI.LabelField(firstHalfRect, currentValue.Name); 75 | EditorGUI.LabelField(secondHalfRect, currentValue.Value); 76 | } 77 | } 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/Assets/Editor/Configuration/SettingsUiSdkAdditionalProperties.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b7f578abcaab9cf468a2f903ec4a72aa 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/Assets/Editor/Configuration/SettingsUiSdkExcludedFilePatterns.cs: -------------------------------------------------------------------------------- 1 | #nullable enable 2 | 3 | using System.Diagnostics.CodeAnalysis; 4 | using UnityEditor; 5 | using UnityEditor.SettingsManagement; 6 | using UnityEditorInternal; 7 | using UnityEngine; 8 | 9 | namespace UnityVisualStudioSolutionGenerator.Configuration 10 | { 11 | /// 12 | /// The part of the settings UI that handles the section for: . 13 | /// 14 | [SuppressMessage("ReSharper", "UnusedType.Global", Justification = "Used by 'UserSettingsProvider'")] 15 | public static class SettingsUiSdkExcludedFilePatterns 16 | { 17 | private static ReorderableList? editor; 18 | 19 | [UserSettingBlock("Sdk-style Project Settings")] 20 | [SuppressMessage("CodeQuality", "IDE0051:Remove unused private members", Justification = "Called by 'UserSettingsProvider'")] 21 | [SuppressMessage("ReSharper", "UnusedMember.Local", Justification = "Called by 'UserSettingsProvider'")] 22 | [SuppressMessage("ReSharper", "UnusedParameter.Local", Justification = "Called by 'UserSettingsProvider'")] 23 | [SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Called by 'UserSettingsProvider'")] 24 | private static void SdkExcludedFilePatternsGui(string searchContext) 25 | { 26 | editor ??= new ReorderableList(GeneratorSettings.SdkExcludedFilePatternsSetting.value, typeof(string), true, false, true, true) 27 | { 28 | drawElementCallback = DrawSdkExcludedFilePatternsItems, 29 | }; 30 | 31 | SettingsUiListHelper.DrawEditableSettingsList( 32 | editor, 33 | "File patterns to excluded from project file", 34 | GeneratorSettings.SdkExcludedFilePatternsSetting); 35 | } 36 | 37 | private static void DrawSdkExcludedFilePatternsItems(Rect rect, int index, bool isActive, bool isFocused) 38 | { 39 | if (isActive) 40 | { 41 | editor!.list[index] = EditorGUI.TextField(rect, (string)editor.list[index]); 42 | } 43 | else 44 | { 45 | EditorGUI.LabelField(rect, (string)editor!.list[index]); 46 | } 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/Assets/Editor/Configuration/SettingsUiSdkExcludedFilePatterns.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 04f75f66580a8124bba7e8d370063ef6 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/Assets/Editor/Configuration/SettingsUiVisualStudioEditorIntegration.cs: -------------------------------------------------------------------------------- 1 | #nullable enable 2 | using System.Diagnostics.CodeAnalysis; 3 | using Microsoft.Unity.VisualStudio.Editor; 4 | using Unity.CodeEditor; 5 | using UnityEditor.SettingsManagement; 6 | 7 | namespace UnityVisualStudioSolutionGenerator.Configuration 8 | { 9 | /// 10 | /// The part of the settings UI that integrates the settings from the Unity visual studio editor plugin. 11 | /// 12 | [SuppressMessage("ReSharper", "UnusedType.Global", Justification = "Used by 'UserSettingsProvider'")] 13 | public static class SettingsUiVisualStudioEditorIntegration 14 | { 15 | [UserSettingBlock("Visual Studio Editor integration")] 16 | [SuppressMessage("CodeQuality", "IDE0051:Remove unused private members", Justification = "Called by 'UserSettingsProvider'")] 17 | [SuppressMessage("ReSharper", "UnusedMember.Local", Justification = "Called by 'UserSettingsProvider'")] 18 | [SuppressMessage("ReSharper", "UnusedParameter.Local", Justification = "Called by 'UserSettingsProvider'")] 19 | [SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Called by 'UserSettingsProvider'")] 20 | private static void VisualStudioEditorSettingsGui(string searchContext) 21 | { 22 | if (CodeEditor.CurrentEditor is VisualStudioEditor visualStudioEditor) 23 | { 24 | visualStudioEditor.OnGUI(); 25 | } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/Assets/Editor/Configuration/SettingsUiVisualStudioEditorIntegration.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0d4c9059c37bf2a47b746a059151acde 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/Assets/Editor/LogHelper.cs: -------------------------------------------------------------------------------- 1 | #nullable enable 2 | 3 | using System; 4 | using UnityEngine; 5 | using UnityVisualStudioSolutionGenerator.Configuration; 6 | 7 | namespace UnityVisualStudioSolutionGenerator 8 | { 9 | /// 10 | /// Helper for writing logs to Unity . 11 | /// 12 | internal static class LogHelper 13 | { 14 | /// 15 | /// Logs a informational message. A message that is displayed by default. 16 | /// 17 | /// The message to log. 18 | public static void LogInformation(FormattableString message) 19 | { 20 | Log(LogType.Log, message); 21 | } 22 | 23 | /// 24 | /// Logs a error message. Always shown in the log and has a extra highlight. 25 | /// 26 | /// The message to log. 27 | public static void LogError(FormattableString message) 28 | { 29 | Log(LogType.Error, message); 30 | } 31 | 32 | /// 33 | /// Logs a error message. Always shown in the log and has a extra highlight. 34 | /// 35 | /// The message to log. 36 | public static void LogWarning(FormattableString message) 37 | { 38 | Log(LogType.Warning, message); 39 | } 40 | 41 | /// 42 | /// Logs a verbose message. A message that is only shown if is enabled. 43 | /// 44 | /// The message to log. 45 | public static void LogVerbose(FormattableString message) 46 | { 47 | if (GeneratorSettings.LogVerbose) 48 | { 49 | LogInformation(message); 50 | } 51 | } 52 | 53 | private static void Log(LogType logType, FormattableString message) 54 | { 55 | Debug.LogFormat(logType, LogOption.NoStacktrace, null, message.Format, message.GetArguments()); 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/Assets/Editor/LogHelper.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6dc0e66fed32b194d861ebea0436f371 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/Assets/Editor/MenuItemProvider.cs: -------------------------------------------------------------------------------- 1 | #nullable enable 2 | 3 | using Unity.CodeEditor; 4 | using UnityEditor; 5 | using UnityVisualStudioSolutionGenerator.Configuration; 6 | 7 | namespace UnityVisualStudioSolutionGenerator 8 | { 9 | /// 10 | /// Provides menu items to access quick actions for Unity Visual Studio solutions. 11 | /// 12 | public static class MenuItemProvider 13 | { 14 | /// 15 | /// Opens the C# project in Visual Studio. 16 | /// 17 | [MenuItem("Visual Studio/Open Solution", priority = 0)] 18 | public static void OpenSolution() 19 | { 20 | EditorApplication.ExecuteMenuItem("Assets/Open C# Project"); 21 | } 22 | 23 | /// 24 | /// Returns whether or not the menu item should be enabled. 25 | /// 26 | /// True if the menu item should be enabled, False otherwise. 27 | [MenuItem("Visual Studio/Open Solution", true)] 28 | public static bool OpenSolutionEnabled() 29 | { 30 | return GeneratorSettings.IsVisualStudioEditorEnabled(); 31 | } 32 | 33 | /// 34 | /// Regenerates the Visual Studio solution file and the C# project files. 35 | /// 36 | [MenuItem("Visual Studio/Generate Solution", priority = 1)] 37 | public static void SyncSolution() 38 | { 39 | VisualStudioAssetPostprocessor.MarkAsChanged(); 40 | CodeEditor.CurrentEditor.SyncAll(); 41 | } 42 | 43 | /// 44 | /// Returns whether or not the menu item should be enabled. 45 | /// 46 | /// True if the menu item should be enabled, False otherwise. 47 | [MenuItem("Visual Studio/Generate Solution", true)] 48 | public static bool SyncSolutionEnabled() 49 | { 50 | return GeneratorSettings.IsSolutionGeneratorEnabled(); 51 | } 52 | 53 | /// 54 | /// Regenerates the Visual Studio solution file and the C# project files as SDK-style projects. 55 | /// 56 | [MenuItem("Visual Studio/Generate Solution (Sdk-Style)", priority = 2)] 57 | public static void SyncSolutionSdkStyle() 58 | { 59 | GeneratorSettings.GenerateSdkStyleProjects = true; 60 | SyncSolution(); 61 | } 62 | 63 | /// 64 | /// Returns whether or not the menu item should be enabled. 65 | /// 66 | /// True if the menu item should be enabled, False otherwise. 67 | [MenuItem("Visual Studio/Generate Solution (Sdk-Style)", true)] 68 | public static bool SyncSolutionSdkStyleEnabled() 69 | { 70 | return GeneratorSettings.IsSolutionGeneratorEnabled(); 71 | } 72 | 73 | /// 74 | /// Regenerates the Visual Studio solution file and the C# project files as Legacy-style projects. 75 | /// 76 | [MenuItem("Visual Studio/Generate Solution (Legacy-Style)", priority = 3)] 77 | public static void SyncSolutionLegacyStyle() 78 | { 79 | GeneratorSettings.GenerateSdkStyleProjects = false; 80 | SyncSolution(); 81 | } 82 | 83 | /// 84 | /// Returns whether or not the menu item should be enabled. 85 | /// 86 | /// True if the menu item should be enabled, False otherwise. 87 | [MenuItem("Visual Studio/Generate Solution (Legacy-Style)", true)] 88 | public static bool SyncSolutionLegacyStyleEnabled() 89 | { 90 | return GeneratorSettings.IsSolutionGeneratorEnabled(); 91 | } 92 | 93 | /// 94 | /// Checks all '.cs' files to contain '#nullable enable' at the start. 95 | /// 96 | [MenuItem("Visual Studio/Apply enable nullable to all files", priority = 4)] 97 | public static void EnableNullableOnAllFiles() 98 | { 99 | SourceCodeFilesHandler.EnableNullableOnAllFiles(SolutionFile.CurrentProjectSolution); 100 | } 101 | 102 | /// 103 | /// Returns whether or not the menu item should be enabled. 104 | /// 105 | /// True if the menu item should be enabled, False otherwise. 106 | [MenuItem("Visual Studio/Apply enable nullable to all files", true)] 107 | public static bool EnableNullableOnAllFilesEnabled() 108 | { 109 | return GeneratorSettings.EnableNullableReferenceTypes; 110 | } 111 | 112 | /// 113 | /// Opens the solution generation preferences page. 114 | /// 115 | [MenuItem("Visual Studio/Preferences", priority = 5)] 116 | public static void OpenPreferences() 117 | { 118 | SettingsService.OpenProjectSettings(GeneratorSettingsProvider.PreferencesPath); 119 | } 120 | } 121 | } 122 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/Assets/Editor/MenuItemProvider.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b3f3c3daf2ebf604486f3ac8e71f8398 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/Assets/Editor/ProjectFile.cs: -------------------------------------------------------------------------------- 1 | #nullable enable 2 | 3 | using System; 4 | using System.IO; 5 | 6 | namespace UnityVisualStudioSolutionGenerator 7 | { 8 | /// 9 | /// Represents a C# project file. 10 | /// 11 | public sealed class ProjectFile 12 | { 13 | /// 14 | /// Initializes a new instance of the class. 15 | /// 16 | /// The absolute path of the project file. 17 | /// The ID of the project file. 18 | public ProjectFile(string filePath, string id) 19 | { 20 | FilePath = filePath ?? throw new ArgumentNullException(nameof(filePath)); 21 | Id = id ?? throw new ArgumentNullException(nameof(id)); 22 | ProjectName = Path.GetFileNameWithoutExtension(filePath); 23 | } 24 | 25 | /// 26 | /// Gets the absolute path of the project file. 27 | /// 28 | public string FilePath { get; } 29 | 30 | /// 31 | /// Gets the ID of the project file. 32 | /// 33 | public string Id { get; } 34 | 35 | /// 36 | /// Gets the project name witch is the name of the project file without its extension. 37 | /// 38 | public string ProjectName { get; } 39 | 40 | /// 41 | public override bool Equals(object? obj) 42 | { 43 | return ReferenceEquals(this, obj) || obj is ProjectFile other && Equals(other); 44 | } 45 | 46 | /// 47 | public override int GetHashCode() 48 | { 49 | return Id.GetHashCode(StringComparison.Ordinal); 50 | } 51 | 52 | /// 53 | public override string ToString() 54 | { 55 | return $"{nameof(FilePath)}: {FilePath}, {nameof(Id)}: {Id}"; 56 | } 57 | 58 | private bool Equals(ProjectFile other) 59 | { 60 | // we need to use the ProjectName as an alternative so we detect duplicate entries inside .sln 61 | return Id == other.Id || ProjectName == other.ProjectName; 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/Assets/Editor/ProjectFile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a1f227e60fd492f47b9f4f9c2c106736 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/Assets/Editor/ProjectFileGeneratorBase.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: afc589c72fc59e247aa65323da002f7e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/Assets/Editor/ProjectFileGeneratorLegacyStyle.cs: -------------------------------------------------------------------------------- 1 | #nullable enable 2 | 3 | using System; 4 | using System.IO; 5 | using System.Linq; 6 | using System.Xml; 7 | using System.Xml.Linq; 8 | 9 | namespace UnityVisualStudioSolutionGenerator 10 | { 11 | /// 12 | /// Generates a C# project file in the legacy style (the style currently used by the Unity Visual Studio Plugin). 13 | /// 14 | public class ProjectFileGeneratorLegacyStyle : ProjectFileGeneratorBase 15 | { 16 | /// 17 | public ProjectFileGeneratorLegacyStyle(string filePath) 18 | : base(filePath) 19 | { 20 | } 21 | 22 | /// 23 | protected override void WriteProjectFileInternal(XmlWriter writer, string outputFileDirectoryPath, string solutionDirectoryPath) 24 | { 25 | _ = writer ?? throw new ArgumentNullException(nameof(writer)); 26 | writer.WriteStartDocument(); 27 | 28 | foreach (var outputPathElement in ProjectElement.Descendants(XmlNamespace + "OutputPath")) 29 | { 30 | outputPathElement.Value = Path.Combine(solutionDirectoryPath, "Temp", "Bin", "$(Configuration)", ProjectName); 31 | } 32 | 33 | foreach (var hintPathElement in ProjectElement.Descendants(XmlNamespace + "HintPath")) 34 | { 35 | hintPathElement.Value = Path.GetFullPath(hintPathElement.Value, DirectoryPath); 36 | } 37 | 38 | ProjectElement.Descendants(XmlNamespace + "Compile").Remove(); 39 | 40 | var compileIncludeAllElement = new XElement(XmlNamespace + "Compile", new XAttribute("Include", "**/*.cs")); 41 | var firstItemGroupElement = new XElement(XmlNamespace + "ItemGroup", compileIncludeAllElement); 42 | ProjectElement.Elements(XmlNamespace + "ItemGroup").First().AddBeforeSelf(firstItemGroupElement); 43 | 44 | // if there are sup-folders with a assembly definition file (a sup project) we need to ignore its files, they are imported as a project reference. 45 | var foldersToIgnore = FindSubProjectFolders(outputFileDirectoryPath); 46 | compileIncludeAllElement.AddAfterSelf( 47 | foldersToIgnore.Select( 48 | relativeSubProjectDirectory => new XElement( 49 | XmlNamespace + "Compile", 50 | new XAttribute("Remove", $"{relativeSubProjectDirectory}/**/*.cs")))); 51 | 52 | foreach (var noneElement in ProjectElement.Descendants(XmlNamespace + "None")) 53 | { 54 | var includeAttribute = noneElement.Attribute("Include"); 55 | if (includeAttribute is null) 56 | { 57 | continue; 58 | } 59 | 60 | includeAttribute.Value = Path.GetRelativePath(outputFileDirectoryPath, Path.GetFullPath(includeAttribute.Value, DirectoryPath)); 61 | noneElement.Element(XmlNamespace + "Link")?.Remove(); 62 | } 63 | 64 | foreach (var projectReferenceElement in ProjectElement.Descendants(XmlNamespace + "ProjectReference")) 65 | { 66 | var includeAttribute = projectReferenceElement.Attribute("Include"); 67 | if (includeAttribute is null) 68 | { 69 | continue; 70 | } 71 | 72 | var currentProjectFilePath = Path.GetFullPath(includeAttribute.Value, DirectoryPath); 73 | var newProjectFilePath = DetermineNewProjectFilePath(currentProjectFilePath); 74 | includeAttribute.Value = Path.GetRelativePath(outputFileDirectoryPath, newProjectFilePath); 75 | } 76 | 77 | ProjectElement.AddFirst( 78 | new XElement( 79 | XmlNamespace + "PropertyGroup", 80 | new XElement(XmlNamespace + "BaseIntermediateOutputPath", Path.Combine(solutionDirectoryPath, "obj", "Legacy", ProjectName)), 81 | new XElement(XmlNamespace + "EnableNETAnalyzers", "true"), 82 | new XElement(XmlNamespace + "AnalysisLevel", "latest"), 83 | new XElement(XmlNamespace + "AnalysisMode", "AllEnabledByDefault"))); 84 | 85 | ProjectElement.WriteTo(writer); 86 | 87 | writer.WriteEndDocument(); 88 | writer.Flush(); 89 | 90 | LogHelper.LogVerbose($"Generated project file: {ProjectName}.csproj"); 91 | } 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/Assets/Editor/ProjectFileGeneratorLegacyStyle.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 964fed890234b9143880abe3208e7e7b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/Assets/Editor/ProjectFileGeneratorSdkStyle.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 663e6f42e9519c64192f3d0096fe5b9e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/Assets/Editor/ProjectFileParser.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7c3bf4c456a80c748ab8cb5bb072873e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/Assets/Editor/ProjectSourceCodeWatcherManager.cs: -------------------------------------------------------------------------------- 1 | #nullable enable 2 | 3 | using System; 4 | using System.Collections.Generic; 5 | using System.IO; 6 | using System.Linq; 7 | using UnityVisualStudioSolutionGenerator.Configuration; 8 | 9 | namespace UnityVisualStudioSolutionGenerator 10 | { 11 | /// 12 | /// Static manager of keeps them running even if Unity reloads the AppDomain (deletes static instances). 13 | /// 14 | internal static class ProjectSourceCodeWatcherManager 15 | { 16 | private static readonly Dictionary ProjectSourceCodeWatchers = new(); 17 | 18 | /// 19 | /// Creates a that watches all source code file changes inside the project. 20 | /// 21 | /// 22 | /// The root directory of all project files. Is used as a starting point for the watcher, so only files inside 23 | /// this folder or any sup-folder are watched. 24 | /// 25 | public static void AddSourceCodeWatcherForProject(string projectRootDirectoryPath) 26 | { 27 | if (!FileWatcherFeatureEnabled()) 28 | { 29 | DisableProjectSourceCodeWatchers(); 30 | return; 31 | } 32 | 33 | AddSourceCodeWatcherForProjectInternal(projectRootDirectoryPath); 34 | } 35 | 36 | /// 37 | /// Create all required 's for the should be called after the domain is reloaded 38 | /// and therefor all 's are destroyed. 39 | /// 40 | /// All project files from the .sln. 41 | public static void Initialize(IEnumerable projectFiles) 42 | { 43 | if (!FileWatcherFeatureEnabled()) 44 | { 45 | DisableProjectSourceCodeWatchers(); 46 | return; 47 | } 48 | 49 | foreach (var project in projectFiles) 50 | { 51 | if (!File.Exists(project.FilePath)) 52 | { 53 | continue; 54 | } 55 | 56 | string projectRootDirectoryPath; 57 | if (File.Exists(Path.ChangeExtension(project.FilePath, ".asmdef"))) 58 | { 59 | // fast path without needing to read the content of the .csproj because the .asmdef file is directly next to the .csproj file. 60 | if (ProjectFileParser.IsProjectFileFromPackageCache(project.FilePath)) 61 | { 62 | continue; 63 | } 64 | 65 | projectRootDirectoryPath = ProjectFileParser.GetProjectRootDirectoryPath(project.FilePath); 66 | } 67 | else 68 | { 69 | var generator = ProjectFileGeneratorBase.Create(project.FilePath); 70 | 71 | if (generator.IsProjectFromPackageCache()) 72 | { 73 | continue; 74 | } 75 | 76 | projectRootDirectoryPath = generator.GetProjectRootDirectoryPath(); 77 | } 78 | 79 | AddSourceCodeWatcherForProjectInternal(projectRootDirectoryPath); 80 | } 81 | } 82 | 83 | private static void AddSourceCodeWatcherForProjectInternal(string projectRootDirectoryPath) 84 | { 85 | var projectDirectoryPathWithSeparator = projectRootDirectoryPath + Path.DirectorySeparatorChar; 86 | if (ProjectSourceCodeWatchers.Keys.Any( 87 | watchedDirectoryPath => projectDirectoryPathWithSeparator.StartsWith(watchedDirectoryPath, StringComparison.OrdinalIgnoreCase))) 88 | { 89 | return; 90 | } 91 | 92 | ProjectSourceCodeWatchers.Add(projectDirectoryPathWithSeparator, new SourceCodeFileWatcher(projectRootDirectoryPath)); 93 | } 94 | 95 | private static bool FileWatcherFeatureEnabled() 96 | { 97 | return GeneratorSettings.IsSolutionGeneratorEnabled() && 98 | (GeneratorSettings.TrackMetaDeletion || GeneratorSettings.EnableNullableReferenceTypes); 99 | } 100 | 101 | private static void DisableProjectSourceCodeWatchers() 102 | { 103 | foreach (var sourceCodeFileWatcher in ProjectSourceCodeWatchers.Values) 104 | { 105 | sourceCodeFileWatcher.Dispose(); 106 | } 107 | 108 | ProjectSourceCodeWatchers.Clear(); 109 | } 110 | } 111 | } 112 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/Assets/Editor/ProjectSourceCodeWatcherManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d111f5040e3f61749ae3c51db48ef920 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/Assets/Editor/ReSharperProjectSettingsGenerator.cs: -------------------------------------------------------------------------------- 1 | #nullable enable 2 | 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Diagnostics.CodeAnalysis; 6 | using System.IO; 7 | using System.Linq; 8 | using System.Text; 9 | using UnityVisualStudioSolutionGenerator.Configuration; 10 | 11 | namespace UnityVisualStudioSolutionGenerator 12 | { 13 | /// 14 | /// Helper to generate a ReSharper settings file (.csproj.DotSettings) for each .csproj file. It contains value so that the namespace of code is 15 | /// expected to start at the project root and all sup directories should be included in the namespace. 16 | /// 17 | internal static class ReSharperProjectSettingsGenerator 18 | { 19 | /// 20 | /// Generate a ReSharper settings file (.csproj.DotSettings) for a .csproj file . It contains value so that the 21 | /// namespace of code is expected to start at the project root and all sup directories should be included in the namespace. 22 | /// 23 | /// The absolute path of the .csproj file to generate a matching ReSharper settings file. 24 | [SuppressMessage("Globalization", "CA1308:Normalize strings to uppercase", Justification = "We don't use the string to compare.")] 25 | internal static void WriteSettingsIfMissing(string projectFilePath) 26 | { 27 | if (!GeneratorSettings.GenerateReSharperProjectSettings) 28 | { 29 | return; 30 | } 31 | 32 | var settingsFilePath = $"{projectFilePath}.DotSettings"; 33 | var projectDirectory = Path.GetDirectoryName(projectFilePath) ?? 34 | throw new InvalidOperationException($"Failed to get directory name of path '{projectFilePath}'"); 35 | if (!Path.IsPathFullyQualified(projectDirectory)) 36 | { 37 | throw new InvalidOperationException($"'{projectDirectory}' is not absolute, got file path: '{projectFilePath}'."); 38 | } 39 | 40 | var projectSupDirectoriesEncoded = GetSupDirectoriesWithSourceCode(projectDirectory) 41 | .Select( 42 | directory => Path.GetRelativePath(projectDirectory, directory) 43 | .ToLowerInvariant() 44 | .Replace('/', '\\') 45 | .Replace("\\", "_005C", StringComparison.Ordinal) 46 | .Replace(".", "_002E", StringComparison.Ordinal)) 47 | .ToList(); 48 | if (File.Exists(settingsFilePath)) 49 | { 50 | var currentContent = File.ReadAllText(settingsFilePath); 51 | if (projectSupDirectoriesEncoded.TrueForAll( 52 | relativePathEncoded => currentContent.Contains(relativePathEncoded, StringComparison.Ordinal))) 53 | { 54 | return; 55 | } 56 | } 57 | 58 | using var writer = new StreamWriter(settingsFilePath, false, Encoding.UTF8); 59 | writer.WriteLine( 60 | ""); 61 | foreach (var relativePathEncoded in projectSupDirectoriesEncoded) 62 | { 63 | writer.WriteLine( 64 | $" False"); 65 | } 66 | 67 | writer.WriteLine(""); 68 | LogHelper.LogVerbose($"Generated ReSharper project settings file {Path.GetFileName(settingsFilePath)}"); 69 | } 70 | 71 | private static IEnumerable GetSupDirectoriesWithSourceCode(string directoryPath) 72 | { 73 | foreach (var subDirectory in Directory.EnumerateDirectories(directoryPath)) 74 | { 75 | if (Directory.EnumerateFiles(subDirectory, "*.asmdef", SearchOption.TopDirectoryOnly).Any() || 76 | Directory.EnumerateFiles(subDirectory, "*.asmref", SearchOption.TopDirectoryOnly).Any() || 77 | !Directory.EnumerateFiles(subDirectory, "*.cs", SearchOption.AllDirectories).Any()) 78 | { 79 | // exclude sub-projects and only keep if any sub-directory has source code 80 | continue; 81 | } 82 | 83 | yield return subDirectory; 84 | 85 | foreach (var subSubDirectory in GetSupDirectoriesWithSourceCode(subDirectory)) 86 | { 87 | yield return subSubDirectory; 88 | } 89 | } 90 | } 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/Assets/Editor/ReSharperProjectSettingsGenerator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ea00a54f559590143a4cad395f9a086e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/Assets/Editor/SolutionFile.cs: -------------------------------------------------------------------------------- 1 | #nullable enable 2 | 3 | using System; 4 | using System.IO; 5 | using UnityEngine; 6 | 7 | namespace UnityVisualStudioSolutionGenerator 8 | { 9 | /// 10 | /// Represents a '.sln' file. 11 | /// 12 | internal sealed class SolutionFile 13 | { 14 | static SolutionFile() 15 | { 16 | var solutionDirectoryPath = Path.GetFullPath(Path.Combine(Application.dataPath, "..")); 17 | var solutionFilePath = $"{Path.Combine(solutionDirectoryPath, Path.GetFileName(solutionDirectoryPath))}.sln"; 18 | CurrentProjectSolution = new SolutionFile(solutionDirectoryPath, solutionFilePath); 19 | } 20 | 21 | /// 22 | /// Initializes a new instance of the class. 23 | /// 24 | /// The directory that contains the .sln file. 25 | /// The full path of the .sln file. 26 | public SolutionFile(string solutionDirectoryPath, string solutionFilePath) 27 | { 28 | SolutionDirectoryPath = solutionDirectoryPath ?? throw new ArgumentNullException(nameof(solutionDirectoryPath)); 29 | SolutionFilePath = solutionFilePath ?? throw new ArgumentNullException(nameof(solutionFilePath)); 30 | } 31 | 32 | /// 33 | /// Gets the information about the '.sln' file of the current Unity Project. 34 | /// 35 | public static SolutionFile CurrentProjectSolution { get; } 36 | 37 | /// 38 | /// Gets the absolute path to the directory containing the '.sln' file. 39 | /// 40 | public string SolutionDirectoryPath { get; } 41 | 42 | /// 43 | /// Gets the absolute path to the '.sln' file. 44 | /// 45 | public string SolutionFilePath { get; } 46 | 47 | /// 48 | public override string ToString() 49 | { 50 | return Path.GetFileName(SolutionFilePath); 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/Assets/Editor/SolutionFile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 58e7425caf9de6249bff359872032780 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/Assets/Editor/SolutionFileParser.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1f044646d87ff9f4f8c0f4be673373c5 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/Assets/Editor/SolutionFileWriter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 31d04765e5b5e8d4b866b1d0413b3cf4 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/Assets/Editor/SourceCodeFileWatcher.cs: -------------------------------------------------------------------------------- 1 | #nullable enable 2 | 3 | using System; 4 | using System.Diagnostics.CodeAnalysis; 5 | using System.IO; 6 | using System.Threading.Tasks; 7 | using UnityVisualStudioSolutionGenerator.Configuration; 8 | 9 | namespace UnityVisualStudioSolutionGenerator 10 | { 11 | /// 12 | /// File system change watcher that watches all source code file changes inside the project. 13 | /// 14 | internal sealed class SourceCodeFileWatcher : IDisposable 15 | { 16 | private readonly FileSystemWatcher watcher; 17 | 18 | /// 19 | /// Initializes a new instance of the class. 20 | /// 21 | /// 22 | /// The root directory of all project files. Is used as a starting point for the watcher, so only files inside this folder or 23 | /// any sup-folder are watched. 24 | /// 25 | public SourceCodeFileWatcher(string folderPath) 26 | { 27 | watcher = new FileSystemWatcher(folderPath, "*.cs") { IncludeSubdirectories = true, NotifyFilter = NotifyFilters.FileName }; 28 | watcher.Created += OnCreated; 29 | watcher.Deleted += OnDeleted; 30 | watcher.EnableRaisingEvents = true; 31 | LogHelper.LogVerbose($"Created a new {nameof(SourceCodeFileWatcher)} for the directory: '{folderPath}'."); 32 | } 33 | 34 | /// 35 | public void Dispose() 36 | { 37 | watcher.Dispose(); 38 | } 39 | 40 | private static void OnDeleted(object sender, FileSystemEventArgs e) 41 | { 42 | LogHelper.LogVerbose($"Received {nameof(OnDeleted)} event for file: '{e.FullPath}'."); 43 | if (e.FullPath.EndsWith(".meta", StringComparison.OrdinalIgnoreCase) || !GeneratorSettings.TrackMetaDeletion) 44 | { 45 | return; 46 | } 47 | 48 | try 49 | { 50 | File.Delete($"{e.FullPath}.meta"); 51 | } 52 | catch (Exception exception) when (exception is FileNotFoundException or DirectoryNotFoundException) 53 | { 54 | LogHelper.LogVerbose($".meta file corresponding to: '{e.FullPath}' already deleted. Error:\n{exception}"); 55 | } 56 | catch (Exception exception) when (exception is AccessViolationException or IOException) 57 | { 58 | LogHelper.LogWarning($"Failed to delete .meta corresponding to: '{e.FullPath}'. Error:\n{exception}"); 59 | } 60 | } 61 | 62 | private static void OnCreated(object sender, FileSystemEventArgs e) 63 | { 64 | LogHelper.LogVerbose($"Received {nameof(OnCreated)} event for file: '{e.FullPath}'."); 65 | if (e.FullPath.EndsWith(".cs", StringComparison.OrdinalIgnoreCase) && GeneratorSettings.EnableNullableReferenceTypes) 66 | { 67 | AddNullableToFileDelayed(e.FullPath); 68 | } 69 | } 70 | 71 | [SuppressMessage( 72 | "Major Bug", 73 | "S3168:\"async\" methods should not return \"void\"", 74 | Justification = "We can't await because it is called by a event.")] 75 | [SuppressMessage("Usage", "VSTHRD100:Avoid async void methods", Justification = "Exceptions are handled in 'AddNullableToFile'.")] 76 | private static async void AddNullableToFileDelayed(string filePath) 77 | { 78 | // we need to delay the task because Unity else produces warnings, about assets being modified while thy are imported, when we create a '.cs' file inside Unity Editor. 79 | await Task.Run( 80 | async () => 81 | { 82 | await Task.Delay(100).ConfigureAwait(true); 83 | SourceCodeFilesHandler.AddNullableToFile(filePath); 84 | }) 85 | .ConfigureAwait(true); 86 | } 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/Assets/Editor/SourceCodeFileWatcher.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0bb6a9d41e63c2d439af0bbff6e2137e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/Assets/Editor/SourceCodeFilesHandler.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: df82f43157e225345b69cf589b4963f0 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/Assets/Editor/UnityVisualStudioSolutionGenerator.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "UnityVisualStudioSolutionGenerator", 3 | "rootNamespace": "UnityVisualStudioSolutionGenerator", 4 | "references": [ 5 | "GUID:b93f844d45cfcc44fa2b0eed5c9ec6bb", 6 | "GUID:49818357e697641afb75d2f8acaf1861" 7 | ], 8 | "includePlatforms": [ 9 | "Editor" 10 | ], 11 | "excludePlatforms": [], 12 | "allowUnsafeCode": false, 13 | "overrideReferences": false, 14 | "precompiledReferences": [], 15 | "autoReferenced": false, 16 | "defineConstraints": [], 17 | "versionDefines": [], 18 | "noEngineReferences": false 19 | } -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/Assets/Editor/UnityVisualStudioSolutionGenerator.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d720a8ac8e436924e8496a677d0c4214 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/Assets/Editor/UnityVisualStudioSolutionGenerator.csproj.DotSettings: -------------------------------------------------------------------------------- 1 |  2 | False 3 | 4 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/Assets/Editor/UnityVisualStudioSolutionGenerator.csproj.DotSettings.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 95987b8619327664b94187da1c8aedf1 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/Assets/Editor/VisualStudioAssetPostprocessor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d3d29eba9416aeb4ca800dbc7bb073f3 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/Assets/LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 JoC0de 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/Assets/LICENSE.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 94890c1544ecfa74f8cc187758d59f24 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/Assets/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "com.github-joc0de.visual-studio-solution-generator", 3 | "displayName": "Unity Visual Studio Solution Generator", 4 | "version": "1.1.0", 5 | "description": "Visual Studio Solution Generator with improved developer productivity especially when working with multi-package unity projects", 6 | "unity": "2021.2", 7 | "keywords": [ 8 | "editor-extension", 9 | "visual-studio" 10 | ], 11 | "author": { 12 | "name": "JoC0de" 13 | }, 14 | "dependencies": { 15 | "com.unity.ide.visualstudio": "2.0.23", 16 | "com.unity.settings-manager": "2.1.0" 17 | }, 18 | "license": "MIT", 19 | "licensesUrl": "https://github.com/JoC0de/UnityVisualStudioSolutionGenerator/blob/main/LICENSE", 20 | "changelogUrl": "https://github.com/JoC0de/UnityVisualStudioSolutionGenerator/releases", 21 | "documentationUrl": "https://github.com/JoC0de/UnityVisualStudioSolutionGenerator/" 22 | } 23 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/Assets/package.json.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c45a2f2e058b3c8488aea8522aa6c43f 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.ide.visualstudio": "2.0.23", 4 | "com.unity.settings-manager": "2.1.0", 5 | "com.unity.modules.accessibility": "1.0.0" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/Packages/packages-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.ext.nunit": { 4 | "version": "2.0.5", 5 | "depth": 2, 6 | "source": "registry", 7 | "dependencies": {}, 8 | "url": "https://packages.unity.com" 9 | }, 10 | "com.unity.ide.visualstudio": { 11 | "version": "2.0.22", 12 | "depth": 0, 13 | "source": "registry", 14 | "dependencies": { 15 | "com.unity.test-framework": "1.1.9" 16 | }, 17 | "url": "https://packages.unity.com" 18 | }, 19 | "com.unity.settings-manager": { 20 | "version": "2.0.1", 21 | "depth": 0, 22 | "source": "registry", 23 | "dependencies": {}, 24 | "url": "https://packages.unity.com" 25 | }, 26 | "com.unity.test-framework": { 27 | "version": "1.3.9", 28 | "depth": 1, 29 | "source": "registry", 30 | "dependencies": { 31 | "com.unity.ext.nunit": "2.0.3", 32 | "com.unity.modules.imgui": "1.0.0", 33 | "com.unity.modules.jsonserialize": "1.0.0" 34 | }, 35 | "url": "https://packages.unity.com" 36 | }, 37 | "com.unity.modules.accessibility": { 38 | "version": "1.0.0", 39 | "depth": 0, 40 | "source": "builtin", 41 | "dependencies": {} 42 | }, 43 | "com.unity.modules.imgui": { 44 | "version": "1.0.0", 45 | "depth": 2, 46 | "source": "builtin", 47 | "dependencies": {} 48 | }, 49 | "com.unity.modules.jsonserialize": { 50 | "version": "1.0.0", 51 | "depth": 2, 52 | "source": "builtin", 53 | "dependencies": {} 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!11 &1 4 | AudioManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Volume: 1 8 | Rolloff Scale: 1 9 | Doppler Factor: 1 10 | Default Speaker Mode: 2 11 | m_SampleRate: 0 12 | m_DSPBufferSize: 1024 13 | m_VirtualVoiceCount: 512 14 | m_RealVoiceCount: 32 15 | m_SpatializerPlugin: 16 | m_AmbisonicDecoderPlugin: 17 | m_DisableAudio: 0 18 | m_VirtualizeEffects: 1 19 | m_RequestedDSPBufferSize: 1024 20 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!236 &1 4 | ClusterInputManager: 5 | m_ObjectHideFlags: 0 6 | m_Inputs: [] 7 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!55 &1 4 | PhysicsManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 11 7 | m_Gravity: {x: 0, y: -9.81, z: 0} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_BounceThreshold: 2 10 | m_SleepThreshold: 0.005 11 | m_DefaultContactOffset: 0.01 12 | m_DefaultSolverIterations: 6 13 | m_DefaultSolverVelocityIterations: 1 14 | m_QueriesHitBackfaces: 0 15 | m_QueriesHitTriggers: 1 16 | m_EnableAdaptiveForce: 0 17 | m_ClothInterCollisionDistance: 0 18 | m_ClothInterCollisionStiffness: 0 19 | m_ContactsGeneration: 1 20 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 21 | m_AutoSimulation: 1 22 | m_AutoSyncTransforms: 0 23 | m_ReuseCollisionCallbacks: 1 24 | m_ClothInterCollisionSettingsToggle: 0 25 | m_ContactPairsMode: 0 26 | m_BroadphaseType: 0 27 | m_WorldBounds: 28 | m_Center: {x: 0, y: 0, z: 0} 29 | m_Extent: {x: 250, y: 250, z: 250} 30 | m_WorldSubdivisions: 8 31 | m_FrictionType: 0 32 | m_EnableEnhancedDeterminism: 0 33 | m_EnableUnifiedHeightmaps: 1 34 | m_DefaultMaxAngluarSpeed: 7 35 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1045 &1 4 | EditorBuildSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Scenes: [] 8 | m_configObjects: {} 9 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!159 &1 4 | EditorSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 11 7 | m_ExternalVersionControlSupport: Visible Meta Files 8 | m_SerializationMode: 2 9 | m_LineEndingsForNewScripts: 0 10 | m_DefaultBehaviorMode: 0 11 | m_PrefabRegularEnvironment: {fileID: 0} 12 | m_PrefabUIEnvironment: {fileID: 0} 13 | m_SpritePackerMode: 0 14 | m_SpritePackerPaddingPower: 1 15 | m_EtcTextureCompressorBehavior: 1 16 | m_EtcTextureFastCompressor: 1 17 | m_EtcTextureNormalCompressor: 2 18 | m_EtcTextureBestCompressor: 4 19 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;rsp;asmref 20 | m_ProjectGenerationRootNamespace: 21 | m_CollabEditorSettings: 22 | inProgressEnabled: 1 23 | m_EnableTextureStreamingInEditMode: 1 24 | m_EnableTextureStreamingInPlayMode: 1 25 | m_AsyncShaderCompilation: 1 26 | m_EnterPlayModeOptionsEnabled: 0 27 | m_EnterPlayModeOptions: 3 28 | m_ShowLightmapResolutionOverlay: 1 29 | m_UseLegacyProbeSampleCount: 0 30 | m_SerializeInlineMappingsOnOneLine: 1 31 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!30 &1 4 | GraphicsSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 13 7 | m_Deferred: 8 | m_Mode: 1 9 | m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} 10 | m_DeferredReflections: 11 | m_Mode: 1 12 | m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} 13 | m_ScreenSpaceShadows: 14 | m_Mode: 1 15 | m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} 16 | m_LegacyDeferred: 17 | m_Mode: 1 18 | m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} 19 | m_DepthNormals: 20 | m_Mode: 1 21 | m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} 22 | m_MotionVectors: 23 | m_Mode: 1 24 | m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} 25 | m_LightHalo: 26 | m_Mode: 1 27 | m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} 28 | m_LensFlare: 29 | m_Mode: 1 30 | m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} 31 | m_AlwaysIncludedShaders: 32 | - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 33 | - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} 34 | - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} 35 | - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} 36 | - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} 37 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 38 | m_PreloadedShaders: [] 39 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, 40 | type: 0} 41 | m_CustomRenderPipeline: {fileID: 0} 42 | m_TransparencySortMode: 0 43 | m_TransparencySortAxis: {x: 0, y: 0, z: 1} 44 | m_DefaultRenderingPath: 1 45 | m_DefaultMobileRenderingPath: 1 46 | m_TierSettings: [] 47 | m_LightmapStripping: 0 48 | m_FogStripping: 0 49 | m_InstancingStripping: 0 50 | m_LightmapKeepPlain: 1 51 | m_LightmapKeepDirCombined: 1 52 | m_LightmapKeepDynamicPlain: 1 53 | m_LightmapKeepDynamicDirCombined: 1 54 | m_LightmapKeepShadowMask: 1 55 | m_LightmapKeepSubtractive: 1 56 | m_FogKeepLinear: 1 57 | m_FogKeepExp: 1 58 | m_FogKeepExp2: 1 59 | m_AlbedoSwatchInfos: [] 60 | m_LightsUseLinearIntensity: 0 61 | m_LightsUseColorTemperature: 0 62 | m_LogWhenShaderIsCompiled: 0 63 | m_AllowEnlightenSupportForUpgradedProject: 0 64 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/ProjectSettings/MemorySettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!387306366 &1 4 | MemorySettings: 5 | m_ObjectHideFlags: 0 6 | m_EditorMemorySettings: 7 | m_MainAllocatorBlockSize: -1 8 | m_ThreadAllocatorBlockSize: -1 9 | m_MainGfxBlockSize: -1 10 | m_ThreadGfxBlockSize: -1 11 | m_CacheBlockSize: -1 12 | m_TypetreeBlockSize: -1 13 | m_ProfilerBlockSize: -1 14 | m_ProfilerEditorBlockSize: -1 15 | m_BucketAllocatorGranularity: -1 16 | m_BucketAllocatorBucketsCount: -1 17 | m_BucketAllocatorBlockSize: -1 18 | m_BucketAllocatorBlockCount: -1 19 | m_ProfilerBucketAllocatorGranularity: -1 20 | m_ProfilerBucketAllocatorBucketsCount: -1 21 | m_ProfilerBucketAllocatorBlockSize: -1 22 | m_ProfilerBucketAllocatorBlockCount: -1 23 | m_TempAllocatorSizeMain: -1 24 | m_JobTempAllocatorBlockSize: -1 25 | m_BackgroundJobTempAllocatorBlockSize: -1 26 | m_JobTempAllocatorReducedBlockSize: -1 27 | m_TempAllocatorSizeGIBakingWorker: -1 28 | m_TempAllocatorSizeNavMeshWorker: -1 29 | m_TempAllocatorSizeAudioWorker: -1 30 | m_TempAllocatorSizeCloudWorker: -1 31 | m_TempAllocatorSizeGfx: -1 32 | m_TempAllocatorSizeJobWorker: -1 33 | m_TempAllocatorSizeBackgroundWorker: -1 34 | m_TempAllocatorSizePreloadManager: -1 35 | m_PlatformMemorySettings: {} 36 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/ProjectSettings/MultiplayerManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!655991488 &1 4 | MultiplayerManager: 5 | m_ObjectHideFlags: 0 6 | m_EnableMultiplayerRoles: 0 7 | m_ActiveMultiplayerRole: 0 8 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!126 &1 4 | NavMeshProjectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | areas: 8 | - name: Walkable 9 | cost: 1 10 | - name: Not Walkable 11 | cost: 1 12 | - name: Jump 13 | cost: 2 14 | - name: 15 | cost: 1 16 | - name: 17 | cost: 1 18 | - name: 19 | cost: 1 20 | - name: 21 | cost: 1 22 | - name: 23 | cost: 1 24 | - name: 25 | cost: 1 26 | - name: 27 | cost: 1 28 | - name: 29 | cost: 1 30 | - name: 31 | cost: 1 32 | - name: 33 | cost: 1 34 | - name: 35 | cost: 1 36 | - name: 37 | cost: 1 38 | - name: 39 | cost: 1 40 | - name: 41 | cost: 1 42 | - name: 43 | cost: 1 44 | - name: 45 | cost: 1 46 | - name: 47 | cost: 1 48 | - name: 49 | cost: 1 50 | - name: 51 | cost: 1 52 | - name: 53 | cost: 1 54 | - name: 55 | cost: 1 56 | - name: 57 | cost: 1 58 | - name: 59 | cost: 1 60 | - name: 61 | cost: 1 62 | - name: 63 | cost: 1 64 | - name: 65 | cost: 1 66 | - name: 67 | cost: 1 68 | - name: 69 | cost: 1 70 | - name: 71 | cost: 1 72 | m_LastAgentTypeID: -887442657 73 | m_Settings: 74 | - serializedVersion: 2 75 | agentTypeID: 0 76 | agentRadius: 0.5 77 | agentHeight: 2 78 | agentSlope: 45 79 | agentClimb: 0.75 80 | ledgeDropHeight: 0 81 | maxJumpAcrossDistance: 0 82 | minRegionArea: 2 83 | manualCellSize: 0 84 | cellSize: 0.16666667 85 | manualTileSize: 0 86 | tileSize: 256 87 | accuratePlacement: 0 88 | debug: 89 | m_Flags: 0 90 | m_SettingNames: 91 | - Humanoid 92 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/ProjectSettings/PackageManagerSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &1 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 61 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 13964, guid: 0000000000000000e000000000000000, type: 0} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | m_EnablePreReleasePackages: 0 16 | m_AdvancedSettingsExpanded: 1 17 | m_ScopedRegistriesSettingsExpanded: 1 18 | m_SeeAllPackageVersions: 0 19 | m_DismissPreviewPackagesInUse: 0 20 | oneTimeWarningShown: 0 21 | oneTimeDeprecatedPopUpShown: 0 22 | m_Registries: 23 | - m_Id: main 24 | m_Name: 25 | m_Url: https://packages.unity.com 26 | m_Scopes: [] 27 | m_IsDefault: 1 28 | m_Capabilities: 7 29 | m_ConfigSource: 0 30 | m_UserSelectedRegistryName: 31 | m_UserAddingNewScopedRegistry: 0 32 | m_RegistryInfoDraft: 33 | m_Modified: 0 34 | m_ErrorMessage: 35 | m_UserModificationsInstanceId: -840 36 | m_OriginalInstanceId: -844 37 | m_LoadAssets: 0 38 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/ProjectSettings/Packages/com.github-joc0de.visual-studio-solution-generator/Settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "m_Dictionary": { 3 | "m_DictionaryValues": [ 4 | { 5 | "type": "System.Collections.Generic.List`1[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", 6 | "key": "legacy-style.ExcludedAnalyzers", 7 | "value": "{\"m_Value\":[\"*/Unity.SourceGenerators.dll\"]}" 8 | }, 9 | { 10 | "type": "System.Collections.Generic.List`1[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", 11 | "key": "sdk-style.SdkExcludedFilePatterns", 12 | "value": "{\"m_Value\":[\"**/*.meta\",\"**/*.asset\",\"**/*.prefab\"]}" 13 | }, 14 | { 15 | "type": "System.Collections.Generic.List`1[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", 16 | "key": "general.AdditionalIncludedSolutions", 17 | "value": "{\"m_Value\":[]}" 18 | }, 19 | { 20 | "type": "System.Collections.Generic.List`1[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", 21 | "key": "general.AdditionalIncludedProjectFiles", 22 | "value": "{\"m_Value\":[]}" 23 | }, 24 | { 25 | "type": "System.Collections.Generic.List`1[[UnityVisualStudioSolutionGenerator.Configuration.PropertyGroupSetting, UnityVisualStudioSolutionGenerator, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", 26 | "key": "sdk-style.SdkAdditionalProperties", 27 | "value": "{\"m_Value\":[{\"k__BackingField\":\"EnableNETAnalyzers\",\"k__BackingField\":\"true\"},{\"k__BackingField\":\"AnalysisLevel\",\"k__BackingField\":\"latest\"},{\"k__BackingField\":\"AnalysisMode\",\"k__BackingField\":\"AllEnabledByDefault\"}]}" 28 | }, 29 | { 30 | "type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", 31 | "key": "general.IsEnabled", 32 | "value": "{\"m_Value\":true}" 33 | }, 34 | { 35 | "type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", 36 | "key": "general.GenerateSdkStyleProjects", 37 | "value": "{\"m_Value\":true}" 38 | }, 39 | { 40 | "type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", 41 | "key": "general.LogVerbose", 42 | "value": "{\"m_Value\":true}" 43 | }, 44 | { 45 | "type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", 46 | "key": "general.TrackMetaDeletion", 47 | "value": "{\"m_Value\":false}" 48 | }, 49 | { 50 | "type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", 51 | "key": "general.EnableNullableReferenceTypes", 52 | "value": "{\"m_Value\":false}" 53 | }, 54 | { 55 | "type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", 56 | "key": "general.GenerateReSharperProjectSettings", 57 | "value": "{\"m_Value\":false}" 58 | } 59 | ] 60 | } 61 | } -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/ProjectSettings/Packages/com.unity.testtools.codecoverage/Settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "m_Dictionary": { 3 | "m_DictionaryValues": [] 4 | } 5 | } -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!19 &1 4 | Physics2DSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 4 7 | m_Gravity: {x: 0, y: -9.81} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_VelocityIterations: 8 10 | m_PositionIterations: 3 11 | m_VelocityThreshold: 1 12 | m_MaxLinearCorrection: 0.2 13 | m_MaxAngularCorrection: 8 14 | m_MaxTranslationSpeed: 100 15 | m_MaxRotationSpeed: 360 16 | m_BaumgarteScale: 0.2 17 | m_BaumgarteTimeOfImpactScale: 0.75 18 | m_TimeToSleep: 0.5 19 | m_LinearSleepTolerance: 0.01 20 | m_AngularSleepTolerance: 2 21 | m_DefaultContactOffset: 0.01 22 | m_JobOptions: 23 | serializedVersion: 2 24 | useMultithreading: 0 25 | useConsistencySorting: 0 26 | m_InterpolationPosesPerJob: 100 27 | m_NewContactsPerJob: 30 28 | m_CollideContactsPerJob: 100 29 | m_ClearFlagsPerJob: 200 30 | m_ClearBodyForcesPerJob: 200 31 | m_SyncDiscreteFixturesPerJob: 50 32 | m_SyncContinuousFixturesPerJob: 50 33 | m_FindNearestContactsPerJob: 100 34 | m_UpdateTriggerContactsPerJob: 100 35 | m_IslandSolverCostThreshold: 100 36 | m_IslandSolverBodyCostScale: 1 37 | m_IslandSolverContactCostScale: 10 38 | m_IslandSolverJointCostScale: 10 39 | m_IslandSolverBodiesPerJob: 50 40 | m_IslandSolverContactsPerJob: 50 41 | m_AutoSimulation: 1 42 | m_QueriesHitTriggers: 1 43 | m_QueriesStartInColliders: 1 44 | m_CallbacksOnDisable: 1 45 | m_ReuseCollisionCallbacks: 1 46 | m_AutoSyncTransforms: 0 47 | m_AlwaysShowColliders: 0 48 | m_ShowColliderSleep: 1 49 | m_ShowColliderContacts: 0 50 | m_ShowColliderAABB: 0 51 | m_ContactArrowScale: 0.2 52 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} 53 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} 54 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} 55 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} 56 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 57 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/ProjectSettings/PresetManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1386491679 &1 4 | PresetManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_DefaultPresets: {} 8 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2023.2.6f1 2 | m_EditorVersionWithRevision: 2023.2.6f1 (57daeefc879b) 3 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/ProjectSettings/ShaderGraphSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &1 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 61 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: de02f9e1d18f588468e474319d09a723, type: 3} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | customInterpolatorErrorThreshold: 32 16 | customInterpolatorWarningThreshold: 16 17 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!78 &1 4 | TagManager: 5 | serializedVersion: 2 6 | tags: [] 7 | layers: 8 | - Default 9 | - TransparentFX 10 | - Ignore Raycast 11 | - 12 | - Water 13 | - UI 14 | - 15 | - 16 | - 17 | - 18 | - 19 | - 20 | - 21 | - 22 | - 23 | - 24 | - 25 | - 26 | - 27 | - 28 | - 29 | - 30 | - 31 | - 32 | - 33 | - 34 | - 35 | - 36 | - 37 | - 38 | - 39 | - 40 | m_SortingLayers: 41 | - name: Default 42 | uniqueID: 0 43 | locked: 0 44 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!5 &1 4 | TimeManager: 5 | m_ObjectHideFlags: 0 6 | Fixed Timestep: 0.02 7 | Maximum Allowed Timestep: 0.33333334 8 | m_TimeScale: 1 9 | Maximum Particle Timestep: 0.03 10 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!310 &1 4 | UnityConnectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 1 7 | m_Enabled: 0 8 | m_TestMode: 0 9 | m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events 10 | m_EventUrl: https://cdp.cloud.unity3d.com/v1/events 11 | m_ConfigUrl: https://config.uca.cloud.unity3d.com 12 | m_DashboardUrl: https://dashboard.unity3d.com 13 | m_TestInitMode: 0 14 | CrashReportingSettings: 15 | m_EventUrl: https://perf-events.cloud.unity3d.com 16 | m_Enabled: 0 17 | m_LogBufferSize: 10 18 | m_CaptureEditorExceptions: 1 19 | UnityPurchasingSettings: 20 | m_Enabled: 0 21 | m_TestMode: 0 22 | UnityAnalyticsSettings: 23 | m_Enabled: 0 24 | m_TestMode: 0 25 | m_InitializeOnStartup: 1 26 | m_PackageRequiringCoreStatsPresent: 0 27 | UnityAdsSettings: 28 | m_Enabled: 0 29 | m_InitializeOnStartup: 1 30 | m_TestMode: 0 31 | m_IosGameId: 32 | m_AndroidGameId: 33 | m_GameIds: {} 34 | m_GameId: 35 | PerformanceReportingSettings: 36 | m_Enabled: 0 37 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/ProjectSettings/VFXManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!937362698 &1 4 | VFXManager: 5 | m_ObjectHideFlags: 0 6 | m_IndirectShader: {fileID: 0} 7 | m_CopyBufferShader: {fileID: 0} 8 | m_SortShader: {fileID: 0} 9 | m_StripUpdateShader: {fileID: 0} 10 | m_RenderPipeSettingsPath: 11 | m_FixedTimeStep: 0.016666668 12 | m_MaxDeltaTime: 0.05 13 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/ProjectSettings/VersionControlSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!890905787 &1 4 | VersionControlSettings: 5 | m_ObjectHideFlags: 0 6 | m_Mode: Visible Meta Files 7 | m_CollabEditorSettings: 8 | inProgressEnabled: 1 9 | -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/ProjectSettings/XRSettings.asset: -------------------------------------------------------------------------------- 1 | { 2 | "m_SettingKeys": [ 3 | "VR Device Disabled", 4 | "VR Device User Alert" 5 | ], 6 | "m_SettingValues": [ 7 | "False", 8 | "False" 9 | ] 10 | } -------------------------------------------------------------------------------- /src/UnityVisualStudioSolutionGenerator/UnityVisualStudioSolutionGenerator.sln.DotSettings: -------------------------------------------------------------------------------- 1 |  2 | ..\..\GlobalShared.DotSettings 3 | True 4 | True 5 | 1 6 | 7 | -------------------------------------------------------------------------------- /tools/format-all.ps1: -------------------------------------------------------------------------------- 1 | $ErrorActionPreference = 'Stop' 2 | 3 | $repositoryRoot = Resolve-Path $PSScriptRoot\.. 4 | $currentLocation = Get-Location 5 | 6 | try { 7 | Set-Location $repositoryRoot 8 | . pre-commit run --verbose --all-files --hook-stage manual 9 | } 10 | finally { 11 | Set-Location $currentLocation 12 | } 13 | -------------------------------------------------------------------------------- /tools/format-staged.ps1: -------------------------------------------------------------------------------- 1 | $ErrorActionPreference = 'Stop' 2 | 3 | $repositoryRoot = Resolve-Path $PSScriptRoot\.. 4 | $currentLocation = Get-Location 5 | 6 | try { 7 | Set-Location $repositoryRoot 8 | . pre-commit run --verbose 9 | } 10 | finally { 11 | Set-Location $currentLocation 12 | } 13 | -------------------------------------------------------------------------------- /tools/remove-byte-order-marker.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import os 3 | import codecs 4 | 5 | scriptLocation = os.path.dirname(os.path.realpath(sys.argv[0])) 6 | repositoryRoot = os.path.dirname(scriptLocation) 7 | 8 | retv = 0 9 | 10 | for changedFile in sys.argv[1:]: 11 | # file pathes from command line args are relative to the repository root 12 | changedFile = os.path.realpath(os.path.join(repositoryRoot, changedFile)) 13 | 14 | BUFSIZE = 4096 15 | with open(changedFile, "r+b") as fp: 16 | bytesToRemove = 0 17 | chunk = fp.read(5) 18 | # utf8 byte order marker EF BB BF 19 | if chunk.startswith(codecs.BOM_UTF8): 20 | bytesToRemove = 3 21 | print(f"{changedFile}: Has a utf-8 byte-order marker") 22 | # Python automatically detects endianess if utf-16 bom is present 23 | # write endianess generally determined by endianess of CPU 24 | elif chunk.startswith(b"\xfe\xff") or chunk.startswith(b"\xff\xfe"): 25 | bytesToRemove = 2 26 | print(f"{changedFile}: Has a utf-16 byte-order marker") 27 | 28 | elif chunk.startswith(b"\xfe\xff\x00\x00") or chunk.startswith(b"\x00\x00\xff\xfe"): 29 | bytesToRemove = 5 30 | print(f"{changedFile}: Has a utf-32 byte-order marker") 31 | 32 | if bytesToRemove > 0: 33 | retv = 1 34 | i = 0 35 | chunk = chunk[bytesToRemove:] 36 | while chunk: 37 | fp.seek(i) 38 | fp.write(chunk) 39 | i += len(chunk) 40 | fp.seek(bytesToRemove, os.SEEK_CUR) 41 | chunk = fp.read(BUFSIZE) 42 | fp.seek(-bytesToRemove, os.SEEK_CUR) 43 | fp.truncate() 44 | 45 | exit(retv) 46 | -------------------------------------------------------------------------------- /tools/resharper-cleanupcode.py: -------------------------------------------------------------------------------- 1 | import os 2 | import subprocess 3 | import sys 4 | import time 5 | 6 | scriptLocation = os.path.dirname(os.path.realpath(sys.argv[0])) 7 | repositoryRoot = os.path.dirname(scriptLocation) 8 | 9 | solutionFiles = ["src/UnityVisualStudioSolutionGenerator.Tests/UnityVisualStudioSolutionGenerator.Tests.sln"] 10 | toolsRoot = repositoryRoot 11 | 12 | subprocess.run(["dotnet", "tool", "restore"], cwd = toolsRoot, check = True) 13 | startTime = time.time() 14 | 15 | try: 16 | for solutionFile in solutionFiles: 17 | relativeSolutionFile = solutionFile 18 | solutionFile = os.path.realpath(os.path.join(repositoryRoot, solutionFile)) 19 | if not os.path.isfile(solutionFile): 20 | sys.exit(f"can't find the solution file: {solutionFile}") 21 | solutionDir = os.path.dirname(solutionFile) 22 | if len(sys.argv) <= 1: 23 | cleanupArg = "" 24 | else: 25 | cleanupArg = "--include=" 26 | for changedFile in sys.argv[1:]: 27 | # file path from command line args are relative to the repository root but we need them relative to the solution folder 28 | absoluteChangedFile = os.path.realpath(os.path.join(repositoryRoot, changedFile)) 29 | changedFile = os.path.relpath(absoluteChangedFile, solutionDir) 30 | if changedFile.startswith(".."): 31 | # file path can't be outside solution-directory "../" we fall-back to absolute file path 32 | changedFile = absoluteChangedFile 33 | cleanupArg += ";" + changedFile 34 | if cleanupArg.endswith('='): 35 | # no changed file owned by solution so skip 36 | continue 37 | buildStartTime = time.time() 38 | subprocess.run(["dotnet", "build", "-property:RunAnalyzers=false", "-clp:ErrorsOnly", "--no-restore", solutionFile], cwd = repositoryRoot, check = True) 39 | cleanupStartTime = time.time() 40 | print(f"Building solution '{relativeSolutionFile}' took: {time.strftime('%H:%M:%S', time.gmtime(cleanupStartTime - buildStartTime))}") 41 | extensionsArg = "--eXtensions=JetBrains.Unity" 42 | profileArg = "" 43 | subprocess.run(["dotnet", "jb", "cleanupcode", "--no-build", extensionsArg, profileArg, cleanupArg, solutionFile], cwd = toolsRoot, check = True) 44 | print(f"Cleanup of solution '{relativeSolutionFile}' took: {time.strftime('%H:%M:%S', time.gmtime(time.time() - cleanupStartTime))}") 45 | 46 | finally: 47 | print(f"Total resharper cleanup took: {time.strftime('%H:%M:%S', time.gmtime(time.time() - startTime))}") 48 | -------------------------------------------------------------------------------- /tools/update-tools.ps1: -------------------------------------------------------------------------------- 1 | $ErrorActionPreference = 'Stop' 2 | 3 | $repositoryRoot = Resolve-Path $PSScriptRoot\.. 4 | $currentLocation = Get-Location 5 | 6 | function Get-LatestVersionGitHubTag { 7 | param ( 8 | [string]$Organization, 9 | [string]$Repository 10 | ) 11 | 12 | foreach ($pageSize in @(10, 100)) { 13 | $lastTags = (Invoke-WebRequest -Method GET -Uri https://api.github.com/repos/$Organization/$Repository/tags?per_page=$pageSize).Content | ConvertFrom-Json 14 | $latestStableTag = $lastTags | Where-Object { $_.name -match '^v?[\d\.]+$' } 15 | if ($latestStableTag -and $latestStableTag[0].name -match "v?([\d\.]+$)") { 16 | return $Matches[1] 17 | } 18 | } 19 | 20 | throw "Unable to find latest tag for GitHub repository $Organization/$Repository" 21 | } 22 | 23 | try { 24 | Set-Location $repositoryRoot 25 | Write-Host -ForegroundColor Green "Update ReSharper global tool" 26 | . dotnet tool update JetBrains.ReSharper.GlobalTools 27 | Write-Host -ForegroundColor Green "Update pre-commit" 28 | . pip install --upgrade pre-commit --user 29 | . pre-commit autoupdate 30 | $content = Get-Content -Path ".\.pre-commit-config.yaml" -Raw 31 | if ($content -match "(?smi)repo: https://github.com/pre-commit/mirrors-prettier\s*rev:\s*v([\d.]+)") 32 | { 33 | $prettierVersion = $Matches[1] 34 | $content = $content -replace "prettier@v([\d.]+)", "prettier@v$prettierVersion" 35 | 36 | $xrmlPluginVersion = Get-LatestVersionGitHubTag -Organization "prettier" -Repository "plugin-xml" 37 | $content = $content -replace "@prettier/plugin-xml@([\d.]+)", "@prettier/plugin-xml@$xrmlPluginVersion" 38 | 39 | $iniPluginVersion = Get-LatestVersionGitHubTag -Organization "kddnewton" -Repository "prettier-plugin-ini" 40 | $content = $content -replace "prettier-plugin-ini@v([\d.]+)", "prettier-plugin-ini@v$iniPluginVersion" 41 | } 42 | 43 | Write-Host -ForegroundColor Green "Fromat config with pre-commit" 44 | Set-Content -Path ".\.pre-commit-config.yaml" -Value $content 45 | . pre-commit run --verbose --files .\.pre-commit-config.yaml .\.config\dotnet-tools.json 46 | } 47 | finally { 48 | Set-Location $currentLocation 49 | } 50 | --------------------------------------------------------------------------------