1. #1
    Sencha User
    Join Date
    Mar 2007
    Posts
    442
    Vote Rating
    18
    jweber will become famous soon enough

      0  

    Default Conditional compilation

    In Sencha's code, there are some sections that are conditionally compiled; for example:

    Code:
    //<feature logger>
    ...
    //</feature>
    Based on another thread, I found that I can control this by adding "app.preprocessor.opts=logger:true" to my sencha.cfg.

    How can I create my own "features" and turn them on/off? I tried "app.preprocessor.opts=logger:true,custom:false", and wrapping the code in <feature custom> tags, but it was still included.

  2. #2
    Ext JS Premium Member burnnat's Avatar
    Join Date
    Jun 2011
    Posts
    418
    Vote Rating
    63
    burnnat is just really nice burnnat is just really nice burnnat is just really nice burnnat is just really nice

      0  

    Default

    I'd be interested in doing this too - I'm hoping this feature isn't just internal-only...

  3. #3
    Sencha User
    Join Date
    Mar 2007
    Posts
    442
    Vote Rating
    18
    jweber will become famous soon enough

      0  

    Default

    Any Sencha folks know if this is possible? Thanks.

  4. #4
    Sencha User
    Join Date
    Mar 2007
    Posts
    442
    Vote Rating
    18
    jweber will become famous soon enough

      1  

    Default

    OK, if anyone else is interested, I figured this out. You can define additional "features" in the Ant property "build.options". For example, if you set this in build.properties:

    Code:
    build.options=foo:on,bar:off${build.options.debug},${build.options.logger},${build.options.minVersion},${build.options.product}
    Then you can do this in your code:

    Code:
    //<feature foo>
    	foo
    //</feature>
    //<feature bar>
    	bar
    //</feature>
    and only "foo" will appear.

    Unfortunately this is yet another aspect of Sencha Cmd that's poorly documented and difficult to configure.

  5. #5
    Sencha Premium Member
    Join Date
    Nov 2014
    Posts
    4
    Vote Rating
    0
    anishmathew.tech is on a distinguished road

      0  

    Default

    How to control the feature through ant. (build.xml )

Thread Participants: 2

Tags for this Thread