Permalink
Browse files

Added etc folder for project settings. Copied build.xml from My Web B…

…rain and customised for he3-appengine-lib (removed JS specific options)
  • Loading branch information...
1 parent ef1403e commit bace49229cfa80952f4412a348e25df94f2bd830 @bendavieshe3 committed Mar 9, 2011
View
@@ -0,0 +1,274 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<project name="he3-appengine-lib" default="build">
+
+ <!-- Properties -->
+ <property name="path.assets.src" location="./src" />
+
+ <property name="path.assets.etc" location="./etc" />
+ <property name="path.assets.etc.pylint" location="${path.assets.etc}/pylint.rc" />
+
+ <property name="path.assets.test" location="./test" />
+ <property name="path.assets.gae.appcfg" location="/cross/gae/google_appengine/1.4.2/appcfg.py" />
+
+ <property name="path.build.src" location="./build/upload" />
+ <property name="path.build.reports" location="./build/reports" />
+ <property name="path.build.reports.pylint.out" location="${path.build.reports}/pylint_output.txt" />
+ <property name="path.build.reports.pylint.err" location="${path.build.reports}/pylint_errors.txt" />
+
+ <property name="path.dist.src" location="./dist/upload" />
+
+ <property file="${path.assets.etc}/google.properties" />
+
+ <property name="token.git.uptodate" value="nothing to commit (working" />
+
+ <!-- Public Targets -->
+ <target name="build" depends="-init,-setbuildonlyprops,-copybuild,-copydist"
+ description="completes entire build process, with the exception of deployment">
+ <!-- TODO: Minify CSS -->
+ </target>
+
+ <target name="test" depends="unittest,sourcetest"
+ description="runs all available tests on the application" />
+
+ <target name="unittest" depends=""
+ description="executes defined unit tests on working (not build)">
+ <echo>Not implemented yet</echo>
+ </target>
+
+ <target name="sourcetest" depends="-init,-pylint"
+ description="executes code quality checks on original source code">
+
+ </target>
+
+ <target name="deploytest" depends="-settestprops,clean,test,-failbuild,build,-uploadtest"
+ description="builds My Web Brain and deploys to Google as test version">
+ </target>
+
+ <target name="deployprod" depends="-setprodprops,clean,test,-failbuild,build,-uploadprod,-push"
+ description="builds My Web Brain and deploys to Google as test version">
+ </target>
+
+ <target name="clean" depends="-init"
+ description="removes any working or intermediate files from the project">
+ <delete dir="${path.build.src}" />
+ <delete dir="${path.dist.src}" />
+ <delete>
+ <fileset dir="${path.assets.src}" includes="**/*.pyc" />
+ <fileset dir="${path.assets.src}" includes="**/*.pyo" />
+ <fileset dir="${path.assets.test}" includes="**/*.pyc" />
+ <fileset dir="${path.assets.test}" includes="**/*.pyo" />
+ </delete>
+ </target>
+
+ <target name="showprops"
+ description="shows the values of properties set outside of tasks">
+ <echoproperties />
+ </target>
+
+ <!-- Private Targets -->
+ <target name="-init" depends="">
+ <!-- initialises environment by ensuring directory structure is consistent
+ and that required properties are set -->
+
+ <!-- ensure directory structure is in place -->
+ <mkdir dir="${path.build.src}" />
+ <mkdir dir="${path.build.reports}" />
+ <mkdir dir="${path.dist.src}" />
+
+ <!-- collect a timestamp id for use in any labels or tags -->
+ <tstamp>
+ <format property="generated.id.timestamp" pattern="yyyyMMdd-HHmm" />
+ </tstamp>
+ </target>
+
+ <target name="-setprodprops">
+ <!-- Which options will fail the build? -->
+ <property name="pylint.strict" value="false" />
+ </target>
+
+ <target name="-settestprops">
+ <property name="pylint.strict" value="false" />
+ </target>
+
+ <target name="-setbuildonlyprops">
+ <property name="pylint.strict" value="false" />
+ </target>
+
+ <target name="-copybuild" depends="-init">
+ <!-- remove any build reports -->
+ <delete>
+ <fileset dir="${path.build.reports}" includes="*" />
+ </delete>
+
+ <!-- copy build files -->
+ <copy todir="${path.build.src}">
+ <fileset dir="${path.assets.src}">
+ <!-- TODO: move this to a separately defined patternset -->
+ <include name="**/*.py" />
+ <include name="**/*.yaml" />
+ <include name="**/*.js" />
+ <include name="**/*.gif" />
+ <include name="**/*.jpg" />
+ <include name="**/*.ico" />
+ <include name="**/*.png" />
+ <include name="**/*.xml" />
+ <include name="**/robots.txt" />
+ <include name="**/zoneinfo.zip" />
+ </fileset>
+ </copy>
+
+ <!-- Additional copy to replace version ids -->
+ <copy todir="${path.build.src}" overwrite="true">
+ <fileset dir="${path.assets.src}">
+ <include name="**/*.html" />
+ <include name="**/*.css" />
+ </fileset>
+
+ <filterset begintoken="xx-" endtoken="-zz">
+ <filter token="replace-with-version-id" value="${generated.id.timestamp}" />
+ </filterset>
+ </copy>
+
+ </target>
+
+ <target name="-copydist" depends="-copybuild,-init">
+ <copy todir="${path.dist.src}">
+ <fileset dir="${path.build.src}" />
+ </copy>
+ </target>
+
+ <target name="-failbuild" depends="-checkgitstatus,-pylint">
+
+ </target>
+
+ <target name="-checkgitstatus">
+ <!-- Checks git status and sets a property if all changes committed -->
+ <exec executable="git" outputproperty="output.git.status" failonerror="true">
+ <arg value="status" />
+ </exec>
+ <condition property="checks.git.uptodate">
+ <contains string="${output.git.status}" substring="${token.git.uptodate}" />
+ </condition>
+
+ <fail unless="checks.git.uptodate">
+ Git is not up to date:
+ ${output.git.status}
+ </fail>
+
+ </target>
+
+ <target name="-tag" if="checks.git.uptodate">
+ <!-- Creates a new tag in git -->
+ <exec executable="git" failonerror="true">
+ <arg value="tag" />
+ <arg value="-a" />
+ <arg line="-m '${upload.desc}'" />
+ <arg value="${upload.tag}" />
+ </exec>
+ </target>
+
+ <target name="-push" if="checks.git.uptodate">
+ <!-- Push to Origin Server -->
+ <exec executable="git" failonerror="true">
+ <arg value="push" />
+ <arg value="origin" />
+ </exec>
+
+ <!-- Push Tags to Origin Server -->
+ <exec executable="git" failonerror="true">
+ <arg value="push" />
+ <arg value="origin" />
+ <arg value="--tags" />
+ </exec>
+ </target>
+
+ <target name="-pylint">
+
+ <echo>Running Pylint Check...</echo>
+
+ <property name="pylint.strict" value="false" />
+
+ <apply executable="pylint" parallel="true" failonerror="false"
+ addsourcefile="true"
+ output="${path.build.reports.pylint.out}"
+ error="${path.build.reports.pylint.err}"
+ resultProperty="pylint.result">
+ <arg line="--rcfile=${path.assets.etc.pylint}" />
+ <fileset dir="${path.assets.src}" includes="**/*.py" />
+ </apply>
+
+ <loadfile property="pylint.output" srcFile="${path.build.reports.pylint.out}">
+ <filterchain>
+ <LineContainsRegExp>
+ <regexp pattern="Your code has been rated"/>
+ </LineContainsRegExp>
+ </filterchain>
+ </loadfile>
+
+ <echo>${pylint.output}</echo>
+
+ <condition property="pylint.fail">
+ <and>
+ <isfailure code="${pylint.result}" />
+ <istrue value="${pylint.strict}" />
+ </and>
+ </condition>
+
+ <fail if="pylint.fail">
+ Build Failed because pylint returned ${pylint.result}
+Review Error file: ${path.build.reports.pylint.out}
+ </fail>
+
+
+ </target>
+
+
+
+ <target name="-fail">
+ <!-- Fails the build process -->
+ <fail>Build intentionally failed by the fail target</fail>
+ </target>
+
+ <!-- Uploading Private Targets -->
+ <target name="-uploadtest" depends="build,test,-prepuploadtest,-runupload,-tag">
+ </target>
+
+ <target name="-uploadprod" depends="build,test,-prepuploadprod,-runupload,-tag">
+ </target>
+
+ <target name="-prepuploadtest" depends="">
+ <property name="upload.version" value="test" />
+ <property name="upload.tag" value="${generated.id.timestamp}-TEST" />
+ <property name="upload.desc" value="Release to Test environment" />
+ </target>
+
+ <target name="-prepuploadprod" depends="">
+ <property name="upload.version" value="prod" />
+ <property name="upload.tag" value="${generated.id.timestamp}-REL" />
+ <property name="upload.desc" value="Release to Production environment" />
+ </target>
+
+ <target name="-runupload" depends="-copydist"
+ description="(runs the upload. expects upload.version prop set.)"
+ if="upload.version">
+
+ <!-- Execute the upload -->
+ <exec executable="${path.assets.gae.appcfg}" failonerror="true"
+ inputString="${google.password}">
+ <!-- Options -->
+ <arg value="--no_cookies" />
+ <arg value="--version=${upload.version}" />
+ <arg value="--email=${google.email}" />
+ <arg value="--passin" />
+ <!-- Action -->
+ <arg value="update" />
+ <!-- App Directory -->
+ <arg value="${path.dist.src}" />
+ </exec>
+
+ <echo>he3-appengine-lib Deployed to Application Version ${upload.version}</echo>
+ <echo>http://${upload.version}.latest.my-web-brain.appspot.com/</echo>
+
+ </target>
+
+</project>
View
@@ -0,0 +1 @@
+google.properties
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.ant.AntLaunchConfigurationType">
+<stringAttribute key="bad_container_name" value="/he3-appengine-lib/et"/>
+<booleanAttribute key="org.eclipse.ant.ui.DEFAULT_VM_INSTALL" value="true"/>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/he3-appengine-lib/build.xml"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="1"/>
+</listAttribute>
+<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.ant.internal.ui.antsupport.InternalAntRunner"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="he3-appengine-lib"/>
+<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_INSTALL_NAME" value="java-6-openjdk"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_INSTALL_TYPE_ID" value="org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:/he3-appengine-lib/build.xml}"/>
+<stringAttribute key="process_factory_id" value="org.eclipse.ant.ui.remoteAntProcessFactory"/>
+</launchConfiguration>
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.ant.AntLaunchConfigurationType">
+<stringAttribute key="bad_container_name" value="/he3-appengine-lib/et"/>
+<booleanAttribute key="org.eclipse.ant.ui.DEFAULT_VM_INSTALL" value="true"/>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/he3-appengine-lib/build.xml"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="1"/>
+</listAttribute>
+<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.ant.internal.ui.antsupport.InternalAntRunner"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="he3-appengine-lib"/>
+<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_INSTALL_NAME" value="java-6-openjdk"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_INSTALL_TYPE_ID" value="org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_ANT_TARGETS" value="deploytest,"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:/he3-appengine-lib/build.xml}"/>
+<stringAttribute key="process_factory_id" value="org.eclipse.ant.ui.remoteAntProcessFactory"/>
+</launchConfiguration>
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.ant.AntLaunchConfigurationType">
+<stringAttribute key="bad_container_name" value="/he3-appengine-lib/et"/>
+<booleanAttribute key="org.eclipse.ant.ui.DEFAULT_VM_INSTALL" value="true"/>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/he3-appengine-lib/build.xml"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="1"/>
+</listAttribute>
+<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.ant.internal.ui.antsupport.InternalAntRunner"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="he3-appengine-lib"/>
+<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_INSTALL_NAME" value="java-6-openjdk"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_INSTALL_TYPE_ID" value="org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_ANT_TARGETS" value="test,"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:/he3-appengine-lib/build.xml}"/>
+<stringAttribute key="process_factory_id" value="org.eclipse.ant.ui.remoteAntProcessFactory"/>
+</launchConfiguration>
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.python.pydev.customizations.app_engine.launching.AppEngineLaunchConfigurationType">
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"/>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"/>
+<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
+<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
+</listAttribute>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="/cross/gae/google_appengine/1.4.2/dev_appserver.py"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_OTHER_WORKING_DIRECTORY" value=""/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="--port=8081&#10;--datastore_path=${project_loc}/test/datastore/development.datastore&#10;--blobstore_path=${project_loc}/test/blobs/development.blobs&#10;${project_loc}/src"/>
+<stringAttribute key="org.python.pydev.debug.ATTR_INTERPRETER" value="Python 2.5"/>
+<stringAttribute key="org.python.pydev.debug.ATTR_PROJECT" value="he3-appengine-lib"/>
+</launchConfiguration>
Oops, something went wrong.

0 comments on commit bace492

Please sign in to comment.