<commit_before><?xml version="1.0" encoding="iso-8859-1"?>
<!--
 *
 * Copyright 2012 Research In Motion Limited.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 -->
<project basedir="." name="build">
	<!-- Code Signing Key Password -->
	<property name="sign.pw" value="********"/>

	<!-- Set the details of the device or simulator for deployment -->
	<!-- For BB10 device -->
	<property name="device.bb10.ip" value="169.254.0.1"/>
	<property name="device.bb10.pw" value="********" />
	<property name="device.bb10.pin" value="********" />

	<!-- For BB10 Simulator -->
	<property name="sim.bb10.ip" value="192.168.0.134"/>
	<!-- For Tablet device -->
	<property name="device.tablet.ip" value="169.254.0.5"/>
	<property name="device.tablet.pw" value="********" />
	<property name="device.tablet.pin" value="********" />

	<!-- For BBOS Java device (only password is needed) -->
	<property name="device.bbos.pw" value="" />

	<!-- Files to exclude from zip -->
	<property name="file.excludes" value="build/ bin/ .project .externalToolBuilders/ build.xml build.number"/>

	<!-- SDK locations -->
	<property name="bbwp.bbos.dir" value="C:\Program Files\Research In Motion\BlackBerry WebWorks SDK 2.3.1.5"/>
	<property name="bbwp.tablet.dir" value="C:\Program Files\Research In Motion\BlackBerry WebWorks SDK for TabletOS 2.2.0.5"/>
	<property name="bbwp.bb10.dir" value="C:\Program Files\Research In Motion\BlackBerry 10 WebWorks SDK 172.16.31.10"/>
	<!-- Use RippleSites or a WebServer to host the project for testing in Ripple -->
	<property name="ripple.dir" value="C:\Apache2.2\htdocs\${ant.project.name}"/>
	<property name="ripple.port" value=":9910"/>

	<!-- set the .bat extension for windows machines -->
	<condition property="commandExtension" value=".bat" else="">
		<os family="windows"/>
	</condition>

	<!-- Build Tool locations -->
	<property name="tools.dir" value="${ant.home}/.."/>
	<property name="yui.dir" value="${tools.dir}/yuicompressor-2.4.7"/>
	<property name="rhino.dir" value="${tools.dir}/rhino1_7R3"/>
	<property name="yui.jar" value="${yui.dir}/build/yuicompressor-2.4.7.jar"/>
	<property name="rhino.jar" value="${rhino.dir}/js.jar"/>
	<property name="jslint.js" value="${tools.dir}/fulljslint.js"/>
	<property name="jshint.js" value="${tools.dir}/fulljshint.js"/>
	<property name="csslint.js" value="${tools.dir}/csslint-rhino.js"/>

	<!-- Build Tool options -->
	<property name="tool.jslint.opts" value=""/>
	<property name="tool.jshint.opts" value=""/>
	<property name="tool.csslint.opts" value=""/>

	<!-- Build Directories -->
	<property name="zip.name" value="${ant.project.name}.zip"/>
	<property name="build.dir" value="build"/>
	<property name="build.js.dir" value="${build.dir}/js"/>
	<property name="build.css.dir" value="${build.dir}/css"/>
	<property name="src.dir" value="${basedir}"/>
	<property name="src.js.dir" value="${basedir}/js"/>
	<property name="src.css.dir" value="${basedir}/css"/>
	<!-- Output directories for files -->
	<property name="output.dir" value="bin"/>
	<property name="bin.bbos" value="${output.dir}/bbos"/>
	<property name="bin.tablet" value="${output.dir}/tablet"/>
	<property name="bin.bb10" value="${output.dir}/bb10"/>
	<!-- Append this value to the Output Directory for test builds -->
	<property name="bin.test" value="-test"/>
	<!-- Append this value to the Output Directory for beta builds -->
	<property name="bin.beta" value="-beta"/>

	<!-- 
	Set a JSON file to be passed into the BB10 BBWP tool with settings for downstream tools
	- See the example in the SDK directory (params-example.json) for what you can do
	- Recommendation is to put it in the tools directory and reference like so:
		value="${tools.dir}/params.json"
	- Otherwise, leave value empty so it's not used
	-->
	<property name="paramsfile" value=""/>
	
	<!-- Extension Points -->
	<!-- These are defined points in the build process where other tasks can be injected -->
	<extension-point name="FilesReady" depends="-copy.html"/>
	<extension-point name="ZipBuilt" depends="zip"/>


	<condition property="paramsarg" value="-p ${paramsfile}" else="">
		<not>
			<length string="${paramsfile}" trim="true" length="0" />
		</not>
	</condition>

	<!-- Targets -->
	<target name="ripple" depends="-copy.html,FilesReady">
		<copy todir="${ripple.dir}">
			<fileset dir="${build.dir}"/>
		</copy>
		<script language="javascript"><![CDATA[
			location = "http://localhost" + project.getProperty('ripple.port') + "/" + project.getProperty('ant.project.name') + "/index.html";
			java.awt.Desktop.getDesktop().browse(java.net.URI.create(location));
		]]></script>
	</target>

	<target name="all" 
		description="Builds project files for production use"
		depends="
			bbos.prod,
			tablet.prod,
			bb10.prod,
			ripple">
	</target>
	
	<target name="test" 
		description="Builds project files with WebInspector and Debug Token"
		depends="
			bbos.test,
			tablet.test,
			bb10.test,
			ripple">
	</target>

	<target name="beta" 
		description="Builds project files with WebInspector but Signed as well"
		depends="
			bbos.test,
			tablet.beta,
			bb10.beta,
			ripple">
	</target>

	<!-- Clean -->
	<target name="clean">
		<delete dir="${build.dir}" quiet="true"/>
		<delete file="${zip.name}"/>
		<delete dir="bin"/>
	</target>

	<target name="-init">
		<delete dir="${build.dir}"/>
		<delete file="${ant.project.name}.zip"/>
		
		<mkdir dir="${build.dir}"/>
		<mkdir dir="${build.js.dir}"/>
		<mkdir dir="${build.css.dir}"/>
	</target>

	<!-- Copy files to build directory -->
	<target name="-copy.html" depends="-init">
		<copy todir="${build.dir}">
			<fileset dir="${src.dir}" excludes="${file.excludes}"/>
		</copy>
	</target>

	<!-- Zip the application elements -->
	<target name="zip" depends="-copy.html,FilesReady">
		<zip basedir="${build.dir}" destfile="${zip.name}"/>
	</target>
<commit_msg>Couple more extension points that I forgot to include<commit_after><?xml version="1.0" encoding="iso-8859-1"?>
<!--
 *
 * Copyright 2012 Research In Motion Limited.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 -->
<project basedir="." name="build">
	<!-- Code Signing Key Password -->
	<property name="sign.pw" value="********"/>

	<!-- Set the details of the device or simulator for deployment -->
	<!-- For BB10 device -->
	<property name="device.bb10.ip" value="169.254.0.1"/>
	<property name="device.bb10.pw" value="********" />
	<property name="device.bb10.pin" value="********" />

	<!-- For BB10 Simulator -->
	<property name="sim.bb10.ip" value="192.168.0.134"/>
	<!-- For Tablet device -->
	<property name="device.tablet.ip" value="169.254.0.5"/>
	<property name="device.tablet.pw" value="********" />
	<property name="device.tablet.pin" value="********" />

	<!-- For BBOS Java device (only password is needed) -->
	<property name="device.bbos.pw" value="" />

	<!-- Files to exclude from zip -->
	<property name="file.excludes" value="build/ bin/ .project .externalToolBuilders/ build.xml build.number"/>

	<!-- SDK locations -->
	<property name="bbwp.bbos.dir" value="C:\Program Files\Research In Motion\BlackBerry WebWorks SDK 2.3.1.5"/>
	<property name="bbwp.tablet.dir" value="C:\Program Files\Research In Motion\BlackBerry WebWorks SDK for TabletOS 2.2.0.5"/>
	<property name="bbwp.bb10.dir" value="C:\Program Files\Research In Motion\BlackBerry 10 WebWorks SDK 172.16.31.10"/>
	<!-- Use RippleSites or a WebServer to host the project for testing in Ripple -->
	<property name="ripple.dir" value="C:\Apache2.2\htdocs\${ant.project.name}"/>
	<property name="ripple.port" value=":9910"/>

	<!-- set the .bat extension for windows machines -->
	<condition property="commandExtension" value=".bat" else="">
		<os family="windows"/>
	</condition>

	<!-- Build Tool locations -->
	<property name="tools.dir" value="${ant.home}/.."/>
	<property name="yui.dir" value="${tools.dir}/yuicompressor-2.4.7"/>
	<property name="rhino.dir" value="${tools.dir}/rhino1_7R3"/>
	<property name="yui.jar" value="${yui.dir}/build/yuicompressor-2.4.7.jar"/>
	<property name="rhino.jar" value="${rhino.dir}/js.jar"/>
	<property name="jslint.js" value="${tools.dir}/fulljslint.js"/>
	<property name="jshint.js" value="${tools.dir}/fulljshint.js"/>
	<property name="csslint.js" value="${tools.dir}/csslint-rhino.js"/>

	<!-- Build Tool options -->
	<property name="tool.jslint.opts" value=""/>
	<property name="tool.jshint.opts" value=""/>
	<property name="tool.csslint.opts" value=""/>

	<!-- Build Directories -->
	<property name="zip.name" value="${ant.project.name}.zip"/>
	<property name="build.dir" value="build"/>
	<property name="build.js.dir" value="${build.dir}/js"/>
	<property name="build.css.dir" value="${build.dir}/css"/>
	<property name="src.dir" value="${basedir}"/>
	<property name="src.js.dir" value="${basedir}/js"/>
	<property name="src.css.dir" value="${basedir}/css"/>
	<!-- Output directories for files -->
	<property name="output.dir" value="bin"/>
	<property name="bin.bbos" value="${output.dir}/bbos"/>
	<property name="bin.tablet" value="${output.dir}/tablet"/>
	<property name="bin.bb10" value="${output.dir}/bb10"/>
	<!-- Append this value to the Output Directory for test builds -->
	<property name="bin.test" value="-test"/>
	<!-- Append this value to the Output Directory for beta builds -->
	<property name="bin.beta" value="-beta"/>

	<!-- 
	Set a JSON file to be passed into the BB10 BBWP tool with settings for downstream tools
	- See the example in the SDK directory (params-example.json) for what you can do
	- Recommendation is to put it in the tools directory and reference like so:
		value="${tools.dir}/params.json"
	- Otherwise, leave value empty so it's not used
	-->
	<property name="paramsfile" value=""/>
	
	<!-- Extension Points -->
	<!-- These are defined points in the build process where other tasks can be injected -->
	<extension-point name="Start"/>
	<extension-point name="Initialized" depends="-init"/>
	<extension-point name="FilesReady" depends="-copy.html"/>
	<extension-point name="ZipBuilt" depends="zip"/>


	<condition property="paramsarg" value="-p ${paramsfile}" else="">
		<not>
			<length string="${paramsfile}" trim="true" length="0" />
		</not>
	</condition>

	<!-- Targets -->
	<target name="ripple" depends="-copy.html,FilesReady">
		<copy todir="${ripple.dir}">
			<fileset dir="${build.dir}"/>
		</copy>
		<script language="javascript"><![CDATA[
			location = "http://localhost" + project.getProperty('ripple.port') + "/" + project.getProperty('ant.project.name') + "/index.html";
			java.awt.Desktop.getDesktop().browse(java.net.URI.create(location));
		]]></script>
	</target>

	<target name="all" 
		description="Builds project files for production use"
		depends="
			bbos.prod,
			tablet.prod,
			bb10.prod,
			ripple">
	</target>
	
	<target name="test" 
		description="Builds project files with WebInspector and Debug Token"
		depends="
			bbos.test,
			tablet.test,
			bb10.test,
			ripple">
	</target>

	<target name="beta" 
		description="Builds project files with WebInspector but Signed as well"
		depends="
			bbos.test,
			tablet.beta,
			bb10.beta,
			ripple">
	</target>

	<!-- Clean -->
	<target name="clean">
		<delete dir="${build.dir}" quiet="true"/>
		<delete file="${zip.name}"/>
		<delete dir="bin"/>
	</target>

	<target name="-init" depends="Start">
		<delete dir="${build.dir}"/>
		<delete file="${ant.project.name}.zip"/>
		
		<mkdir dir="${build.dir}"/>
		<mkdir dir="${build.js.dir}"/>
		<mkdir dir="${build.css.dir}"/>
	</target>

	<!-- Copy files to build directory -->
	<target name="-copy.html" depends="-init,Initialized">
		<copy todir="${build.dir}">
			<fileset dir="${src.dir}" excludes="${file.excludes}"/>
		</copy>
	</target>

	<!-- Zip the application elements -->
	<target name="zip" depends="-copy.html,FilesReady">
		<zip basedir="${build.dir}" destfile="${zip.name}"/>
	</target>

{'fraction_non_alphanumeric': 0.1992843808338519, 'fraction_numerical': 0.015868077162414437, 'mean_word_length': 4.1060365369340746, 'pattern_counts': {'":': 2, '<': 225, '<?xml version=': 2, '>': 225, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 4}, 'pii_count': 12, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4315998', 'n_tokens_mistral': 4427, 'n_tokens_neox': 4054, 'n_words': 1084}