PDA

View Full Version : [FIXED] Overeager matching for -namespace



burnnat
10 Oct 2012, 6:05 AM
Running a test with the classes "Test.One", "Test.Two", "Test2.One", and "Test2.Two", I expected the following command to compile only the classes in the Test.* namespace:

sencha compile -classpath=ext/src,src union -namespace Test and metadata -filenames -json -out=list.json

However, the result includes the classes from the Test2.* namespace as well:

[
"src/Test2/One.js",
"src/Test2/Two.js",
"src/Test/One.js",
"src/Test/Two.js"
]

I'm guessing this is from an overeager regex match or similar, since "Test2" contains the "Test" substring. For now, I'm working around it with this command:

sencha compile -classpath=ext/src,src union -namespace Test and exclude -namespace Test2

Interestingly, some experimentation shows that this command will also work (forcing the namespace regex to end in a period, I assume):

sencha compile -classpath=ext/src,src union -namespace Test\.

dongryphon
12 Oct 2012, 11:49 PM
Thanks for the report! I have opened a bug in our bug tracker.

burnnat
26 Oct 2012, 10:35 AM
Thanks, Don. This seems to be working much better in 3.0.0.230, but I think the behavior is still not quite right. Consider the following situation:

Ext.define('Ux', {
singleton: true,

utilityMethod: function() {
// ... something ...
}
});

Ext.define('Ux.Child', {});
Ext.define('Ux.other.Child', {});

The command sencha compile union -namespace=Ux now only selects the child classes "Ux.Child" and "Ux.other.Child" but not the "Ux" utility singleton. Previously, this class would be included which I think is the correct behavior since it's still a member of the Ux namespace (namely, the root member).

dongryphon
28 Oct 2012, 5:35 PM
Thanks - I've reopened the ticket. You are correct in what the behavior should be there.