Hi Kangula,

> I frequently have to modify some classes to make Production Build.
> 
> Is there a way to pass parameter or any other solution in your mind at build
> time to tell us that it is Production version. I use source version for
> development. 
> 
> I need a condition to check that the call is coming from Development or
> Production.
For this purpose you can use Variants to differ from your production and 
your development version. Just take a look at the wiki page located at 
<http://qooxdoo.org/documentation/0.7/variants> to get to know how the 
Variants work.

> E.g.,
> //var tableModel = new MyRemoteTableModel(qx.io.remote.Rpc.makeServerURL(),
> "getRowCount", "getData", this); <---- PROD
> var tableModel = new
> MyRemoteTableModel("http://localhost:8080/myService/.qxrpc";, "getRowCount",
> "getData", this); <--- DEV
If you use variants you can e.g. write the following code:

--snip--
if (qx.core.Variant.isSet("MYAPP.mode", "production")
{
   var tableModel = new MyRemoteTableModel(qx.io.remote.Rpc.makeServerURL(),
"getRowCount", "getData", this);
}
else
{
var tableModel = new
MyRemoteTableModel("http://localhost:8080/myService/.qxrpc";, 
"getRowCount", "getData", this);
}
--snip--

You could then set the variant value in the three ways as described at 
the wiki page to build your development and your production version and 
won't be forced to switch the lines anymore because the generated code 
would only contain the code of the variant you defined using the generator.


cheers,
   Alex


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to