PDA

View Full Version : How to use sencha.jar with Ant



paul_wang
4 Oct 2012, 4:04 PM
Hi,

I'm trying to run sencha commands from my Ant file using sencha.jar without much success. If I point my classpath to where I installed Sencha then it seems to work but if I just copy sencha.jar and the lib directory it gave me an error.

I need to know what it is looking for so I can run it on a machine that does not have Sencha Cmd installed.



I copied from Sencha directory sencha.jar and lib\ to the current directory and this is the output from build.xml


c:\work_tmp>ant dist.sencha
Buildfile: c:\work_tmp\build.xml


dist.sencha:
[taskdef] Could not load definitions from resource net/sf/antcontrib/antlib.xml. It could not be found.


BUILD FAILED
java.lang.NullPointerException
at com.sencha.command.ConfigOverrideLoader.loadOverrides(ConfigOverrideLoader.java:139)
at com.sencha.command.ConfigOverrideLoader.getOverride(ConfigOverrideLoader.java:38)
at com.sencha.command.SenchaConfigManager.checkForOverride(SenchaConfigManager.java:173)
at com.sencha.command.SenchaConfigManager.getConfig(SenchaConfigManager.java:166)
at com.sencha.command.SenchaConfigManager.getConfig(SenchaConfigManager.java:57)
at com.sencha.command.Sencha.<init>(Sencha.java:40)
at com.sencha.ant.SenchaCommandTask.doExecute(SenchaCommandTask.java:34)
at com.sencha.ant.BaseAntTask.execute(BaseAntTask.java:21)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:392)
at org.apache.tools.ant.Target.performTasks(Target.java:413)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
at org.apache.tools.ant.Main.runBuild(Main.java:811)
at org.apache.tools.ant.Main.startAnt(Main.java:217)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)


Total time: 0 seconds


BUILD FAILED
c:\work_tmp\build.xml:17: com.sencha.exceptions.BasicException
at com.sencha.exceptions.BasicException.wrap(BasicException.java:43)
at com.sencha.ant.BaseAntTask.execute(BaseAntTask.java:25)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:392)
at org.apache.tools.ant.Target.performTasks(Target.java:413)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
at org.apache.tools.ant.Main.runBuild(Main.java:811)
at org.apache.tools.ant.Main.startAnt(Main.java:217)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Caused by: java.lang.NullPointerException
at com.sencha.command.ConfigOverrideLoader.loadOverrides(ConfigOverrideLoader.java:139)
at com.sencha.command.ConfigOverrideLoader.getOverride(ConfigOverrideLoader.java:38)
at com.sencha.command.SenchaConfigManager.checkForOverride(SenchaConfigManager.java:173)
at com.sencha.command.SenchaConfigManager.getConfig(SenchaConfigManager.java:166)
at com.sencha.command.SenchaConfigManager.getConfig(SenchaConfigManager.java:57)
at com.sencha.command.Sencha.<init>(Sencha.java:40)
at com.sencha.ant.SenchaCommandTask.doExecute(SenchaCommandTask.java:34)
at com.sencha.ant.BaseAntTask.execute(BaseAntTask.java:21)
... 17 more


Total time: 0 seconds


c:\work_tmp>


This is the content of build.xml


<project name="work_tmp" default="dist.sencha" basedir=".">


<target name="dist.sencha">


<path id="sencha.class.path2">
<fileset dir="c:\Program Files (x86)\SenchaCmd-3.0.0.181\Sencha\Cmd\3.0.0.181\lib" includes="*.jar"/>
<fileset dir="c:\Program Files (x86)\SenchaCmd-3.0.0.181\Sencha\Cmd\3.0.0.181\" includes="*.jar"/>
</path>

<path id="sencha.class.path">
<fileset dir="lib" includes="*.jar"/>
<fileset dir="." includes="sencha.jar"/>
</path>

<taskdef resource="com/sencha/ant/antlib.xml" classpathref="sencha.class.path"/>

<x-sencha-command>
compile
</x-sencha-command>

</target>


</project>


If I change classpathref="sencha.class.path" to "sencha.class.path2" then it seems to work fine. This is the output.


c:\work_tmp>ant dist.sencha
Buildfile: c:\work_tmp\build.xml


dist.sencha:
[taskdef] Could not load definitions from resource net/sf/antcontrib/antlib.xml. It could not be found.
[x-sencha-command] sencha compile
[x-sencha-command]
[x-sencha-command]
[x-sencha-command] This command category provides JavaScript compilation commands. The
[x-sencha-command] compile
[x-sencha-command]
[x-sencha-command] category maintains compilation state across its sub-commands so using
[x-sencha-command] and
[x-sencha-command] to
[x-sencha-command] connect sub-commands can provide significant time savings compared to making
[x-sencha-command] repeated calls.
[x-sencha-command]
[x-sencha-command]
[x-sencha-command] OPTIONS
[x-sencha-command]
[x-sencha-command] *
[x-sencha-command] --classpath
[x-sencha-command] ,
[x-sencha-command] -cl
[x-sencha-command] - adds fodler(s) to the class path
[x-sencha-command] *
[x-sencha-command] --debug
[x-sencha-command] ,
[x-sencha-command] -deb
[x-sencha-command] - enables the debug option for the js directive parser
[x-sencha-command] *
[x-sencha-command] --deferred-overrides
[x-sencha-command] ,
[x-sencha-command] -def
[x-sencha-command] - enable / disable deferred override processing (use with optimize)
[x-sencha-command] *
[x-sencha-command] --ignore
[x-sencha-command] ,
[x-sencha-command] -ig
[x-sencha-command] - excludes files with names containing the given substrings from the class path (comma separated)
[x-sencha-command] *
[x-sencha-command] --options
[x-sencha-command] ,
[x-sencha-command] -o
[x-sencha-command] - sets options for the js directive parser (name:value,...)
[x-sencha-command]
[x-sencha-command] COMMANDS
[x-sencha-command]
[x-sencha-command] *
[x-sencha-command] concatenate
[x-sencha-command] - produce a concatenated build
[x-sencha-command] *
[x-sencha-command] exclude
[x-sencha-command] - exclude files from the compilation set
[x-sencha-command] *
[x-sencha-command] include
[x-sencha-command] - include files into the compilation set
[x-sencha-command] *
[x-sencha-command] intersect
[x-sencha-command] - create a new save set by intersecting existing sets
[x-sencha-command] *
[x-sencha-command] metadata
[x-sencha-command] - produce class metadata
[x-sencha-command] *
[x-sencha-command] page
[x-sencha-command] - compiles a page
[x-sencha-command] *
[x-sencha-command] restore
[x-sencha-command] - alias for 'exclude +all and include -set=<set-name>'
[x-sencha-command] *
[x-sencha-command] save
[x-sencha-command] - remembers the currently enabled file state by a name
[x-sencha-command] *
[x-sencha-command] show-ignored
[x-sencha-command] - displays ignored files from the current classpath
[x-sencha-command] *
[x-sencha-command] union
[x-sencha-command] - alias for 'exclude +all and include ...'
[x-sencha-command]


BUILD SUCCESSFUL
Total time: 1 second


c:\work_tmp>

paul_wang
4 Oct 2012, 4:16 PM
Ah, I found the file it wants. It's looking for sencha.cfg. If I copy the file to the current directory then it works.

Is there a reason this dependency exists? Thanks.

dongryphon
5 Oct 2012, 10:12 PM
Depending on what you are doing with Sencha Cmd, it will need all of the files it installs. Obviously, some of these files are needed by certain functions you might not need so you can pick some things out here and there. This will be maintenance intensive as you upgrade since there is no good way to subset things to support certain functional subsets.

If I may ask, what is the issue with running the installer on the machine? We would like to know because obviously this is the kind of environment we want to support.

mpost
12 Nov 2012, 8:00 PM
I'm running into similar issues. I don't want to run the installer on every machine because that means the entire build farm would need to be upgraded. It would be far, far easier if I could take Sencha Cmd, check it into my third party asset management system (based on Sonatype Nexus), and then pull it down for each build that needs it -- all without modifying the build system. A detailed guide starting from a .tar file would be extremely helpful here.

edit: And really what I want to do is eventually use it with maven.

dongryphon
13 Nov 2012, 12:21 AM
We are looking at Maven deployment for sure, but just are not there yet. So in the interim...

The Cmd installer is little more than a self-extracting archive that adds the target folder to the PATH (and provides an uninstaller). Once installed, Cmd makes very few assumptions (see http://docs.sencha.com/ext-js/4-1/#!/guide/command_advanced for specifics) so you should be able to tar/zip up the installed version and ship it around as you see fit. Keep in mind that the install is platform-specific and contains native binary executables so you can only unzip/tar and run on the same OS.

I would recommend looking in the build-impl.xml if you want to see how we "boot up" for builds directly from Ant.

It boils down to these steps:

Find sencha.jar (this could be as simple as a required property)
Load the antlib
Add sencha.jar to the classpath (if required)
Initialize properties from the Cmd configuration (if needed)


These are exacted from the build-impl.xml:



<taskdef resource="com/sencha/ant/antlib.xml" classpath="${cmd.dir}/sencha.jar"/>
<x-extend-classpath>
<jar path="${cmd.dir}/sencha.jar"/>
</x-extend-classpath>
<x-sencha-init prefix=""/>


The "x-extend-classpath" task adds the sencha.jar (pretty obvious). You'll know if you need this if you get errors about not finding classes from there.

The "x-sencha-init" task loads the app, workspace and other config properties (found in sencha.cfg files) in to Ant properties. The "prefix" prefixes these properties.

If you are building a script from scratch you may not need "x-sencha-init".

For what it is worth, we face similar issues for building Cmd as we rely on many things that are not published in a maven repo. We solved this by creating our own (internal) maven repo where we store those artifacts. This allows our Cmd build to treat them as normal maven dependencies.

mpost
13 Nov 2012, 2:28 PM
Thank you, that was quite informative.

alex.sherwin
19 Nov 2012, 6:33 PM
Am I missing something... I'm having no luck with the ant task, and your comments and the docs make it seem oddly procedural.

The things I don't understand is where it's looking for configs and what it considers the "working" directory...

We automate EVERYTHING to do with our builds with ant, and it's imperative to embed ant in the project structure under version control so that automated and continuous integration build systems can build it the same as the developers.

So, to my excitement, I was happy to see that Sencha Cmd is based on ant... until I tried to use it.

How do you expect this to work in some kind of structure like this:

/build.xml
/modules/module1
/modules/module2
/modules/module3
/web/projects/proj1/desktop
/web/projects/proj1/mobile
/web/projects/proj2/desktop
/web/projects/proj2/mobile
/web/projects/proj3/desktop
/web/projects/proj3/mobile

Where the root build.xml is responsible for building and packaging the whole thing... I don't understand, and the Sencha Cmd doc's I have seen do not make it clear how to invoke commands that operate on those directories properly..

The closest I have come is like this:


<path id="sencha.classpath"> <fileset file="${sencha.cmd.dir}/sencha.jar"/>
<fileset file="${sencha.cmd.dir}/lib/ant-contrib-1.0b3.jar"/>
</path>


<taskdef resource="com/sencha/ant/antlib.xml" classpathref="sencha.classpath"/>


<target name="compile.web">

<property name="app.dir" location="web/project/register/desktop"/>
<property name="sdk.dir" location="C:\other\sencha\ext-4.1.3"/>
<property name="out.dir" location="${dist.basedir}/out"/>

<x-extend-classpath>
<jar path="${sencha.cmd.dir}/sencha.jar"/>
</x-extend-classpath>

<x-sencha-init prefix="web/project/register/desktop"/>


<x-sencha-command>
compile
# Include the app folder and the sdk/src folder
--classpath=${app.dir},${sdk.dir}/src


# Turn off debugging (comment next line to leave debug enabled):
# --debug=false


page
# The application main page:
--in=${app.dir}/index.html


# The compiled page goes in build folder along with "all-classes.js":
--out=${out.dir}/index.html
</x-sencha-command>


</target>

But this nets a circular depdency problem:


Buildfile: c:\other\myproj\build.xml [taskdef] Could not load definitions from resource net/sf/antcontrib/antlib.xml. It could not be found.


compile.web:
[x-sencha-command] Nov 19, 2012 9:21:03 PM com.sencha.command.compile.CompileCommands$PageCommand execute
[x-sencha-command] INFO: Compiling page null
[x-sencha-command] Nov 19, 2012 9:21:03 PM com.sencha.tools.compiler.CompilerContext loadClassPath
[x-sencha-command] INFO: Processing classPath entry : c:\other\myproj\sencha-compile-temp-dir
[x-sencha-command] Nov 19, 2012 9:21:03 PM com.sencha.tools.compiler.CompilerContext loadClassPath
[x-sencha-command] INFO: Processing classPath entry : c:\other\myproj\web\project\register\desktop
[x-sencha-command] Nov 19, 2012 9:21:03 PM com.sencha.tools.compiler.CompilerContext loadClassPath
[x-sencha-command] INFO: Processing classPath entry : C:\other\sencha\ext-4.1.3\src
[x-sencha-command] Nov 19, 2012 9:21:08 PM com.sencha.tools.compiler.CompilerContext processClassGraph
[x-sencha-command] INFO: Processing class inheritance graph
[x-sencha-command] Nov 19, 2012 9:21:08 PM com.sencha.tools.compiler.CompilerContext processReferentialDependencies
[x-sencha-command] INFO: Processing instantiation refereces to classes and aliases
[x-sencha-command] Nov 19, 2012 9:21:11 PM com.sencha.tools.compiler.CompilerContext processDependencies
[x-sencha-command] INFO: Processing source dependencies
[x-sencha-command] Nov 19, 2012 9:21:11 PM com.sencha.tools.compiler.CompilerContext processFileDependencies
[x-sencha-command] SEVERE: Circular requires reference :
[x-sencha-command] C:\other\myproj\web\project\register\desktop\app\app.js ->
[x-sencha-command] C:\other\sencha\ext-4.1.3\src\app\Application.js ->
[x-sencha-command] C:\other\sencha\ext-4.1.3\src\app\Controller.js ->
[x-sencha-command] c:\other\myproj\web\project\register\desktop\ext\builds\ext-all-sandbox-debug-w-comments.js ->
[x-sencha-command] c:\other\myproj\web\project\register\desktop\ext\ext.js ->
[x-sencha-command] C:\other\sencha\ext-4.1.3\src\app\Application.js
[x-sencha-command] Nov 19, 2012 9:21:11 PM com.sencha.command.compile.CompileCommands$PageCommand execute
[x-sencha-command] SEVERE: Error executing page compilation com.sencha.exceptions.BasicException: com.sencha.exceptions.
BasicException: com.sencha.exceptions.ExCircularReference: Circular requires reference for file C:\other\sencha\ext-4.1.
3\src\app\Application.js
[x-sencha-command] Nov 19, 2012 9:21:11 PM com.sencha.cli.Command dispatch
[x-sencha-command] SEVERE: InvocationTargetException: null


BUILD FAILED
com.sencha.exceptions.ExBuild: com.sencha.exceptions.BasicException: com.sencha.exceptions.BasicException: com.sencha.ex
ceptions.BasicException: com.sencha.exceptions.ExCircularReference: Circular requires reference for file C:\other\sencha
\ext-4.1.3\src\app\Application.js
at com.sencha.command.compile.CompileCommands$PageCommand.execute(CompileCommands.java:941)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sencha.cli.Command.dispatch(Command.java:78)
at com.sencha.cli.Commands.dispatch(Commands.java:49)
at com.sencha.cli.Commands.dispatch(Commands.java:49)
at com.sencha.cli.AbstractCommand.dispatch(AbstractCommand.java:182)
at com.sencha.ant.SenchaCommandTask.doExecute(SenchaCommandTask.java:58)
at com.sencha.ant.BaseAntTask.execute(BaseAntTask.java:22)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:392)
at org.apache.tools.ant.Target.performTasks(Target.java:413)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
at org.apache.tools.ant.Main.runBuild(Main.java:811)
at org.apache.tools.ant.Main.startAnt(Main.java:217)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Caused by: com.sencha.exceptions.BasicException: com.sencha.exceptions.BasicException: com.sencha.exceptions.BasicExcept
ion: com.sencha.exceptions.ExCircularReference: Circular requires reference for file C:\other\sencha\ext-4.1.3\src\app\A
pplication.js
at com.sencha.tools.compiler.CompilerContext.processFileDependencies(CompilerContext.java:413)
at com.sencha.tools.compiler.CompilerContext.doProcessDependencies(CompilerContext.java:345)
at com.sencha.tools.compiler.CompilerContext.processDependencies(CompilerContext.java:335)
at com.sencha.tools.compiler.CompilerContext.processDependencies(CompilerContext.java:307)
at com.sencha.command.compile.CompileCommands.getCache(CompileCommands.java:199)
at com.sencha.command.compile.CompileCommands.getCache(CompileCommands.java:154)
at com.sencha.command.compile.CompileCommands$PageCommand.execute(CompileCommands.java:926)
... 26 more
Caused by: com.sencha.exceptions.BasicException: com.sencha.exceptions.BasicException: com.sencha.exceptions.ExCircularR
eference: Circular requires reference for file C:\other\sencha\ext-4.1.3\src\app\Application.js
at com.sencha.tools.compiler.CompilerContext.processFileDependencies(CompilerContext.java:451)
at com.sencha.tools.compiler.CompilerContext.processFileDependencies(CompilerContext.java:488)
at com.sencha.tools.compiler.CompilerContext.processFileDependencies(CompilerContext.java:409)
... 32 more
Caused by: com.sencha.exceptions.BasicException: com.sencha.exceptions.ExCircularReference: Circular requires reference
for file C:\other\sencha\ext-4.1.3\src\app\Application.js
at com.sencha.tools.compiler.CompilerContext.processFileDependencies(CompilerContext.java:413)
at com.sencha.tools.compiler.CompilerContext.processFileDependencies(CompilerContext.java:391)
at com.sencha.tools.compiler.CompilerContext.processFileDependencies(CompilerContext.java:447)
... 34 more
Caused by: com.sencha.exceptions.ExCircularReference: Circular requires reference for file C:\other\sencha\ext-4.1.3\src
\app\Application.js
at com.sencha.tools.compiler.CompilerContext.processFileDependencies(CompilerContext.java:380)
at com.sencha.tools.compiler.CompilerContext.processFileDependencies(CompilerContext.java:409)
... 36 more


Total time: 11 seconds


BUILD FAILED
c:\other\myproj\build.xml:348: com.sencha.exceptions.ExBuild: com.sencha.exceptions.BasicException: com.sencha.exceptio
ns.BasicException: com.sencha.exceptions.BasicException: com.sencha.exceptions.ExCircularReference: Circular requires re
ference for file C:\other\sencha\ext-4.1.3\src\app\Application.js
at com.sencha.command.compile.CompileCommands$PageCommand.execute(CompileCommands.java:941)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sencha.cli.Command.dispatch(Command.java:78)
at com.sencha.cli.Commands.dispatch(Commands.java:49)
at com.sencha.cli.Commands.dispatch(Commands.java:49)
at com.sencha.cli.AbstractCommand.dispatch(AbstractCommand.java:182)
at com.sencha.ant.SenchaCommandTask.doExecute(SenchaCommandTask.java:58)
at com.sencha.ant.BaseAntTask.execute(BaseAntTask.java:22)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:392)
at org.apache.tools.ant.Target.performTasks(Target.java:413)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
at org.apache.tools.ant.Main.runBuild(Main.java:811)
at org.apache.tools.ant.Main.startAnt(Main.java:217)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Caused by: com.sencha.exceptions.BasicException: com.sencha.exceptions.BasicException: com.sencha.exceptions.BasicExcept
ion: com.sencha.exceptions.ExCircularReference: Circular requires reference for file C:\other\sencha\ext-4.1.3\src\app\A
pplication.js
at com.sencha.tools.compiler.CompilerContext.processFileDependencies(CompilerContext.java:413)
at com.sencha.tools.compiler.CompilerContext.doProcessDependencies(CompilerContext.java:345)
at com.sencha.tools.compiler.CompilerContext.processDependencies(CompilerContext.java:335)
at com.sencha.tools.compiler.CompilerContext.processDependencies(CompilerContext.java:307)
at com.sencha.command.compile.CompileCommands.getCache(CompileCommands.java:199)
at com.sencha.command.compile.CompileCommands.getCache(CompileCommands.java:154)
at com.sencha.command.compile.CompileCommands$PageCommand.execute(CompileCommands.java:926)
... 26 more
Caused by: com.sencha.exceptions.BasicException: com.sencha.exceptions.BasicException: com.sencha.exceptions.ExCircularR
eference: Circular requires reference for file C:\other\sencha\ext-4.1.3\src\app\Application.js
at com.sencha.tools.compiler.CompilerContext.processFileDependencies(CompilerContext.java:451)
at com.sencha.tools.compiler.CompilerContext.processFileDependencies(CompilerContext.java:488)
at com.sencha.tools.compiler.CompilerContext.processFileDependencies(CompilerContext.java:409)
... 32 more
Caused by: com.sencha.exceptions.BasicException: com.sencha.exceptions.ExCircularReference: Circular requires reference
for file C:\other\sencha\ext-4.1.3\src\app\Application.js
at com.sencha.tools.compiler.CompilerContext.processFileDependencies(CompilerContext.java:413)
at com.sencha.tools.compiler.CompilerContext.processFileDependencies(CompilerContext.java:391)
at com.sencha.tools.compiler.CompilerContext.processFileDependencies(CompilerContext.java:447)
... 34 more
Caused by: com.sencha.exceptions.ExCircularReference: Circular requires reference for file C:\other\sencha\ext-4.1.3\src
\app\Application.js
at com.sencha.tools.compiler.CompilerContext.processFileDependencies(CompilerContext.java:380)
at com.sencha.tools.compiler.CompilerContext.processFileDependencies(CompilerContext.java:409)
... 36 more


Total time: 11 seconds

Note that I have not been able to resolve the ant contrib warning either... The reference to it in the path is correct.

It's a unmodified skeleton generated using Sencha Cmd, and it builds fine from the command line using "sencha app build production", etc.

dongryphon
23 Nov 2012, 12:02 AM
Looking over your post I can see there are couple issues in the mix.

The first is the circular reference. From the log just above the exception callstacks:



SEVERE: Circular requires reference :
C:\other\myproj\web\project\register\desktop\app\app.js ->
C:\other\sencha\ext-4.1.3\src\app\Application.js ->
C:\other\sencha\ext-4.1.3\src\app\Controller.js ->
c:\other\myproj\web\project\register\desktop\ext\builds\ext-all-sandbox-debug-w-comments.js ->
c:\other\myproj\web\project\register\desktop\ext\ext.js ->
C:\other\sencha\ext-4.1.3\src\app\Application.js


Somehow ext-all-sandbox-debug-w-comments.js is being added to your classpath. Not sure how given the command you are executing. When using the compile command you only want the raw src directory in the classpath not any of the built versions.

Secondly, I am trying to understand exactly what your master build is doing. If I follow your folder structure's implication, you have several "apps" (one desktop and one mobile in each "project"). How are these structured? Are they set up as "apps" in the Cmd-sense?

The x-sencha-init prefix will change the properties imported from the sencha.cfg files. It looks like your commands that follow are using the properties without the prefix you've defined.

If you have some specific questions, it would probably be good to start new threads to help focus on them.

hkelsey
28 Nov 2012, 9:36 AM
Hi
I cannot get x-sencha-command to run through ant, I just get an IllegalAccessError. I've checked and I don't have more than one rhino jars on the classpath which some posts suggest could cause the error. It seems strange because it's on the instantiation of CompilerEnvirons which attempts to get the static instance of DefaultErrorReporter which is within the same package as CompilerEnvirons.
Any help would be greatly appreciated.


com.sencha.exceptions.BasicException: java.lang.IllegalAccessError: tried to access class org/mozilla/javascript/DefaultErrorReporter from class org/mozilla/javascript/CompilerEnvirons
at com.sencha.cli.Commands$Cmd.create(Commands.java:117)
at com.sencha.cli.Commands.findCommand(Commands.java:74)
at com.sencha.cli.Commands.dispatch(Commands.java:43)
at com.sencha.cli.AbstractCommand.dispatch(AbstractCommand.java:184)
at com.sencha.ant.SenchaCommandTask.doExecute(SenchaCommandTask.java:58)
at com.sencha.ant.BaseAntTask.execute(BaseAntTask.java:22)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:390)
at org.apache.tools.ant.Target.performTasks(Target.java:411)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
at org.apache.tools.ant.Main.runBuild(Main.java:809)
at org.apache.tools.ant.Main.startAnt(Main.java:217)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Caused by: java.lang.IllegalAccessError: tried to access class org/mozilla/javascript/DefaultErrorReporter from class org/mozilla/javascript/CompilerEnvirons
at org.mozilla.javascript.CompilerEnvirons.<init>(CompilerEnvirons.java:51)
at com.sencha.tools.compiler.CompilerContext.<init>(CompilerContext.java:45)
at com.sencha.command.compile.CompileCommands.<init>(CompileCommands.java:64)
at com.sencha.command.Sencha.createCompile(Sencha.java:95)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sencha.cli.Commands$Cmd.create(Commands.java:99)
at com.sencha.cli.Commands.findCommand(Commands.java:76)
at com.sencha.cli.Commands.dispatch(Commands.java:43)
at com.sencha.cli.AbstractCommand.dispatch(AbstractCommand.java:185)
at com.sencha.ant.SenchaCommandTask.doExecute(SenchaCommandTask.java:59)
at com.sencha.ant.BaseAntTask.execute(BaseAntTask.java:22)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:390)
at org.apache.tools.ant.Target.performTasks(Target.java:411)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
at org.apache.tools.ant.Project.executeTarget(Project.java:1369)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1253)
at org.apache.tools.ant.Main.runBuild(Main.java:809)
at org.apache.tools.ant.Main.startAnt(Main.java:218)
... 2 more

Here is the contents of my build file


<project name="senchabuild" default="compile.web" basedir=".">
<property name="sencha.dir" value="${basedir}/senchaBuild" />
<property name="cmd.dir" value="${sencha.dir}"/>
<path id="sencha.classpath">
<fileset file="${sencha.dir}/sencha.jar" />
<fileset file="${sencha.dir}/lib/js.jar" />
</path>

<taskdef resource="com/sencha/ant/antlib.xml" classpathref="sencha.classpath" />

<target name="compile.web">

<property name="app.dir" location="${basedir}/webapps/sprite/evm" />
<property name="sdk.dir" location="${basedir}/webapps/sprite/extjs" />
<property name="out.dir" location="${basedir}/dist/out" />

<x-sencha-init/>


<x-sencha-command>
compile
# Include the app folder and the sdk/src folder
--classpath=${app.dir},${sdk.dir}/src


# Turn off debugging (comment next line to leave debug enabled):
--debug=true


page
# The application main page:
--in=${app.dir}/index.html


# The compiled page goes in build folder along with "all-classes.js":
--out=${out.dir}/index.html
</x-sencha-command>
</target>
</project>

hkelsey
29 Nov 2012, 2:59 AM
java 6/7 ships with a bundled but incomplete version of rhino which was causing the conflict.
Adding -Xbootclasspath/a:path/to/rhino-1.7R3.jar to ANT_OPTS will fix the issue. Hope this saves someone some time.

DiscoBoy
30 Nov 2012, 7:47 PM
I'm also having huge problems with Sencha CMD. From working with other jar files in ANT, I'm used to drop them into my repository structure (under version control) and add put a classpath for them in my build.xml to load their functionality. I'm really not happy with the quite complicated way of Sencha. So of course I also installed Sencha CMD, moved the folder into my project and then tried to setup my build.xml.I want to get it running without setting a PATH and I wonder what I actually need to set!?

It fails at the point where I execute any x-command with:


parsing buildfile D:\project\build\build.xml with URI = file:/D:/project/build/build.xml
Project base dir set to: D:\project
[antlib:org.apache.tools.ant] Could not load definitions from resource org/apache/tools/ant/antlib.xml. It could not be found.
[property] Loading D:\project\build\build.settings
[property] Loading Environment env.
parsing buildfile jar:file:/D:/project/build/sencha-cmd-3.0.0/sencha.jar!/com/sencha/ant/antlib.xml with URI = jar:file:/D:/project/build/sencha-cmd-3.0.0/sencha.jar!/com/sencha/ant/antlib.xml
parsing buildfile jar:file:/D:/project/build/sencha-cmd-3.0.0/lib/ant-contrib-1.0b3.jar!/net/sf/antcontrib/antlib.xml with URI = jar:file:/D:/project/build/sencha-cmd-3.0.0/lib/ant-contrib-1.0b3.jar!/net/sf/antcontrib/antlib.xml
[macrodef] creating macro x-make-url-param
[macrodef] creating macro x-git-current-hash
[macrodef] creating macro x-jsduck-param
[macrodef] creating macro x-scp
[macrodef] creating macro x-shell

BUILD FAILED
java.lang.NoSuchMethodError: org.apache.tools.ant.PropertyHelper.setNewProperty(Ljava/lang/String;Ljava/lang/Object;)V
at com.sencha.ant.InitTask$1.each(InitTask.java:38)
at com.sencha.util.Configuration.each(Configuration.java:96)
at com.sencha.util.Configuration.each(Configuration.java:139)
at com.sencha.ant.InitTask.doExecute(InitTask.java:35)
at com.sencha.ant.BaseAntTask.execute(BaseAntTask.java:22)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:357)
at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:142)
at org.eclipse.ant.internal.core.ant.InternalAntRunner.parseBuildFile(InternalAntRunner.java:347)
at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:633)
at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:495)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.ant.core.AntRunner.run(AntRunner.java:378)
at org.eclipse.ant.internal.launching.launchConfigurations.AntLaunchDelegate$1.run(AntLaunchDelegate.java:298)
at java.lang.Thread.run(Unknown Source)

greatfanofpats
3 Dec 2012, 10:09 AM
I did not see this problem when I used sencha build with ant version of 1.8.1. May be for now if you are ok, just upgrade to ant 1.8.1 for a quick work. ~o)

But this needs to be fixed, I am still looking any other alternatives.:-?

dongryphon
3 Dec 2012, 1:17 PM
I'm also having huge problems with Sencha CMD. From working with other jar files in ANT, I'm used to drop them into my repository structure (under version control) and add put a classpath for them in my build.xml to load their functionality. I'm really not happy with the quite complicated way of Sencha. So of course I also installed Sencha CMD, moved the folder into my project and then tried to setup my build.xml.I want to get it running without setting a PATH and I wonder what I actually need to set!?

Sencha Cmd is not exactly just a JAR file as you've noticed. We have to manage several native executables under-the-covers as well as deal with other dependencies (like Rhino and others). In order to work for folks that aren't native Ant users we provide all of the pieces, even Ant itself.

Depending on what commands you are using, Cmd will not need nearly all of what it installs, but since we ship Ant 1.8.2 in the box, we do have plenty of code that is probably implicitly depending on at least a 1.8 level of Ant. I don't see that we can reduce this because there are things we use (like "local" variables in macrodefs) that require at least 1.8.

There should be no need to add Cmd to the PATH in this case. Your process of gather the install folder and placing it in a folder of your project should work. I will see if we can add a more helpful Ant version check to x-sencha-init.

We hope to expand the targeted use cases of Cmd to include Maven deployment as an option. In this current version, we do want to hear any specific problems you encounter using sencha.jar directly in Ant. Our generated build scripts go through some steps to "boot up" sencha.jar and deal with its configurations, framework plugins etc. so that can hopefully serve as an example.

dongryphon
3 Dec 2012, 1:17 PM
I did not see this problem when I used sencha build with ant version of 1.8.1. May be for now if you are ok, just upgrade to ant 1.8.1 for a quick work. ~o)

But this needs to be fixed, I am still looking any other alternatives.:-?

Good catch on the Ant version issue. By "needs to be fixed" are you meaning the Ant version requirement?

DiscoBoy
3 Dec 2012, 1:44 PM
Ok, very good to know that ANT 1.8.2 seems to be a requirement. The Eclipse version I use still ships ANT 1.71, so using a newer Eclipse might be a solution. I will try as soon as I find time. I really would appreciate if one could use Sencha CMS just like another *.jar file - the same as I used Sencha SDK, especially after you have an Eclipse Plugin by your own (which is unfortunately not buyable as standalone by the way!)

I understand that Sencha CMD needs to make some internal setup, but I can't see any reason why the Eclipse ANT can't be used (as long as it is the right version). I hope that the future development of Sencha CMD will respect this use case.

Gjslick
16 Dec 2012, 1:53 PM
I have the same requirement as described in this thread. I want to be able to commit the sencha.jar file (and its dependencies) into our repository, and execute it as part of our Ant build. Reasons being are:
Going through the process of getting new software installed on our production deployment server is more than anyone can stand (and with no guarantees of permission), and
I would like for all of my developers to be able to simply check out the project and run a build without having to install the Sencha Cmd utility separately.
Currently, we are only using the compile command of the utility, and I seem to be able to get it running in a minimal test app with simply this:


<?xml version="1.0" encoding="utf-8"?>
<project name="SenchaCmdTestApp" default="page">

<target name="init">
<property name="cmd.dir" value="lib" />
<taskdef resource="com/sencha/ant/antlib.xml" classpath="${cmd.dir}/sencha.jar"/>
</target>

<target name="page" depends="init">
<x-sencha-command>
compile
...
</x-sencha-command>
</target>
</project>


where the sencha.jar file is in a sub-directory called lib/ (all of the other jars in our project directory exist there), and the libraries it depends on are in lib/lib/ (where the second lib/ doesn't seem to be configurable... line 10 of com/sencha/ant/antlib.xml)

I get the same NullPointerException as the OP, until I add a sencha.cfg file into lib/. This file can even be blank. It seems that this sencha.cfg file should not be required for this use case.

-----------------------------------------------

I suppose what I'm asking for are two things:
Don't require a sencha.cfg file to exist in ${cmd.dir} (I'm glad to have found this thread just to know that this was the cause of the NullPointerException), and
Support the use case of being able to execute Sencha Cmd directly from Java / Ant as much as possible without having to install 3rd party utilities, such as Ruby for Sass compilation. Perhaps JRuby can be used?
By the way, my team unfortunately lives in the highly annoying world where everyone is developing on Windows, but our deployment server is Linux... So this would be another great reason to be able to simply execute a .jar file directly!

dongryphon
16 Dec 2012, 2:49 PM
I will have to look at the consequences of not having sencha.cfg.

On the JAR interface side, you can already "just execute the jar" :) The main class is specified in the manifest. Are you having other issues with "java -jar sencha.jar" ? That is what the CLI wrappers are doing (well, that and some version checking and JVM argument extraction from sencha.cfg).

dongryphon
16 Dec 2012, 2:51 PM
As for the Compass, Ruby, SASS dependency... You can disable this piece of the build by setting "skip.sass=1". Of course that will just move the SASS build problem to some other location but you can check in the CSS results of that build step as long as you keep it updated when the SASS changes (like when the framework is upgraded).

Gjslick
16 Dec 2012, 7:49 PM
Don,

Right, I'm not really having any problems executing the jar itself for a compile task, except for the NullPointerException when a sencha.cfg file doesn't exist in the directory of the jar :) And this would be something that you just had to know needed to exist, which is obviously a problem for developers who are setting this up.

But, it would be great to be able to compile SASS without the Ruby dependency. That's why I mentioned perhaps including the JRuby jar and invoking it from the Sencha Cmd utility. I'm not sure what exactly that might entail (or if it's even possible to get the SASS compiler to be packaged and execute this way), but might be worth looking into.

Unfortunately, installing Ruby is a big hurdle to get over, at least in the corporate world where your development machine is on lockdown and only approved applications may be installed. And I'm sure the next hurdle to get over after that would be talking them into allowing the gem installer to have access to the repositories... (I've had problems like that in the past with similar package manager utilities.) But, all in all, most shops have Java, and if we could write our build process where all one has to do is simply check out the branch and run the build without first having to install a bunch of 3rd party utilities, then we'd most prefer that.

-Greg

mnesarco
23 Apr 2013, 9:48 AM
1. Define some properties



<properties>
<sencha.cmd.ver>3.1.1.274</sencha.cmd.ver>
<sencha.cmd.dir>${user.home}/bin/Sencha/Cmd/${sencha.cmd.ver}</sencha.cmd.dir>
</properties>


2. Call the sencha executable



<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<echo message="Sencha Cmd Version: ${sencha.cmd.ver}" />
<echo message="Sencha Cmd Home: ${sencha.cmd.dir}" />
<exec dir="${basedir}/src/main/webapp" executable="${sencha.cmd.dir}/sencha">
<arg value="app"/>
<arg value="build"/>
<arg value="package"/>
</exec>
</tasks>
</configuration>
</execution>
</executions>
</plugin>

DiscoBoy
25 Apr 2013, 3:05 AM
I finally made it starting to compile, at least I get some trailing comma warnings...
But then, (3.1.1) suddenly stops with a "java.lang.OutOfMemoryError: Java heap space" error. I'm using it with JRE7 from within Eclipse and the following ANT script:



<property name="cmd.dir" location="build/lib/sencha-cmd-${senchaCMD}" />
<taskdef resource="com/sencha/ant/antlib.xml" classpath="${cmd.dir}/sencha.jar" />
<x-extend-classpath>
<jar path="${cmd.dir}/sencha.jar" />
</x-extend-classpath>
<x-sencha-init prefix="" />

<!-- Sencha Compile -->
<target name="compile">
<property name="app.dir" location="${basedir}/app" />
<property name="sdk.dir" location="${basedir}/lib/${extjs}" />
<property name="out.dir" location="${basedir}/tests" />

<x-sencha-command>
compile
--classpath=${app.dir},${sdk.dir}
--debug=true
page
--yui
--in=../build.html
--out=${out.dir}/index.html
</x-sencha-command>
</target>


I have no .sencha configuration folder in my project as this was previously stopping any compilation with a NULLPointer exception. Is this cfg folder realy necessary?

This is the HTML file I use for the compilation:



<html>
<head>
<!-- Stylesheets -->
<link rel="stylesheet" type="text/css" href="lib/ext-4.1.1a/resources/css/ext-all-gray.css" />
<link rel="stylesheet" type="text/css" href="resources/global/css/application.css" />

<!-- Scripts -->
<script type="text/javascript">appConfig={dev:false}</script>

<!-- <x-compile> -->
<!-- <x-bootstrap> -->
<script type="text/javascript" src="lib/ext-4.1.1a/ext-debug.js"></script>
<!-- </x-bootstrap> -->
<script type="text/javascript" src="dev.js"></script>
<!-- </x-compile> -->

</head>
</html>

jonathanmv
24 Jul 2013, 1:19 PM
Hi,

Has anyone tried to run sencha app build from a Jenkins Job?
I'm stuck with this. I would like to define a job in Jenkins to run the sencha app build command in order to get the built package of my extjs app.

Here's the command I run as 'Execute Shell' in the build section:



chdir ${WORKSPACE}
export PATH=/home/jonathanmv/bin/Sencha/Cmd/3.1.2.342:$PATH
export SENCHA_CMD_3_0_0="/home/jonathanmv/bin/Sencha/Cmd/3.1.2.342"
sencha app build

and this is the output I get from the Failed build:



Started by user anonymous
Building in workspace /var/lib/jenkins/jobs/JenkinsTest/workspace
[workspace] $ /bin/sh -xe /tmp/hudson6041604974211107502.sh
+ chdir /var/lib/jenkins/jobs/JenkinsTest/workspace
+ export PATH=/home/jonathanmv/bin/Sencha/Cmd/3.1.2.342:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
+ export SENCHA_CMD_3_0_0=/home/jonathanmv/bin/Sencha/Cmd/3.1.2.342
+ sencha app build
[INF] Including theme package ext-theme-classic for app.theme=ext-theme-classic build
Sencha Cmd v3.1.2.342
[INF]
[INF] init-plugin:
[INF]
[INF] cmd-root-plugin.init-properties:
[INF]
[INF] init-properties:
[INF]
[INF] init-sencha-command:
[INF]
[INF] init:
[INF]
[INF] app-build-impl:
[INF]
[INF] -before-init-local:
[INF]
[INF] -init-local:
[INF]
[INF] -after-init-local:
[INF]
[INF] init-local:
[INF]
[INF] find-cmd:
[INF]
[INF] -before-init:
[INF]
[INF] -init:
[INF] Initializing Sencha Cmd ant environment
[INF] Including theme package ext-theme-classic for app.theme=ext-theme-classic build
[INF] Adding antlib taskdef for com/sencha/command/compass/ant/antlib.xml
[INF] [x-load-properties] Loading optional properties file /var/lib/jenkins/jobs/JenkinsTest/workspace/.sencha/app/production.properties
[INF] [x-load-properties] Loading required properties file /var/lib/jenkins/jobs/JenkinsTest/workspace/.sencha/app/build.properties
[INF]
[INF] -after-init:
[INF]
[INF] -before-init-default:
[INF]
[INF] -init-default:
[INF]
[INF] -after-init-default:
[INF]
[INF] init:
[INF]
[INF] -before-build:
[INF]
[INF] page:
[INF]
[INF] -before-page:
[INF]
[INF] -page:
[INF] Including theme package ext-theme-classic for app.theme=ext-theme-classic build
[INF] Including theme package ext-theme-classic for app.theme=ext-theme-classic build
[INF] Compiling page full-page
[ERR] Error executing page compilation com.sencha.exceptions.BasicException: Cannot find file: /var/lib/jenkins/jobs/JenkinsTest/workspace/sencha-compile-temp-dir/8c241e1e-9d9b-448e-9c9c-9a9b938e5eaa/script-file-1.js
[ERR]
[ERR] BUILD FAILED
[ERR] com.sencha.exceptions.ExBuild: com.sencha.exceptions.ExBuild: com.sencha.exceptions.BasicException: Cannot find file: /var/lib/jenkins/jobs/JenkinsTest/workspace/sencha-compile-temp-dir/8c241e1e-9d9b-448e-9c9c-9a9b938e5eaa/script-file-1.js
[ERR]
[ERR] Total time: 2 seconds
[ERR] The following error occurred while executing this line:
/var/lib/jenkins/jobs/JenkinsTest/workspace/.sencha/app/build-impl.xml:596: The following error occurred while executing this line:
/var/lib/jenkins/jobs/JenkinsTest/workspace/.sencha/app/build-impl.xml:556: com.sencha.exceptions.ExBuild: com.sencha.exceptions.ExBuild: com.sencha.exceptions.BasicException: Cannot find file: /var/lib/jenkins/jobs/JenkinsTest/workspace/sencha-compile-temp-dir/8c241e1e-9d9b-448e-9c9c-9a9b938e5eaa/script-file-1.js
Build step 'Execute shell' marked build as failure
Finished: FAILURE

Could somebody guide me please? Maybe I am focusing on the wrong things or missing the obvious ones.

Thank you in advance

dongryphon
29 Jul 2013, 1:00 PM
and this is the output I get from the Failed build:



Started by user anonymous
Building in workspace /var/lib/jenkins/jobs/JenkinsTest/workspace
[workspace] $ /bin/sh -xe /tmp/hudson6041604974211107502.sh
+ chdir /var/lib/jenkins/jobs/JenkinsTest/workspace
+ export PATH=/home/jonathanmv/bin/Sencha/Cmd/3.1.2.342:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
+ export SENCHA_CMD_3_0_0=/home/jonathanmv/bin/Sencha/Cmd/3.1.2.342
+ sencha app build
[INF] Including theme package ext-theme-classic for app.theme=ext-theme-classic build
Sencha Cmd v3.1.2.342
[INF]
...
[INF] Compiling page full-page
[ERR] Error executing page compilation com.sencha.exceptions.BasicException: Cannot find file: /var/lib/jenkins/jobs/JenkinsTest/workspace/sencha-compile-temp-dir/8c241e1e-9d9b-448e-9c9c-9a9b938e5eaa/script-file-1.js
[ERR]
[ERR] BUILD FAILED


Could somebody guide me please? Maybe I am focusing on the wrong things or missing the obvious ones.

Thank you in advance

Looks like the index.html content is having some troubles. The script-file-1.js file is generated from the x-compile block of your page. Can you provide that here?

Also, does your build run locally? If so, it may be some kind of permissions issue - maybe Cmd was unable to write the file and that later causes the file not found issue. Hard to say for sure here but starting with a locally runnable build is key.