Results 1 to 5 of 5

Thread: Determining Build configuration of a Sencha Touch and ExtJS project

  1. #1
    Sencha User
    Join Date
    Jul 2012
    Posts
    28
    Answers
    2

    Default Determining Build configuration of a Sencha Touch and ExtJS project

    In sencha touch you can build a project in any of the following build configuration
    1. production
    2. testing
    3. native
    4. package
    Is there any class/method/funciton in ST2 that returns the current build configuration name?Same goes for ExtJs

  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,379
    Answers
    3997

    Default

    So when you are in a build you want to know in your code what build it is? If so then no.
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

  3. #3
    Sencha User
    Join Date
    Jul 2012
    Posts
    28
    Answers
    2

    Default

    Quote Originally Posted by mitchellsimoens View Post
    So when you are in a build you want to know in your code what build it is? If so then no.
    Great. A nice short answer.

    Is there any way to set custom property?

    I know a hack though. Using sed some preconfigured class definition can be altered on runtime based on build configuration. But thats a dirty way I think. I was looking for a sencha way

  4. #4
    Sencha Premium User
    Join Date
    Mar 2010
    Location
    Romania
    Posts
    628
    Answers
    67

    Default

    In app.js you can use something like this:

    window.isDebug = false;
    //<debug>
    window.isDebug = true;
    //</debug>

    In the production build isDebug will be false

    Also the microloaders can be modified to set some global variable during the process.

  5. #5
    Sencha Premium Member
    Join Date
    Jan 2012
    Location
    California
    Posts
    10

    Default build configuration custom properties

    In app.json you can find this where you can set up custom properties for each environment:

    "production": {
    "property": "A"
    },

    "testing": {
    "property": "B"
    },

    "development": {
    "property": "C"
    }

    To access them you do: Ext.manifest.property

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •