Added logging of errors during plugin autoload.

This commit is contained in:
walterhiggins 2014-01-25 09:04:16 +00:00
parent 8c690452e7
commit 7a7767c83c
70 changed files with 14 additions and 14 deletions

View file

@ -75,8 +75,8 @@
<classpath>
<pathelement path="src/docs/java"/>
</classpath>
<arg value="src/docs/javascript/generateApiDocs.js"/>
<arg value="src/main/javascript"/>
<arg value="src/docs/js/generateApiDocs.js"/>
<arg value="src/main/js"/>
</java>
</target>
@ -103,7 +103,7 @@ Walter Higgins
<classpath>
<pathelement path="src/docs/java"/>
</classpath>
<arg value="src/docs/javascript/generateTOC.js"/>
<arg value="src/docs/js/generateTOC.js"/>
<arg value="${dist}/apiref.md"/>
</java>
</target>
@ -113,7 +113,7 @@ Walter Higgins
<classpath>
<pathelement path="src/docs/java"/>
</classpath>
<arg value="src/docs/javascript/generateTOC.js"/>
<arg value="src/docs/js/generateTOC.js"/>
<arg value="src/docs/templates/ypgpm.md"/>
</java>
</target>
@ -134,7 +134,7 @@ Walter Higgins
<target name="zip_lib" depends="init">
<delete file="${build}/lib.zip"/>
<zip destfile="${build}/lib.zip"
basedir="./src/main/javascript"
basedir="./src/main/js"
excludes="modules/**, plugins/**,">
</zip>
</target>
@ -142,7 +142,7 @@ Walter Higgins
<target name="zip_modules" depends="init">
<delete file="${build}/modules.zip"/>
<zip destfile="${build}/modules.zip"
basedir="./src/main/javascript"
basedir="./src/main/js"
excludes="lib/**, plugins/**,">
</zip>
</target>
@ -150,7 +150,7 @@ Walter Higgins
<target name="zip_plugins" depends="init">
<delete file="${build}/plugins.zip"/>
<zip destfile="${build}/plugins.zip"
basedir="./src/main/javascript"
basedir="./src/main/js"
excludes="lib/**, modules/**">
</zip>
</target>

View file

@ -13,7 +13,7 @@ var _plugin = function(/* String */ moduleName, /* Object */ moduleObject, isPer
//
// don't load plugin more than once
//
if (typeof _plugins[moduleName] != "undefined")
if (typeof _plugins[moduleName] != 'undefined')
return _plugins[moduleName].module;
var pluginData = {persistent: isPersistent, module: moduleObject};
@ -34,14 +34,14 @@ var scriptCraftDir = null;
var pluginDir = null;
var dataDir = null;
exports.autoload = function(dir) {
exports.autoload = function(dir,logger) {
scriptCraftDir = dir;
pluginDir = new File(dir, "plugins");
dataDir = new File(dir, "data");
pluginDir = new File(dir, 'plugins');
dataDir = new File(dir, 'data');
var _canonize = function(file){
return '' + file.canonicalPath.replaceAll("\\\\","/");
return '' + file.canonicalPath.replaceAll('\\\\','/');
};
/*
recursively walk the given directory and return a list of all .js files
@ -85,7 +85,7 @@ exports.autoload = function(dir) {
global[property] = module[property];
}
}catch (e){
logger.severe('Plugin ' + pluginPath + ' ' + e);
}
}
};

View file

@ -625,7 +625,7 @@ function __onEnable (__engine, __plugin, __script)
return result;
};
plugins.autoload(jsPluginsRootDir);
plugins.autoload(jsPluginsRootDir,logger);
/*
wph 20140102 - warn if legacy 'craftbukkit/js-plugins' or 'craftbukkit/scriptcraft' directories are present
*/