-
30 Nov 2012 7:47 PM #11
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:
Code: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)
-
3 Dec 2012 10:09 AM #12
Upgrade ant to 1.8.1
Upgrade ant to 1.8.1
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.

But this needs to be fixed, I am still looking any other alternatives.
-
3 Dec 2012 1:17 PM #13
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.Don Griffin
Ext JS Development Team Lead
Check the docs. Learn how to (properly) report a framework issue and a Sencha Cmd issue
"Use the source, Luke!"
-
3 Dec 2012 1:17 PM #14
Don Griffin
Ext JS Development Team Lead
Check the docs. Learn how to (properly) report a framework issue and a Sencha Cmd issue
"Use the source, Luke!"
-
3 Dec 2012 1:44 PM #15
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.
-
16 Dec 2012 1:53 PM #16
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.
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)Code:<?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>
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?
-
16 Dec 2012 2:49 PM #17
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).Don Griffin
Ext JS Development Team Lead
Check the docs. Learn how to (properly) report a framework issue and a Sencha Cmd issue
"Use the source, Luke!"
-
16 Dec 2012 2:51 PM #18
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).
Don Griffin
Ext JS Development Team Lead
Check the docs. Learn how to (properly) report a framework issue and a Sencha Cmd issue
"Use the source, Luke!"
-
16 Dec 2012 7:49 PM #19
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
-
23 Apr 2013 9:48 AM #20
[SOLVED] Sencha Touch and Maven
[SOLVED] Sencha Touch and Maven
1. Define some properties
2. Call the sencha executableCode:<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>
Code:<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>
Thank you for reporting this bug. We will make it our priority to review this report.


Reply With Quote

