1414
1515namespace Xamarin . MacDev . Tasks {
1616 public abstract class XcodeToolTaskBase : XamarinTask , IHasProjectDir , IHasResourcePrefix {
17- string ? toolExe ;
18-
1917 #region Inputs
2018
2119 [ Required ]
@@ -27,16 +25,7 @@ public abstract class XcodeToolTaskBase : XamarinTask, IHasProjectDir, IHasResou
2725 [ Required ]
2826 public string ResourcePrefix { get ; set ; } = string . Empty ;
2927
30- [ Required ]
31- public string SdkBinPath { get ; set ; } = string . Empty ;
32-
33- [ Required ]
34- public string SdkUsrPath { get ; set ; } = string . Empty ;
35-
36- public string ToolExe {
37- get { return toolExe ?? ToolName ; }
38- set { toolExe = value ; }
39- }
28+ public string ToolExe { get ; set ; } = string . Empty ;
4029
4130 public string ToolPath { get ; set ; } = string . Empty ;
4231
@@ -49,22 +38,6 @@ public string ToolExe {
4938
5039 #endregion
5140
52- protected abstract string DefaultBinDir {
53- get ;
54- }
55-
56- protected string DeveloperRootBinDir {
57- get { return Path . Combine ( SdkDevPath , "usr" , "bin" ) ; }
58- }
59-
60- protected string DevicePlatformBinDir {
61- get { return Path . Combine ( SdkDevPath , "Platforms" , "iPhoneOS.platform" , "Developer" , "usr" , "bin" ) ; }
62- }
63-
64- protected string SimulatorPlatformBinDir {
65- get { return Path . Combine ( SdkDevPath , "Platforms" , "iPhoneSimulator.platform" , "Developer" , "usr" , "bin" ) ; }
66- }
67-
6841 protected abstract string ToolName { get ; }
6942
7043 protected abstract IEnumerable < ITaskItem > EnumerateInputs ( ) ;
@@ -94,22 +67,18 @@ string GetFullPathToTool ()
9467 if ( ! string . IsNullOrEmpty ( ToolPath ) )
9568 return Path . Combine ( ToolPath , ToolExe ) ;
9669
97- var path = Path . Combine ( DefaultBinDir , ToolExe ) ;
98-
99- return File . Exists ( path ) ? path : ToolExe ;
70+ return ToolExe ?? "" ;
10071 }
10172
10273 int ExecuteTool ( ITaskItem input , ITaskItem output )
10374 {
10475 var environment = new Dictionary < string , string ? > ( ) ;
10576 var args = new List < string > ( ) ;
10677
107- environment . Add ( "PATH" , SdkBinPath ) ;
108- environment . Add ( "XCODE_DEVELOPER_USR_PATH" , SdkUsrPath ) ;
109-
11078 AppendCommandLineArguments ( environment , args , input , output ) ;
11179
112- var rv = ExecuteAsync ( GetFullPathToTool ( ) , args , environment : environment ) . Result ;
80+ var executable = GetExecutable ( args , ToolName , GetFullPathToTool ( ) ) ;
81+ var rv = ExecuteAsync ( executable , args , environment : environment ) . Result ;
11382 return rv . ExitCode ;
11483 }
11584
0 commit comments