-
18 Nov 2009 11:29 AM #1
Running JSBUILDER2 from Cold Fusion
Running JSBUILDER2 from Cold Fusion
Hello,
I am trying to automate my build process with the awesome JSBUILDER2. In cold fusion I am using a the javaLoader cfc (http://javaloader.riaforge.org/) to load the JSBuilder JAR.
So far so code, if I look at the object I can seeCode:<!--- use the javaloader to load external jars ---> <cflock scope="server" type="exclusive" timeout="1"> <cfif not structKeyExists(server,'jsBuilder')> <cfset loadPaths = arrayNew(1)> <cfset loadPaths[1] = application.gs['jsBuilderFilePath'] & 'JSBuilder2.jar'> <cfset server.javaLoader = createObject('component', 'com.utilities.JavaLoader').init(loadPaths)> </cfif> </cflock> <!--- create an instance we can use ---> <cfset jsBuilderInstance = server.javaLoader.create('com.extjs.JSBuilder2')>
So, which method do I call to simulate calling it from the command line?Code:object of com.extjs.JSBuilder2 Class Name:com.extjs.JSBuilder2 Methods ---------------------------------------- Method Return Type compressOutputFiles() void copyResources() void main(java.lang.String[]) void writeHeadersToTargets() void
-
18 Nov 2009 11:49 AM #2
Well, its easier I guess to just to:
Thats working nicely. and I have a nice script that automatically generates the JSBuilder Project file json too! sweet....Code:<cfexecute name = "java.exe" arguments = "#commandargs#" variable="result" timeout = "60" />
-
18 Nov 2009 11:52 AM #3
The function
The function
I guess I may aswell post the function:
Code:PHP Code:<cffunction name="buildfromsource" access="public" returntype="string" hint="Use the CFEXECUTE command to call JSBUILDER2 to build from source and output to the build"> <cfargument name="projectfilesrc" type="string" required="true" default="" hint="The full path to the project file to build"> <cfargument name="jsbuilderpath" type="string" required="false" default="c:\inetpub\wwwroot\somedir\tools\jsbuilder2\" hint="The full path to the project file to build"> <cfargument name="homedir" type="string" required="false" default="c:\inetpub\wwwroot\somedir\" hint="The absolute path to the output directory"> <cfset var header = ''> <cfset var result = ''> <cfset var commandargs = ''> <cfset commandargs = "-jar #arguments.jsbuilderpath#JSBuilder2.jar"> <cfset commandargs = commandargs & " --projectFile #arguments.projectfilesrc#"> <cfset commandargs = commandargs & " --homeDir #arguments.homedir#"> <cfexecute name = "java.exe" arguments = "#commandargs#" variable="result" timeout = "60" /> <cfset header = 'Project SRC: ' & arguments.projectfilesrc & chr(10)> <cfset header = header & 'Output Home Dir: ' & arguments.homedir & chr(10) & chr(10)> <cfreturn header & result> </cffunction>
-
25 May 2010 1:53 PM #4
Hey, just implemented this functionality on my system as well. Didn't even think of doing it until I came across your thread, so thank you! And thanks for that implementation function, def got me going on it.
-Greg
-
25 May 2010 3:49 PM #5
Thank you for reporting this bug. We will make it our priority to review this report.


Reply With Quote
