Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mdtool: Could not locate executable. #10

Open
jzeferino opened this issue Feb 7, 2017 · 5 comments
Open

mdtool: Could not locate executable. #10

jzeferino opened this issue Feb 7, 2017 · 5 comments

Comments

@jzeferino
Copy link
Member

On OS X I got this error:

mdtool: Could not locate executable.

Running:
MDToolSetup.Pack(binaryPath, artifactsDir);

Full stack trace:

at Cake.Core.Tooling.Tool1[TSettings].RunProcess (TSettings settings, Cake.Core.IO.ProcessArgumentBuilder arguments, Cake.Core.IO.ProcessSettings processSettings) [0x0009a] in <47bd6426c6a64c7ea6de1ba15c2457b7>:0 at Cake.Core.Tooling.Tool1[TSettings].Run (TSettings settings, Cake.Core.IO.ProcessArgumentBuilder arguments, Cake.Core.IO.ProcessSettings processSettings, System.Action1[T] postAction) [0x00026] in <47bd6426c6a64c7ea6de1ba15c2457b7>:0 at Cake.Core.Tooling.Tool1[TSettings].Run (TSettings settings, Cake.Core.IO.ProcessArgumentBuilder arguments) [0x00001] in <47bd6426c6a64c7ea6de1ba15c2457b7>:0
at Cake.Xamarin.MDToolSetupRunner.Pack (Cake.Core.IO.FilePath addinFile, Cake.Core.IO.DirectoryPath outputDirectory) [0x0004d] in <279329ce540b49f2bdca05af04b9e327>:0
at CakeBuildScriptImpl+c__AnonStorey0.<>m__5 () [0x00021] in :0

@agc93
Copy link
Contributor

agc93 commented Feb 8, 2017

@jzeferino Is mdtool in your PATH? Cake, by default, will only resolve from PATH since it doesn't know your Xamarin Studio/VS for Mac install path.

@jzeferino
Copy link
Member Author

It ins't in my PATH, but since this is Cake.Xamarin, it would be nice to check if the mdtool was in the common places (in xamarin studio bin for example).

So, since the cake could run in (eg: windows, linux, osx) I will have to Register the mdtool.exe when cake runs in the different OS types. And in the windows case, the mdtool.exe ins't shipped with visual studio (with xamarin) that I know.

@agc93
Copy link
Contributor

agc93 commented Feb 9, 2017

@jzeferino Yeah, so the paths change based not just on platform but installation location, IDE version and a bunch of other variables (so even 'Xamarin Studio bin' is not so simple), so you may need to provide it with the path to mdtool/mdtool.exe if it's not in your PATH.

Unless @Redth know more about resolving mdtool paths than me, perhaps..

@jzeferino
Copy link
Member Author

jzeferino commented Feb 9, 2017

For now I have this (just to Pack locally):

Task("Pack")
    .IsDependentOn("Build")
    .WithCriteria(() => isLocalBuild)
    .WithCriteria(() => HasMdTool())
	.Does(() => 
	{
		MDToolSetup.Pack(binaryPath, artifactsDir);
	});

private bool HasMdTool()
{
	var mdToolPath = @"/Applications/Xamarin Studio.app/Contents/Resources/lib/monodevelop/bin/mdtool.exe";

	if (FileExists(mdToolPath)) {
		Information("mdtool exists");

		Context.Tools.RegisterFile(mdToolPath);
		return true;
	}
	return false;
}

Would like to hear @Redth on this.

@Redth
Copy link
Contributor

Redth commented Apr 4, 2017

I don't believe I make any current assumptions as to where mdtool exists. Definitely a good idea to at least try for some well known paths.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants