1. #1
    Sencha User
    Join Date
    Jun 2012
    Posts
    7
    Vote Rating
    0
    jserna is on a distinguished road

      0  

    Default Changing Build Directory!

    Changing Build Directory!


    Hi all!

    I have tried to change the build directory, but I can´t. I am working on a workspace and I see that there are a property in sencha.cfg called workspace.build.dir. I set its value to ${workspace.dir}/${app.name}, so if my app is MyApp, it generates the directory

    ${workspace.dir}/MyApp/production/
    ${workspace.dir}/MyApp/test/
    ...

    Anyone knows how to avoid the environment name's directory (test, production, etc.)? And when I build, It generates the build without that directory?

    Thanks!

  2. #2
    Ext JS Premium Member powellke's Avatar
    Join Date
    Sep 2008
    Location
    Huntsville, AL
    Posts
    37
    Vote Rating
    5
    powellke is on a distinguished road

      2  

    Default


    In the file .sencha/app/build.properties, change build.dir to not include ${args.environment}.
    Also, in the file .sencha/workspace/sencha.cfg, set workspace.build.dir to just ${workspace.dir}. That way you won't have MyApp/MyApp.
    Last edited by powellke; 15 Mar 2013 at 7:52 PM. Reason: Needed to be a little more thorough in my answer.

  3. #3
    Sencha - Ext JS Dev Team dongryphon's Avatar
    Join Date
    Jul 2009
    Location
    Kansas
    Posts
    1,428
    Vote Rating
    151
    dongryphon is a splendid one to behold dongryphon is a splendid one to behold dongryphon is a splendid one to behold dongryphon is a splendid one to behold dongryphon is a splendid one to behold dongryphon is a splendid one to behold dongryphon is a splendid one to behold

      0  

    Default


    @powellke -

    Thanks! That is a +1 on that. We have an issue in the 3.0.x to 3.1 upgrade process that does not correct the workspace.build.dir property.

    Another way to correct all of that is to generate a fresh workspace in 3.1 and copy the .sencha/workspace folder over the one in your 3.0.x-generated workspace.

    In a Cmd 3.1-generated workspace, the .sencha/workspace/sencha.cfg looks like this:

    Code:
    #Fri, 15 Mar 2013 13:23:33 -0700
    # -----------------------------------------------------------------------------
    # This file contains configuration options that apply to all applications in
    # the workspace. By convention, these options start with "workspace." but any
    # option can be set here. Options specified in an application's sencha.cfg will
    # take priority over those values contained in this file. These options will
    # take priority over configuration values in Sencha Cmd or a framework plugin.
    
    # -----------------------------------------------------------------------------
    # This configuration property (if set) is included by default in all compile
    # commands executed according to this formulation:
    #
    #   sencha compile -classpath=...,${framework.classpath},${workspace.classpath},${app.classpath}
    
    #workspace.classpath=
    
    #------------------------------------------------------------------------------
    # This is the folder for build outputs in the workspace
    
    workspace.build.dir=${workspace.dir}/build
    
    #------------------------------------------------------------------------------
    # This folder contains all generated and extracted packages.
    
    workspace.packages.dir=${workspace.dir}/packages
    
    # =============================================================================
    # Customizations go below this divider to avoid merge conflicts on upgrade
    # =============================================================================
    
    workspace.cmd.version=3.1.0.239
    
    ext.dir=${workspace.dir}/ext
    Don Griffin
    Engineering Manager - Frameworks (Ext JS / Sencha Touch)

    Check the docs. Learn how to (properly) report a framework issue and a Sencha Cmd issue

    "Use the source, Luke!"

  4. #4
    Sencha User
    Join Date
    Jun 2012
    Posts
    7
    Vote Rating
    0
    jserna is on a distinguished road

      0  

    Default Thanks

    Thanks


    Hi,

    Thank you for the answer.

    But, I have some questions: What do you mean with the file ".sencha/app/build.properties"? We must create it? In that directory only exist three files: sencha.cfg, build-impl.xml and plugin.xml.

    I changed the args.environment property in
    build-impl.xml and that worked. The problem was that didn't create the cache.appcache file. I think, the reason is that SenchaCmd ask for the production's environment and then it create the cache.appcache file.

    Please, tell me where I am wrong. Thanks.

    Cheers.

  5. #5
    Ext JS Premium Member powellke's Avatar
    Join Date
    Sep 2008
    Location
    Huntsville, AL
    Posts
    37
    Vote Rating
    5
    powellke is on a distinguished road

      0  

    Default


    Sorry. That should have been .sencha/app/build-impl.xml.

  6. #6
    Sencha - Ext JS Dev Team dongryphon's Avatar
    Join Date
    Jul 2009
    Location
    Kansas
    Posts
    1,428
    Vote Rating
    151
    dongryphon is a splendid one to behold dongryphon is a splendid one to behold dongryphon is a splendid one to behold dongryphon is a splendid one to behold dongryphon is a splendid one to behold dongryphon is a splendid one to behold dongryphon is a splendid one to behold

      0  

    Default


    The build.properties file is produced for Ext JS 4.2 apps - for Ext JS 4.1 apps we did not move these out in to their own file.

    It is best to avoid changing build-impl.xml if possible. To set properties for your build, you can do that in the build.xml at the root folder like so:

    Code:
       <target name="-before-init">
           <property name="build.dir" location="${app.build.dir}"/>
       </target>
    That will set "build.dir" early and will take priority over the setting in build-impl.xml

    I will have to look into the appcache part here...
    Don Griffin
    Engineering Manager - Frameworks (Ext JS / Sencha Touch)

    Check the docs. Learn how to (properly) report a framework issue and a Sencha Cmd issue

    "Use the source, Luke!"

  7. #7
    Sencha Complete Member
    Join Date
    Dec 2010
    Posts
    92
    Vote Rating
    4
    ALEITZ is on a distinguished road

      0  

    Default Can you set the build.dir to an absolute path?

    Can you set the build.dir to an absolute path?


    I tried to set the build path to "c:\MyApp" without any success. Is this even possible?

    Thanks

  8. #8
    Sencha User
    Join Date
    Jan 2014
    Posts
    1
    Vote Rating
    0
    shwarup is on a distinguished road

      0  

    Default Create a new folder in production build

    Create a new folder in production build


    Hi Guys,

    I am using Sencha 4.2.2. By default my production build goes to "\MyApp\build\production\MyApp\index.html".
    I would like to change this production build path to "\MyApp\build\production\MyApp\secure\index.html"

    Please guide me how to create this secure folder for my production build.


    Thanks,
    Shwarup

  9. #9
    Sencha - Ext JS Dev Team dongryphon's Avatar
    Join Date
    Jul 2009
    Location
    Kansas
    Posts
    1,428
    Vote Rating
    151
    dongryphon is a splendid one to behold dongryphon is a splendid one to behold dongryphon is a splendid one to behold dongryphon is a splendid one to behold dongryphon is a splendid one to behold dongryphon is a splendid one to behold dongryphon is a splendid one to behold

      0  

    Default


    Hi shwarup -

    Since my last post on this Cmd has added granular properties files to make this easier. The "production.properties" file is loaded only for production builds so properties set in that file only get loaded for "sencha app build production" (or "sencha app build" alone since "production" is the default).

    To know what properties might be helpful, consult "defaults.properties" file but don't edit that file. Instead add your customized values to either build.properties (to affect all builds) or "production.properties" or "testing.properties" etc. for specific builds.

    In this case, build.dir is still the property to set. In "defaults.properties" there is this:

    Code:
    # the directory to place built application files
    build.dir=${workspace.build.dir}/${build.environment}/${app.name}
    So add this to your "production.properties" to do what you are wanting:

    Code:
    build.dir=${workspace.build.dir}/${build.environment}/${app.name}/secure
    Don Griffin
    Engineering Manager - Frameworks (Ext JS / Sencha Touch)

    Check the docs. Learn how to (properly) report a framework issue and a Sencha Cmd issue

    "Use the source, Luke!"