View Full Version : [CLOSED] Sencha Cmd v3.0.0.190 does not use app.json buildpath settings

25 Oct 2012, 12:40 PM
Like the title says.
It will always create a build in a sub dir of the current working dir.

Running the OSX version by the way on mountain lion.

26 Oct 2012, 6:29 AM
We will be removing them as they are not used at all.

27 Oct 2012, 2:00 PM
Instead, why not implement it so it can be used ? :D
It seems usefull to me

28 Oct 2012, 5:54 AM
You can change this in the .sencha/app/build-impl.xml

6 Nov 2012, 3:43 AM
I'm used it :(

I'm using phonegap, and so, I want two separate builds for android and iOS.
So I have this in app.json:

"buildPaths": {
"testing": "build/testing",
"production": "build/production",
"package-ios": "build/ios/www",
"package-android": "build/android/assets/www",
"native": "build/native"

And, so, I can build my app like this:
sencha app build package-ios
sencha app build package-android

Now it's impossible. Is there a more correct way to do such thing?

6 Nov 2012, 4:41 AM
You can change this in the .sencha/app/build-impl.xml

like I said ^^

6 Nov 2012, 5:38 AM
Hehe, it's not so obvious :)

I found this in build-impl.xml:

<target name="production">
<property name="args.environment" value="production"/>

<target name="testing">
<property name="args.environment" value="testing"/>

<target name="native">
<property name="args.environment" value="native"/>

<target name="package">
<property name="args.environment" value="package"/>

Adding another target don't add target to valid targets list.

6 Nov 2012, 5:40 AM
Also, there is no any references to "path" or something like this in that file.
All "path" mentions are about .jar file paths which is obviously not what I need.

Sorry, my english is not very good )

6 Nov 2012, 9:55 AM
We REALLY need better documentation on this Sencha Cmd stuff. It changes all the time, and it's very unclear how we're supposed to use it.

7 Nov 2012, 12:26 AM
For you guys, who deal with the same problem here the solution:

As told above, buildPaths in app.json is no more used, so you can safely remove it.

But now we have build.xml in the root of the project, which is regular ant-tasks file.
So we can add our custom tasks:

I added this between <project> tags:

<target name="-after-build">
<copy todir="build/ios/www">
<fileset dir="build/PM/package"/>
<copy todir="build/android/assets/www">
<fileset dir="build/PM/package"/>

If you want file in other location, I think you can just add "move" files task. which will be move them to needed location.

Here is the list of available ant-tasks: http://ant.apache.org/manual/tasklist.html

12 Nov 2012, 3:01 AM
I second the need for better documentation given the big changes that have taken place between Sencha SDK toold and Sencha CMD v3.

Looks like I am getting a tonne of errors half way through running the command

-- sencha app build package -d /path/to/android/assets/www

Is there a new way to do this? I'm trying to figure this out. Am I doing this the correct way? Is there another file I have to edit to get things working?

When I have this figured out I'll update here.


27 Nov 2012, 2:50 AM
Cool, what about different copyto stuff for production/testing/package etc?

27 Nov 2012, 4:28 AM
I've made a bash script if I want a quick build, pretty dirty:

# Build project in $copytoFolder \ $1
# - Useful for preventing caching by changing URL each build
[ $# -lt 1 ] && ( echo -e "usage: $0 <buildName>\nusage: $0 <buildName> <optional:dontRemoveOlderBuilds=1>"; ) && exit 0;

#directory variables
appFolder=SenchaTestApp/ #where is the Sencha App relative to current folder
copytoFolder=~/Sites/sench_builds/ #where app should be build
buildName=TestApp #name from app.json

#build app
( [ -z "$2" ] || [ ! $2 -eq 1 ] ) && ( rm -R $copytoFolder; mkdir $copytoFolder; mkdir $copytoFolder$1;)
cd $appFolder
sencha app build -e production
mv build/$buildName/production/* ~/Sites/sench_builds/$1/

#cleanup leftover files from build
rm -R build
rm -R archive

#make apache's listing of sench_builds/index.html mobile-friendly
cd ~/Sites/sench_builds
echo 'HeaderName header.html' > .htaccess
echo '<style type="text/css">ul li { margin-top: 10px;font-size: 1.25em}</style>' > header.html

#show useful info
IP=`ifconfig en0 | grep "inet " | cut -d" " -f2`
echo "App build in: ~/Sites/sench_builds/$1, IP: $IP"

26 Jan 2013, 3:38 PM
Before I forget... for people who just want for files to be put in a different folder, just edit your .sencha/app/sencha.cfg file
and add something like this

I like my src folder to be clean ;)