PDA

View Full Version : Location of the touch directory



12ftguru
17 Dec 2012, 10:37 AM
I have updated to the 3.0.0.250 of the Sencha Cmd tool and I was doing a few quick tests with Sencha Touch 2.1 and the Sencha Cmd tool. I used the generate app command as follows:


sencha -sdk-path /Applications/MAMP/htdocs/reusable/sencha-touch-2.1 generate app test /Applications/MAMP/htdocs/Test

Unlike previous versions, it seems that this one generates the touch directory with all of the SDK files, in the parent directory of application itself. This means the app.js file is now looking for the Sencha Touch sdk in


Ext.Loader.setPath({
'Ext': '../touch/src',
'test': 'app'
});

Same for the index.html file. Unfortunately, in my case, my Apache development environment looks at the individual application directory as a root web folder and does not see any of the directories above it. So in the above example, I point my browser to http://test.dev to view the site. Since the touch directory is inaccessible to the site, it errors out.

I know I can manually move things around, change file paths or even re-write my vhosts file to fix this. However, my questions are:


What is the logic behind moving the SDK directory in the first place?
Is there any way to override this in the command line itself?

12ftguru
18 Dec 2012, 11:59 AM
So as it turns out, this was an error on my part (big surprise).

When you generate a new application, there is a .sencha folder that gets created in the application directory (invisible from the OSX Finder). Sencha Cmd considers a directory containing this folder to be a workspace (http://docs.sencha.com/touch/2-1/#!/guide/command_workspace). This allows you to generate multiple apps within a single directory (good for complex multi-page sites). Each app generated into the workspace folder will share a single touch directory.

A while back, I had accidentally generated a new application in my main code directory, instead of the target folder inside the the code directory. I didn't think much about it and just moved the folders into the directory I had originally intended to use.

As you might guess, I totally missed the invisible .sencha folder. This made Sencha Cmd think I was inside a workspace and thus attempt to generate a shared touch directory in the main code directory.

Big kudos to Peter and Don for their help with this. I would never have figured this out without them.

Trozdol
30 Nov 2013, 3:44 PM
Thanks for posting this! I wasn't sure if that was my problem for sure but after you told your story I remembered screwing up and generating an app my /user/ directory. I was finally able to generate a ST app with the touch folder in the app folder. Thanks! :D