mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-11-14 18:53:50 +00:00
Fix Doxygen executable search logic
This commit is contained in:
1 parent
90a63e1b14
commit
6bc0880a0d
2 files changed
+19
-29
No files matched your search
@@ -90,37 +90,24 @@ task ("docs", ["documentation"]);
|
||||
|
||||
task ("documentation", function()
|
||||
{
|
||||
var doxygen = null,
|
||||
DoxygenAppPath = "/Applications/Doxygen.app/Contents/Resources";
|
||||
// try to find a doxygen executable in the PATH;
|
||||
var doxygen = executableExists("doxygen");
|
||||
|
||||
// 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");
|
||||
|
||||
if (FILE.exists("doxygen_app"))
|
||||
var p = OS.popen(["mdfind", "kMDItemContentType == 'com.apple.application-bundle' && kMDItemCFBundleIdentifier == 'org.doxygen'"]);
|
||||
if (p.wait() === 0)
|
||||
{
|
||||
doxygen = FILE.join(UTIL.trimEnd(FILE.read("doxygen_app")), "Contents/Resources/doxygen");
|
||||
FILE.remove("doxygen_app");
|
||||
var doxygenApps = p.stdout.read().split("\n");
|
||||
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");
|
||||
|
||||
@@ -137,7 +124,7 @@ task ("documentation", function()
|
||||
OS.system(["ruby", FILE.join(documentationDir, "cleanup_headers")]);
|
||||
}
|
||||
else
|
||||
print("doxygen not installed, skipping documentation generation.");
|
||||
stream.print("\0yellow(Doxygen not installed, skipping documentation generation.\0)");
|
||||
});
|
||||
|
||||
// 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)
|
||||
{
|
||||
return FILE.exists(FILE.join(aPath, aFileName));
|
||||
});
|
||||
var paths = SYSTEM.env["PATH"].split(':');
|
||||
for (var i = 0; i < paths.length; i++) {
|
||||
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");
|
||||
|
||||
Reference in new issue
Block a user