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?

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.

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

Thanks

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.

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.

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: