@@ -11,6 +11,7 @@ public static class GetProjects
11
11
// which registries we want to scan for projects
12
12
static readonly string [ ] registryPathsToCheck = new string [ ] { @"SOFTWARE\Unity Technologies\Unity Editor 5.x" , @"SOFTWARE\Unity Technologies\Unity Editor 4.x" } ;
13
13
14
+ // TODO separate scan and folders
14
15
public static List < Project > Scan ( bool getGitBranch = false , bool getArguments = false , bool showMissingFolders = false , bool showTargetPlatform = false )
15
16
{
16
17
List < Project > projectsFound = new List < Project > ( ) ;
@@ -116,31 +117,7 @@ public static List<Project> Scan(bool getGitBranch = false, bool getArguments =
116
117
string targetPlatform = "" ;
117
118
if ( showTargetPlatform == true )
118
119
{
119
- // get buildtarget from .csproj
120
- // <UnityBuildTarget>StandaloneWindows64:19</UnityBuildTarget>
121
- // get main csproj file
122
- var csproj = Path . Combine ( projectPath , "Assembly-CSharp.csproj" ) ;
123
- // TODO check projname also, if no assembly-.., NOTE already checked above
124
- //var csproj = Path.Combine(projectPath, projectName + ".csproj");
125
- if ( File . Exists ( csproj ) )
126
- {
127
- var csprojtxt = File . ReadAllText ( csproj ) ;
128
- var csprojsplit = csprojtxt . Split ( new [ ] { "<UnityBuildTarget>" } , StringSplitOptions . None ) ;
129
- if ( csprojsplit != null && csprojsplit . Length > 1 )
130
- {
131
- var endrow = csprojsplit [ 1 ] . IndexOf ( ":" ) ;
132
- if ( endrow > - 1 )
133
- {
134
- Console . WriteLine ( "build target: " + csprojsplit [ 1 ] . Substring ( 0 , endrow ) ) ;
135
- // 5.6 : win32, win64, osx, linux, linux64, ios, android, web, webstreamed, webgl, xboxone, ps4, psp2, wsaplayer, tizen, samsungtv
136
- // 2017: standalone, Win, Win64, OSXUniversal, Linux, Linux64, LinuxUniversal, iOS, Android, Web, WebStreamed, WebGL, XboxOne, PS4, PSP2, WindowsStoreApps, Switch, WiiU, N3DS, tvOS, PSM
137
- // 2018: standalone, Win, Win64, OSXUniversal, Linux, Linux64, LinuxUniversal, iOS, Android, Web, WebStreamed, WebGL, XboxOne, PS4, WindowsStoreApps, Switch, N3DS, tvOS
138
- // 2019: Standalone, Win, Win64, OSXUniversal, Linux64, iOS, Android, WebGL, XboxOne, PS4, WindowsStoreApps, Switch, tvOS
139
- // 2020: Standalone, Win, Win64, OSXUniversal, Linux64, iOS, Android, WebGL, XboxOne, PS4, WindowsStoreApps, Switch, tvOS
140
- targetPlatform = csprojsplit [ 1 ] . Substring ( 0 , endrow ) ;
141
- }
142
- }
143
- }
120
+ targetPlatform = Tools . ParseTargetPlatform ( projectPath ) ;
144
121
}
145
122
146
123
var p = new Project ( ) ;
0 commit comments