Hybrid View
-
29 Sep 2012 8:42 AM #1
sencha compile and include -r option
sencha compile and include -r option
The new compiler is pretty neat!
I am trying to build custom application 'bundles' using 'sencha compile'.
This is working (using include/union with a class)
But this is not (using include/union with a file) = the result file is emptyCode:sencha -d compile -cl=ext/src,app union -r -c app.MyClass and metadata -f -o bundle1.txt
bundle1.js only includes this as a testCode:sencha -d compile -cl=ext/src,app union -r -f bundle1.js and metadata -f -o bundle1.txt
Code://@require app.MyClass
Shouldn't this work?
-
29 Sep 2012 12:41 PM #2
That looks about right yes. What does the debug log look like? Using "sencha -d ..." or "sencha -debug ..." you should get some helpful output to see what might be going on internally.
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!"
-
29 Sep 2012 12:44 PM #3
You might also consider using tags to create bundles (if namespaces don't work).
Adding tags is similar but they are added to the source:
Then you can use "union -r -tag foo" to get all classes with the 'foo' tag and their dependencies.Code://@tag foo,bar,jazz Ext.define(...
Of course, the approach you are trying should also work
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!"
-
29 Sep 2012 6:09 PM #4
This is the log output
Code:Sencha Cmd v3.0.0.181 [DEBUG] found sencha.cfg at C:\project\support\sencha\Cmd\3.0.0.181 [DEBUG] found workspace at C:\project\client\.sencha\workspace [DEBUG] found app at C:\project\client\.sencha\app [DEBUG] loading framework config from C:\project\client/extjs [DEBUG] found cmd at C:\project\client\extjs\cmd [DEBUG] Checking for framework config overrides [DEBUG] resolving framework config overrides for 'ext' [DEBUG] Detected framework version 4.1.1 [DEBUG] detected framework override at 'C:\project\support\sencha\Cmd\3.0.0.181\plugins\ext\current' [DEBUG] using framework config override 'C:\project\support\sencha\Cmd\3.0.0.181\plugins\ext\current' [DEBUG] Creating temporary directory C:\project\client\sencha-compile-temp-dir [DEBUG] loading class paths... [INFO ] Processing classPath entry : C:\project\client\sencha-compile-temp-dir [INFO ] Processing classPath entry : ext\src [INFO ] Processing classPath entry : app [INFO ] Processing classPath entry : C:\project\client\extjs\src [INFO ] Processing classPath entry : C:\project\client\classes [DEBUG] calculating dependency graph... [DEBUG] Loading implicit dependencies file C:\project\support\sencha\Cmd\3.0.0.181\plugins\ext\current\implicitClassDependencies.json [DEBUG] Adding implicit dependency for Ext.Component [DEBUG] Adding implicit dependency for Ext.container.AbstractContainer [DEBUG] Adding implicit dependency for Ext.data.Model [DEBUG] Adding implicit dependency for Ext.data.proxy.Proxy [DEBUG] Adding implicit dependency for Ext.data.proxy.Proxy ... [INFO ] Processing class inheritance graph [INFO ] Processing instantiation refereces to classes and aliases [DEBUG] Detected instantiation reference to widget.tbfill in file C:\project\client\extjs\src\toolbar\Toolbar.js ... [INFO ] Processing source dependencies [DEBUG] processing 656 source files [DEBUG] Processing dependencies for file: AbstractComponent.js [DEBUG] Processing dependencies for file: ComponentQuery.js [DEBUG] Processing dependencies for file: ComponentManager.js [DEBUG] Processing dependencies for file: AbstractManager.js [DEBUG] Processing dependencies for file: HashMap.js [DEBUG] Processing dependencies for file: Ext.js [DEBUG] Processing dependencies for file: Base.js [DEBUG] Processing dependencies for file: Date.js [DEBUG] Processing dependencies for file: Object.js [DEBUG] Processing dependencies for file: Function.js ... [DEBUG] Processing dependencies for file: Application.js [DEBUG] Processing dependencies for file: AbstractApplication.js [DEBUG] Processing dependencies for file: Tools.js ... [DEBUG] Processing dependencies for file: ToolbarItemFactory.js [DEBUG] Processing dependencies for file: Widget.js [DEBUG] Processing dependencies for file: YearField.js [DEBUG] dependency graph calculated [DEBUG] loading cache filters [DEBUG] filtering cache [DEBUG] enabling transitive dependencies [INFO ] Concatenating output to file bundle1.txt [DEBUG] removing tempdir C:\project\client\sencha-compile-temp-dir
Thx for the suggestion to use tags. I think I can make good use of it.
The tag tags the entire file, not just the Ext.define that follows, right?
Are there other compiler macros available? I have seen '@require' and '@define'.
Can we mark parts of a file to be ignored (excluded) by the compiler, maybe based on tags?
Can we tell the compiler to ignore certain 'require' statements that are only used during development to instruct Ext.Loader?
I guess we could use Ext.require statements that are not supported by the compiler (e.g. Ext.require(varName), but maybe there is a better way.
Also, we used JsBuilder statements like //<debug> and also added our own statement to include/exclude profiling code via //<profile>. I see the new compiler still supports //<debug> but does it also support //<if option>?
I think we can implement most of our requirements to use tags and file based selection. It would still be nice to get some feedback on the details of the new compiler.
Thx!
-
29 Sep 2012 7:34 PM #5
For details on the compiler, see the http://docs.sencha.com/ext-js/4-1/#!...mmand_compiler guide. There are some TODO's in there to wrap up before GA, but I think it covers what you are asking.
The directives like "//<debug>" and "//<if>" can eliminate code during compilation, but not (currently) dependencies. So using these in a "requires" array won't have the desired effect.
We are migrating as much of the build process as possible out of the internals of Sencha Cmd and into build scripts that you can see and/or edit (plus configure via properties). At present we don't have a way for you to inject "excludes" into the application compile step, but we plan to address this part before GA. This piece is logged as SDKTOOLS-176.
If the guide does not answer your question(s), please feel free to start a thread and describe what is wrong/missing in the guide so we can fix those bugs as well. It is obviously a critical aspect to such an endeavor to have reliable documentation. We have really stressed that in this version.
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!"
-
29 Sep 2012 7:39 PM #6
Looking at the log output it is not really apparent why you aren't getting any files in your compilation. You can try the "--trace" option to get even more output but please be prepared for a flood of messages... in fact you will surely want to direct it to a file

Kevin (the "compiler guy") may have some ideas next week.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!"
Thank you for reporting this bug. We will make it our priority to review this report.


Reply With Quote