Skip to content
Browse files

Fixed #18 - Updated build instructions for Sencha Touch 2.1 and Sench…

…a Cmd.
  • Loading branch information...
1 parent 34b4e68 commit e2262d2c8fe2325fa14dc472afc4ae26fa753a95 @wnielson committed
View
237 .sencha/.sencha/app/build-impl.xml
@@ -0,0 +1,237 @@
+<?xml version="1.0" encoding="utf-8"?>
+<project>
+ <!--
+ Init-Local
+ -->
+ <target name="-before-init-local"/>
+ <target name="-init-local">
+ <property file="${basedir}/../../local.properties"/>
+
+ <script language="javascript">
+ var f = new java.io.File(project.getProperty("basedir"));
+ var sub = ".sencha/workspace/sencha.cfg";
+
+ for (var p = f; p; p = p.getParentFile()) {
+ var t = new java.io.File(p, sub);
+ if (t.exists()) {
+ // we found the workspace folder!
+
+ t = new java.io.File(p, "local.properties");
+ if (t.exists()) {
+ var loader = project.createTask("property");
+ loader.setFile(new java.io.File(t.getCanonicalPath()));
+ loader.execute();
+ }
+
+ break;
+ }
+ }
+ </script>
+ </target>
+ <target name="-after-init-local"/>
+ <target name="init-local"
+ depends="-before-init-local,-init-local,-after-init-local"/>
+
+ <!--
+ Find Sencha Cmd
+ -->
+ <target name="find-cmd" unless="cmd.dir">
+ <!--
+ Run "sencha which" to find the Sencha Cmd basedir and get "cmd.dir" setup. We
+ need to execute the command with curdir set properly for Cmd to pick up that we
+ are running for an application.
+ -->
+ <exec executable="sencha" dir="${basedir}">
+ <arg value="which"/><arg value="-o=$cmddir$"/>
+ </exec>
+
+ <!-- Now read the generated properties file and delete it -->
+ <property file="$cmddir$"/>
+ <delete file="$cmddir$"/>
+
+ <echo>Using Sencha Cmd from ${cmd.dir}</echo>
+ </target>
+
+ <!--
+ Init
+ -->
+ <target name="-before-init"/>
+ <target name="-init">
+ <taskdef resource="com/sencha/ant/antlib.xml" classpath="${cmd.dir}/sencha.jar"/>
+ <x-sencha-init prefix=""/>
+
+ <!-- initialize the build.dir property from the workspace config after we've loaded it -->
+ <property name="build.dir" location="${workspace.build.dir}"/>
+
+ <!-- Some operations require sencha.jar in the Ant classpath -->
+ <x-extend-classpath>
+ <jar path="${cmd.dir}/sencha.jar"/>
+ </x-extend-classpath>
+ </target>
+ <target name="-after-init"/>
+ <target name="init"
+ depends="init-local,find-cmd,-before-init,-init,-after-init"/>
+
+ <!--
+ Clean
+ -->
+ <target name="-before-clean"/>
+ <target name="-clean">
+ <delete dir="${build.dir}"/>
+ </target>
+ <target name="-after-clean"/>
+ <target name="clean"
+ depends="init,-before-clean,-clean,-after-clean"
+ description="Removes all build output produced by the 'build' target"/>
+
+ <!--
+ Build SASS
+ -->
+ <target name="-before-sass"/>
+ <target name="-sass">
+ <x-shell dir="${app.dir}/resources/sass">
+ compass compile --boring --force
+ </x-shell>
+ </target>
+ <target name="-after-sass"/>
+ <target name="sass" depends="init" unless="skip.sass"
+ description="Builds only the SASS files using Compass">
+ <antcall target="-before-sass"/>
+ <antcall target="-sass"/>
+ <antcall target="-after-sass"/>
+ </target>
+
+ <scriptdef name="x-app-build" language="javascript" src="${framework.config.dir}/app-build.js">
+ <classpath>
+ <pathelement location="${cmd.dir}/lib/ant-contrib-1.0b3.jar"/>
+ <pathelement location="${cmd.dir}/sencha.jar"/>
+ </classpath>
+ </scriptdef>
+
+ <!--
+ Build Page
+ -->
+ <target name="-before-page"/>
+ <target name="-page">
+ <property name="v2deps" value="false"/>
+ <property name="args.path" location="."/>
+ <property name="args.destination" location="${workspace.build.dir}"/>
+ <property name="args.environment" value="production"/>
+ <x-app-build/>
+ </target>
+ <target name="-after-page"/>
+ <target name="page" depends="init" unless="skip.page"
+ description="Builds only the application's HTML page">
+ <antcall target="-before-page"/>
+ <antcall target="-page"/>
+ <antcall target="-after-page"/>
+ </target>
+
+ <target name="-before-run"/>
+ <target name="-run">
+ <x-sencha-command>
+ package
+ run
+ ${app.dir}/packager.temp.json
+ </x-sencha-command>
+ </target>
+ <target name="-after-run"/>
+ <target name="run" depends="init" unless="skip.run"
+ description="Runs an application package using the native packager">
+
+ <property name="args.autorun" value="false"/>
+ <if>
+ <and>
+ <equals arg1="${args.autorun}" arg2="true"/>
+ <or>
+ <equals arg1="${args.environment}" arg2="native"/>
+ <equals arg1="${args.environment}" arg2="package"/>
+ </or>
+ </and>
+ <then>
+ <antcall target="-before-run"/>
+ <antcall target="-run"/>
+ <antcall target="-after-run"/>
+ </then>
+ </if>
+ </target>
+
+ <!--
+ Build
+ -->
+ <target name="-before-build"/>
+ <target name="-build" depends="sass,page,run"/>
+ <target name="-after-build"/>
+ <target name="build"
+ depends="init,-before-build,-build,-after-build"
+ description="Builds the application"/>
+
+ <!--
+ environment setters
+ -->
+
+ <target name="production">
+ <property name="args.environment" value="production"/>
+ </target>
+
+ <target name="testing">
+ <property name="args.environment" value="testing"/>
+ </target>
+
+ <target name="native">
+ <property name="args.environment" value="native"/>
+ </target>
+
+ <target name="package">
+ <property name="args.environment" value="package"/>
+ </target>
+
+ <!--
+ Helpful targets
+ -->
+ <target name=".props" depends="init"
+ description="Lists all properties defined for the build">
+ <echoproperties/>
+ </target>
+
+ <target name=".help" depends="init"
+ description="Provides help on the build script">
+ <local name="-alltargets"/>
+ <x-shell outputproperty="-alltargets">
+ ant -f ${ant.file} -p
+ </x-shell>
+
+ <!--
+ Remove the annoying "Default taret:.help" smashed on the end of the output.
+ -->
+ <script language="javascript">
+ var s = project.getProperty("-alltargets"),
+ n = s.indexOf('Default target:');
+ //self.log("all=" + n);
+ project.setProperty("-alltargets", s.substring(0, n));
+ </script>
+
+ <echo><![CDATA[${-alltargets}
+This is the main build script for your application.
+
+The following properties can be used to disable certain steps in the build
+process.
+
+ * skip.page Do not build the HTML page.
+ * skip.sass Do not build the SASS.
+ * skip.theme Do not build the theme images.
+
+These options can be stored in a local.properties file in this folder or in the
+local.properties file in the workspace.
+
+Alternatively, these can be supplied on the command line. For example:
+
+ ant -Dskip.sass=1 build
+
+To see all currently defined properties, do this:
+
+ ant .props
+ ]]></echo>
+ </target>
+
+</project>
View
32 .sencha/.sencha/app/plugin.xml
@@ -0,0 +1,32 @@
+<project basedir=".">
+ <!--
+ This file can be freely edited, so long as the <import file="plugin-impl.xml"/>
+ statement is not removed.
+
+ One of the purposes of this file is to hook various Sencha Command operations and do
+ processing before or after the command is processed. To do this, simply provide the
+ logic in a <target> using one of these names:
+
+ -before-generate-app Called before an application is generated
+ -after-generate-app Called after an application is generated
+
+ -before-generate-controller Called before a controller is generated
+ -after-generate-controller Called after a controller is generated
+
+ -before-generate-model Called before a model is generated
+ -after-generate-model Called after a model is generated
+
+ -before-generate-profile Called before a profile is generated
+ -after-generate-profile Called after a profile is generated
+ -->
+ <import file="${workspace.config.dir}/plugin.xml"/>
+
+ <!--
+ <target name="-after-generate-model">
+ ... use ${args.path}, ${args.name} and ${args.fields} as needed ...
+ </target>
+
+ Other targets are similar. There are properties prefixed with "args." and the name of
+ the command line option that hold the parameters for the command.
+ -->
+</project>
View
3 .sencha/.sencha/app/sencha.cfg
@@ -0,0 +1,3 @@
+app.name=SlideNavigationExample
+app.framework=touch
+app.classpath=${app.dir}/app.js,${app.dir}/app,ux
View
3 .sencha/.sencha/workspace/plugin.xml
@@ -0,0 +1,3 @@
+<project basedir=".">
+ <import file="${framework.config.dir}/plugin.xml"/>
+</project>
View
11 .sencha/.sencha/workspace/sencha.cfg
@@ -0,0 +1,11 @@
+#Tue, 27 Nov 2012 11:23:27 -0800
+# 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=
+workspace.build.dir=${workspace.dir}/build/${app.name}
+
+touch.dir=${workspace.dir}/touch
+workspace.cmd.version=3.0.0.250
View
237 .sencha/app/build-impl.xml
@@ -0,0 +1,237 @@
+<?xml version="1.0" encoding="utf-8"?>
+<project>
+ <!--
+ Init-Local
+ -->
+ <target name="-before-init-local"/>
+ <target name="-init-local">
+ <property file="${basedir}/../../local.properties"/>
+
+ <script language="javascript">
+ var f = new java.io.File(project.getProperty("basedir"));
+ var sub = ".sencha/workspace/sencha.cfg";
+
+ for (var p = f; p; p = p.getParentFile()) {
+ var t = new java.io.File(p, sub);
+ if (t.exists()) {
+ // we found the workspace folder!
+
+ t = new java.io.File(p, "local.properties");
+ if (t.exists()) {
+ var loader = project.createTask("property");
+ loader.setFile(new java.io.File(t.getCanonicalPath()));
+ loader.execute();
+ }
+
+ break;
+ }
+ }
+ </script>
+ </target>
+ <target name="-after-init-local"/>
+ <target name="init-local"
+ depends="-before-init-local,-init-local,-after-init-local"/>
+
+ <!--
+ Find Sencha Cmd
+ -->
+ <target name="find-cmd" unless="cmd.dir">
+ <!--
+ Run "sencha which" to find the Sencha Cmd basedir and get "cmd.dir" setup. We
+ need to execute the command with curdir set properly for Cmd to pick up that we
+ are running for an application.
+ -->
+ <exec executable="sencha" dir="${basedir}">
+ <arg value="which"/><arg value="-o=$cmddir$"/>
+ </exec>
+
+ <!-- Now read the generated properties file and delete it -->
+ <property file="$cmddir$"/>
+ <delete file="$cmddir$"/>
+
+ <echo>Using Sencha Cmd from ${cmd.dir}</echo>
+ </target>
+
+ <!--
+ Init
+ -->
+ <target name="-before-init"/>
+ <target name="-init">
+ <taskdef resource="com/sencha/ant/antlib.xml" classpath="${cmd.dir}/sencha.jar"/>
+ <x-sencha-init prefix=""/>
+
+ <!-- initialize the build.dir property from the workspace config after we've loaded it -->
+ <property name="build.dir" location="${workspace.build.dir}"/>
+
+ <!-- Some operations require sencha.jar in the Ant classpath -->
+ <x-extend-classpath>
+ <jar path="${cmd.dir}/sencha.jar"/>
+ </x-extend-classpath>
+ </target>
+ <target name="-after-init"/>
+ <target name="init"
+ depends="init-local,find-cmd,-before-init,-init,-after-init"/>
+
+ <!--
+ Clean
+ -->
+ <target name="-before-clean"/>
+ <target name="-clean">
+ <delete dir="${build.dir}"/>
+ </target>
+ <target name="-after-clean"/>
+ <target name="clean"
+ depends="init,-before-clean,-clean,-after-clean"
+ description="Removes all build output produced by the 'build' target"/>
+
+ <!--
+ Build SASS
+ -->
+ <target name="-before-sass"/>
+ <target name="-sass">
+ <x-shell dir="${app.dir}/resources/sass">
+ compass compile --boring --force
+ </x-shell>
+ </target>
+ <target name="-after-sass"/>
+ <target name="sass" depends="init" unless="skip.sass"
+ description="Builds only the SASS files using Compass">
+ <antcall target="-before-sass"/>
+ <antcall target="-sass"/>
+ <antcall target="-after-sass"/>
+ </target>
+
+ <scriptdef name="x-app-build" language="javascript" src="${framework.config.dir}/app-build.js">
+ <classpath>
+ <pathelement location="${cmd.dir}/lib/ant-contrib-1.0b3.jar"/>
+ <pathelement location="${cmd.dir}/sencha.jar"/>
+ </classpath>
+ </scriptdef>
+
+ <!--
+ Build Page
+ -->
+ <target name="-before-page"/>
+ <target name="-page">
+ <property name="v2deps" value="false"/>
+ <property name="args.path" location="."/>
+ <property name="args.destination" location="${workspace.build.dir}"/>
+ <property name="args.environment" value="production"/>
+ <x-app-build/>
+ </target>
+ <target name="-after-page"/>
+ <target name="page" depends="init" unless="skip.page"
+ description="Builds only the application's HTML page">
+ <antcall target="-before-page"/>
+ <antcall target="-page"/>
+ <antcall target="-after-page"/>
+ </target>
+
+ <target name="-before-run"/>
+ <target name="-run">
+ <x-sencha-command>
+ package
+ run
+ ${app.dir}/packager.temp.json
+ </x-sencha-command>
+ </target>
+ <target name="-after-run"/>
+ <target name="run" depends="init" unless="skip.run"
+ description="Runs an application package using the native packager">
+
+ <property name="args.autorun" value="false"/>
+ <if>
+ <and>
+ <equals arg1="${args.autorun}" arg2="true"/>
+ <or>
+ <equals arg1="${args.environment}" arg2="native"/>
+ <equals arg1="${args.environment}" arg2="package"/>
+ </or>
+ </and>
+ <then>
+ <antcall target="-before-run"/>
+ <antcall target="-run"/>
+ <antcall target="-after-run"/>
+ </then>
+ </if>
+ </target>
+
+ <!--
+ Build
+ -->
+ <target name="-before-build"/>
+ <target name="-build" depends="sass,page,run"/>
+ <target name="-after-build"/>
+ <target name="build"
+ depends="init,-before-build,-build,-after-build"
+ description="Builds the application"/>
+
+ <!--
+ environment setters
+ -->
+
+ <target name="production">
+ <property name="args.environment" value="production"/>
+ </target>
+
+ <target name="testing">
+ <property name="args.environment" value="testing"/>
+ </target>
+
+ <target name="native">
+ <property name="args.environment" value="native"/>
+ </target>
+
+ <target name="package">
+ <property name="args.environment" value="package"/>
+ </target>
+
+ <!--
+ Helpful targets
+ -->
+ <target name=".props" depends="init"
+ description="Lists all properties defined for the build">
+ <echoproperties/>
+ </target>
+
+ <target name=".help" depends="init"
+ description="Provides help on the build script">
+ <local name="-alltargets"/>
+ <x-shell outputproperty="-alltargets">
+ ant -f ${ant.file} -p
+ </x-shell>
+
+ <!--
+ Remove the annoying "Default taret:.help" smashed on the end of the output.
+ -->
+ <script language="javascript">
+ var s = project.getProperty("-alltargets"),
+ n = s.indexOf('Default target:');
+ //self.log("all=" + n);
+ project.setProperty("-alltargets", s.substring(0, n));
+ </script>
+
+ <echo><![CDATA[${-alltargets}
+This is the main build script for your application.
+
+The following properties can be used to disable certain steps in the build
+process.
+
+ * skip.page Do not build the HTML page.
+ * skip.sass Do not build the SASS.
+ * skip.theme Do not build the theme images.
+
+These options can be stored in a local.properties file in this folder or in the
+local.properties file in the workspace.
+
+Alternatively, these can be supplied on the command line. For example:
+
+ ant -Dskip.sass=1 build
+
+To see all currently defined properties, do this:
+
+ ant .props
+ ]]></echo>
+ </target>
+
+</project>
View
32 .sencha/app/plugin.xml
@@ -0,0 +1,32 @@
+<project basedir=".">
+ <!--
+ This file can be freely edited, so long as the <import file="plugin-impl.xml"/>
+ statement is not removed.
+
+ One of the purposes of this file is to hook various Sencha Command operations and do
+ processing before or after the command is processed. To do this, simply provide the
+ logic in a <target> using one of these names:
+
+ -before-generate-app Called before an application is generated
+ -after-generate-app Called after an application is generated
+
+ -before-generate-controller Called before a controller is generated
+ -after-generate-controller Called after a controller is generated
+
+ -before-generate-model Called before a model is generated
+ -after-generate-model Called after a model is generated
+
+ -before-generate-profile Called before a profile is generated
+ -after-generate-profile Called after a profile is generated
+ -->
+ <import file="${workspace.config.dir}/plugin.xml"/>
+
+ <!--
+ <target name="-after-generate-model">
+ ... use ${args.path}, ${args.name} and ${args.fields} as needed ...
+ </target>
+
+ Other targets are similar. There are properties prefixed with "args." and the name of
+ the command line option that hold the parameters for the command.
+ -->
+</project>
View
3 .sencha/app/sencha.cfg
@@ -0,0 +1,3 @@
+app.name=SlideNavigationExample
+app.framework=touch
+app.classpath=${app.dir}/app.js,${app.dir}/app,ux
View
3 .sencha/workspace/plugin.xml
@@ -0,0 +1,3 @@
+<project basedir=".">
+ <import file="${framework.config.dir}/plugin.xml"/>
+</project>
View
11 .sencha/workspace/sencha.cfg
@@ -0,0 +1,11 @@
+#Tue, 27 Nov 2012 11:23:27 -0800
+# 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=
+workspace.build.dir=${workspace.dir}/build/${app.name}
+
+touch.dir=${workspace.dir}/touch
+workspace.cmd.version=3.0.0.250
View
11 README
@@ -49,16 +49,18 @@ Update the ``app.classpath`` variable to point to the ``ux`` directory, like so:
app.classpath=${app.dir}/app.js,${app.dir}/app,path/to/ux
-
Building the Example Application
--------------------------------
-To build the example you need to put Sencha Touch into a folder named sdk. Then run::
+To build the example you need to make sure you have the `Sencha Cmd`_ installed
+(>= v3.0.0.250) and Sencha Touch 2.1 extracted into a directory named `touch`.
+Then, run the following command (from the directory that this README is located)::
- ./sdk/commands/sencha app build -e testing
+ sencha app build
-This will produce the example app in the `build/testing` directory.
+This will produce the example app in the `build/SlideNavigationExample/production` directory.
+.. _`Sencha Cmd`:
Notes
-----
@@ -82,3 +84,4 @@ License
This code is released under the MIT license. See the LICENSE file for the actual license.
+
View
37 build.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="utf-8"?>
+<project name="SlideNavigationExample" default=".help">
+ <import file="${basedir}/.sencha/app/build-impl.xml"/>
+
+ <!--
+ The following targets can be provided to inject logic before and/or after key steps
+ of the build process:
+
+ The "init-local" target is used to initialize properties that may be personalized
+ for the local machine.
+
+ <target name="-before-init-local"/>
+ <target name="-after-init-local"/>
+
+ The "clean" target is used to clean build output from the build.dir.
+
+ <target name="-before-clean"/>
+ <target name="-after-clean"/>
+
+ The general "init" target is used to initialize all other properties, including
+ those provided by Sencha Cmd.
+
+ <target name="-before-init"/>
+ <target name="-after-init"/>
+
+ The "page" target performs the call to Sencha Cmd to build the 'all-classes.js' file.
+
+ <target name="-before-page"/>
+ <target name="-after-page"/>
+
+ The "build" target performs the call to Sencha Cmd to build the application.
+
+ <target name="-before-build"/>
+ <target name="-after-build"/>
+ -->
+
+</project>
View
10 cache.appcache
@@ -0,0 +1,10 @@
+CACHE MANIFEST
+# 17e8c26bb45871be7e6cc0a01bfd1f211afa3e27
+index.html
+
+
+FALLBACK:
+
+
+NETWORK:
+*
View
10 cache.manifest
@@ -0,0 +1,10 @@
+CACHE MANIFEST
+# 38d3a626bd7c5a67df1a4ddeb7263dd717f369d2
+index.html
+# 43d0ac604bbbab34ffbaeacd401328cb9e8861fd
+resources/images/guide.jpg
+
+FALLBACK:
+
+NETWORK:
+*

0 comments on commit e2262d2

Please sign in to comment.
Something went wrong with that request. Please try again.