Ordering output. Send licence blurb to the top of the file. How to?

Ordering output. Send licence blurb to the top of the file. How to?

A compiler ultimately is all about writing useful output given some number of inputs. The concat command is designed to concatenate the source for the current set of files in the appropriate dependency order.

The one required parameter is -out, which indicates the name of the output file. There are other options, however, that effect the generated file. You can pick one of the following options for compression:

I am trying to achieve the "appropriate dependency order". The docs go on to talk about sets. Not how to order those sets?

The one required parameters is not present ?!! Is this is a doc error, is the one required parameter is concat ?

I find nothing else on the page that talks about controlling the order.

Seems to me in the prior version of Cmd, output followed the same order as the comma delimited list of classpaths. Or it did for me!

Excluding them by namespace and tags etc is okay but tedious when it would be faster to go the other way around: I only want to deal with two files.

The compiler is fundamentally about ordering of files based on dependencies that exist between them but also removing "anomalies" like the order in which the OS lists directories (for example a "*.js" listing or sub-folder order, etc.). These anomalies can cause serious cache and performance problems when "delta-patching" Sencha Touch applications.

The heart of that algorithm is based on http://en.wikipedia.org/wiki/Topological_sorting which is a fancy way to say that unless the two files have an explicit order specified between them, any order is valid. Stated another way: the classpath is not an ordered sequence in itself - it is an unordered set of files. The final order of the files is determined by the relationships internal to those files (as Mitchell pointed out).

So, if file B.js must follow file A.js and you are not using Ext.define/requires to specify the relationship, you can do this in B.js

Code:

//@require A.js
alert('beta');

I am not sure how (or if) this kind of simple example works in a development (non-build) scenario or if you care about that.

Originally Posted by stewardsencha

The docs fail for me at this point. I have read them nineteen times over two months. Why is it they are no good for reference? Because they lack the series of simple examples (cf Apache Ant pages).

Thanks for the feedback there - I will try to factor that in to the next iteration of updates.