Skip to content

Commit

Permalink
Adds automatic java lib mappings for Plugins #731
Browse files Browse the repository at this point in the history
Not 100% convinced by the implementation here; it would mean the developer has to use `arrayAppend()` when adding their own javaSettings.LoadPaths, as the danger is they override what we've set unintentionally.
  • Loading branch information
neokoenig committed Mar 14, 2017
1 parent a631141 commit b0221ae
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions wheels/functions.cfm
Expand Up @@ -14,6 +14,21 @@ this.mappings["/wheels"] = GetDirectoryFromPath(GetBaseTemplatePath()) & "wheels
// We turn on "sessionManagement" by default since the Flash uses it.
this.sessionManagement = true;
this.javaSettings={
"LoadPaths"=[]
}
// If a plugin has a jar or class file, automatically add the mapping to this.javasettings
// This is perhaps a little high up in the load order? Need to double check effects of user overrides to `this`.
this.pluginFolders=DirectoryList(
path=GetDirectoryFromPath(GetBaseTemplatePath()) & "plugins", recurse="true", filter="*.class|*.jar|*.java");
for (folder in this.pluginFolders) {
if(!ArrayFind(this.javaSettings.LoadPaths, GetDirectoryFromPath(folder))){
ArrayAppend(this.javaSettings.LoadPaths, GetDirectoryFromPath(folder));
}
}
// Include developer's app config so they can set their own variables in this scope (or override "sessionManagement").
// Include Wheels controller and global functions.
// Include Wheels event functions (which in turn includes the developer's event files).
Expand Down

0 comments on commit b0221ae

Please sign in to comment.