mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-08-25 04:57:03 +00:00
Fix Doxygen executable search logic
This commit is contained in:
@@ -90,37 +90,24 @@ task ("docs", ["documentation"]);
|
|||||||
|
|
||||||
task ("documentation", function()
|
task ("documentation", function()
|
||||||
{
|
{
|
||||||
var doxygen = null,
|
// try to find a doxygen executable in the PATH;
|
||||||
DoxygenAppPath = "/Applications/Doxygen.app/Contents/Resources";
|
var doxygen = executableExists("doxygen");
|
||||||
|
|
||||||
// If the Doxygen application is installed on Mac OS X, use that
|
// If the Doxygen application is installed on Mac OS X, use that
|
||||||
if (executableExists("mdfind"))
|
if (!doxygen && executableExists("mdfind"))
|
||||||
{
|
{
|
||||||
OS.system("mdfind \"kMDItemContentType == 'com.apple.application-bundle' && kMDItemCFBundleIdentifier == 'org.doxygen'\" > doxygen_app");
|
var p = OS.popen(["mdfind", "kMDItemContentType == 'com.apple.application-bundle' && kMDItemCFBundleIdentifier == 'org.doxygen'"]);
|
||||||
|
if (p.wait() === 0)
|
||||||
if (FILE.exists("doxygen_app"))
|
|
||||||
{
|
{
|
||||||
doxygen = FILE.join(UTIL.trimEnd(FILE.read("doxygen_app")), "Contents/Resources/doxygen");
|
var doxygenApps = p.stdout.read().split("\n");
|
||||||
FILE.remove("doxygen_app");
|
if (doxygenApps[0])
|
||||||
|
doxygen = FILE.join(doxygenApps[0], "Contents/Resources/doxygen");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
SYSTEM.env["PATH"].split(':').some(function(/*String*/ aPath)
|
|
||||||
{
|
|
||||||
var path = FILE.join(aPath, "doxygen");
|
|
||||||
|
|
||||||
if (FILE.exists(path))
|
|
||||||
{
|
|
||||||
doxygen = path;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (doxygen)
|
if (doxygen && FILE.exists(doxygen))
|
||||||
{
|
{
|
||||||
print("Using " + doxygen + " for doxygen binary.");
|
stream.print("\0green(Using " + doxygen + " for doxygen binary.\0)");
|
||||||
|
|
||||||
var documentationDir = FILE.join("Tools", "Documentation");
|
var documentationDir = FILE.join("Tools", "Documentation");
|
||||||
|
|
||||||
@@ -137,7 +124,7 @@ task ("documentation", function()
|
|||||||
OS.system(["ruby", FILE.join(documentationDir, "cleanup_headers")]);
|
OS.system(["ruby", FILE.join(documentationDir, "cleanup_headers")]);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
print("doxygen not installed, skipping documentation generation.");
|
stream.print("\0yellow(Doxygen not installed, skipping documentation generation.\0)");
|
||||||
});
|
});
|
||||||
|
|
||||||
// Downloads
|
// Downloads
|
||||||
|
|||||||
+8
-5
@@ -266,12 +266,15 @@ global.subjake = function(/*Array<String>*/ directories, /*String*/ aTaskName)
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
global.executableExists = function(/*String*/ aFileName)
|
global.executableExists = function(/*String*/ executableName)
|
||||||
{
|
{
|
||||||
return SYSTEM.env["PATH"].split(':').some(function(/*String*/ aPath)
|
var paths = SYSTEM.env["PATH"].split(':');
|
||||||
{
|
for (var i = 0; i < paths.length; i++) {
|
||||||
return FILE.exists(FILE.join(aPath, aFileName));
|
var path = FILE.join(paths[i], executableName);
|
||||||
});
|
if (FILE.exists(path))
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$OBJJ_TEMPLATE_EXECUTABLE = FILE.join($HOME_DIR, "Objective-J", "CommonJS", "objj-executable");
|
$OBJJ_TEMPLATE_EXECUTABLE = FILE.join($HOME_DIR, "Objective-J", "CommonJS", "objj-executable");
|
||||||
|
|||||||
Reference in New Issue
Block a user