@@ -11,6 +11,7 @@ public static class GetProjects
1111 // which registries we want to scan for projects
1212 static readonly string [ ] registryPathsToCheck = new string [ ] { @"SOFTWARE\Unity Technologies\Unity Editor 5.x" , @"SOFTWARE\Unity Technologies\Unity Editor 4.x" } ;
1313
14+ // TODO separate scan and folders
1415 public static List < Project > Scan ( bool getGitBranch = false , bool getArguments = false , bool showMissingFolders = false , bool showTargetPlatform = false )
1516 {
1617 List < Project > projectsFound = new List < Project > ( ) ;
@@ -116,31 +117,7 @@ public static List<Project> Scan(bool getGitBranch = false, bool getArguments =
116117 string targetPlatform = "" ;
117118 if ( showTargetPlatform == true )
118119 {
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 ) ;
144121 }
145122
146123 var p = new Project ( ) ;
0 commit comments