Permalink
Browse files

Updated example to Sencha Touch 2.1

  • Loading branch information...
1 parent 42fad8d commit d2825f03957e9e70743542003b50549739bff4d6 @wnielson committed Dec 5, 2012
Showing 2,561 changed files with 477,172 additions and 20,610 deletions.
View
@@ -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
@@ -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
@@ -0,0 +1,3 @@
+app.name=SlideNavigationExample
+app.framework=touch
+app.classpath=${app.dir}/app.js,${app.dir}/app,ux
@@ -0,0 +1,3 @@
+<project basedir=".">
+ <import file="${framework.config.dir}/plugin.xml"/>
+</project>
@@ -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
19 LICENSE
@@ -0,0 +1,19 @@
+Copyright (c) 2012 Weston Nielson <wnielson@github>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
View
59 app.js

Large diffs are not rendered by default.

Oops, something went wrong.
Oops, something went wrong.

0 comments on commit d2825f0

Please sign in to comment.