<commit_before><?xml version="1.0"?>

<project name="IT Mill Toolkit" basedir="../" default="package-all">

	<!-- Package creation - - - - - - - - - - - - - - - - - - - - - - - - -

	When creating release use only "package-*" targets:
	package-all
	 * creates four release packages for three three platforms (below)
	 
	package-windows
     * itmill-toolkit-windows-<version>.zip
	
	package-linux
	 * itmill-toolkit-linux-<version>.tar.bz2
	 
	package-mac
	 * itmill-toolkit-mac-<version>.tar.gz
	 * itmill-toolkit-mac-<version>.dmg

	NOTE: This build script requires directories named build/gwt/(linux|windows|mac) .
	You must unpack platform specific binaries under linux, windows and mac directories.
	build/gwt/(linux|windows|mac) are used for
  	a) compile WebContent/ITMILL/widgetsets
	b) creating platform specific release ZIP/TGZ packages.
	-->

	<!-- 
	Call one of package-* targets unless you understand what you are doing 
	-->
	<!-- TODO Should we remove depencencies: clean-all, init, build -->
	<target name="package-all" depends="clean-all, init, build, internal-package-mac, internal-package-windows, internal-package-linux" description="Build public packages for Windows, Linux and Mac platforms.">
	</target>

	<target name="package-mac" depends="clean-all, init, build, internal-package-mac" description="Create public tar.gz package for Mac.">
	</target>

	<target name="package-windows" depends="clean-all, init, build, internal-package-windows" description="Create public ZIP package for Windows.">
	</target>

	<target name="package-linux" depends="clean-all, init, build, internal-package-linux" description="Create public tar.bz2 package for Linux.">
	</target>


	<!-- Initialization - - - - - - - - - - - - - - - - - - - - - - - - -->
	<target name="init">
		<!-- Find out which platform we are in -->
		<if>
			<equals arg1="${os.name}" arg2="Windows 2000, Windows XP" />
			<then>
				<property name="platform" value="windows" />
			</then>
		</if>
		<if>
			<equals arg1="${os.name}" arg2="Linux" />
			<then>
				<property name="platform" value="linux" />
			</then>
		</if>
		<if>
			<equals arg1="${os.name}" arg2="Mac OS X" />
			<then>
				<property name="platform" value="mac" />
			</then>
		</if>
		<!-- required when compiling WebContent/ITMILL/widgetsets (and also Java server-side classes) -->
		<property name="lib-gwt-dev" value="gwt-dev-${platform}.jar" />

		<echo>We are on ${platform} platform, using build/gwt/${platform}/${lib-gwt-dev}.</echo>

		<!-- Create result dir unless already exists -->
		<mkdir dir="build/result" />

		<property file="build/VERSION" />
		<property name="product-file" value="itmill-toolkit" />
		<property name="product-name" value="IT Mill Toolkit" />
		<property name="toolkit-package" value="com/itmill/toolkit" />

		<property file="build/html-style.properties" />

		<!-- Destination files -->
		<property name="lib-bin-jar-name" value="${product-file}-${version}.jar" />
		<property name="lib-dev-jar-name" value="${product-file}-dev-${version}.jar" />
		<property name="demo-lib-jar-name" value="${product-file}-demo-${version}.jar" />
		<property name="lib-src-jar-name" value="${product-file}-src-${version}.jar" />
		<property name="demo-war-name" value="${product-file}-demo-${version}.war" />

		<echo message="Prepared to build ${product-file} version ${version} packages" />

		<!-- Output directory -->
		<property name="output-dir" value="build/result/${product-file}-${version}" />
		<mkdir dir="${output-dir}" />

		<!-- Create Output Directory Hierarchy -->
		<mkdir dir="${output-dir}/doc/manual" />
		<mkdir dir="${output-dir}/doc/api" />
		<mkdir dir="${output-dir}/lib" />
		<mkdir dir="${output-dir}/WebContent" />
		<mkdir dir="${output-dir}/WebContent/WEB-INF" />
		<mkdir dir="${output-dir}/WebContent/WEB-INF/classes" />

		<!-- Construct classpath used by java and javadoc compilation -->
		<path id="compile.classpath">
			<pathelement path="build/gwt/${platform}/gwt-user.jar" />
			<pathelement path="build/gwt/${platform}/${lib-gwt-dev}" />
			<pathelement path="WebContent/WEB-INF/lib/commons-fileupload-1.2.jar" />
			<pathelement path="lib/reservr/googlemaps_gwt.jar" />
			<pathelement path="lib/jetty/jetty-6.1.5.jar" />
			<pathelement path="lib/jetty/jetty-util-6.1.5.jar" />
			<pathelement path="lib/jetty/servlet-api-2.5-6.1.5.jar" />
		</path>

	</target>

	<target name="internal-package-windows">
		<echo>Creating package for Windows platform.</echo>
		<echo>1: ${package-platform}</echo>
		<var name="package-platform" value="windows" />
		<echo>2: ${package-platform}</echo>
		<antcall target="add-platform-specific-files" inheritAll="true" inheritRefs="true" />
		<zip zipfile="build/result/${product-file}-${package-platform}-${version}.zip">
			<zipfileset prefix="${product-file}-${package-platform}-${version}" dir="build/result/${product-file}-${version}">
				<patternset>
					<include name="**/*" />
				</patternset>
			</zipfileset>
			<zipfileset prefix="${product-file}-${package-platform}-${version}/gwt" dir="build/gwt/windows">
				<patternset><commit_msg>More comments (TODO) for Jani<commit_after><?xml version="1.0"?>

<project name="IT Mill Toolkit" basedir="../" default="package-all">

	<!-- Package creation - - - - - - - - - - - - - - - - - - - - - - - - -

	When creating release use only "package-*" targets:
	package-all
	 * creates four release packages for three three platforms (below)
	 
	package-windows
     * itmill-toolkit-windows-<version>.zip
	
	package-linux
	 * itmill-toolkit-linux-<version>.tar.bz2
	 
	package-mac
	 * itmill-toolkit-mac-<version>.tar.gz
	 * itmill-toolkit-mac-<version>.dmg

	NOTE: This build script requires directories named build/gwt/(linux|windows|mac) .
	You must unpack platform specific binaries under linux, windows and mac directories.
	build/gwt/(linux|windows|mac) are used for
  	a) compile WebContent/ITMILL/widgetsets
	b) creating platform specific release ZIP/TGZ packages.
	-->

	<!-- 
	Call one of package-* targets unless you understand what you are doing 
	-->
	<!-- TODO Should we remove depencencies: clean-all, init, build -->
	<target name="package-all" depends="clean-all, init, build, internal-package-mac, internal-package-windows, internal-package-linux" description="Build public packages for Windows, Linux and Mac platforms.">
	</target>

	<target name="package-mac" depends="clean-all, init, build, internal-package-mac" description="Create public tar.gz package for Mac.">
	</target>

	<target name="package-windows" depends="clean-all, init, build, internal-package-windows" description="Create public ZIP package for Windows.">
	</target>

	<target name="package-linux" depends="clean-all, init, build, internal-package-linux" description="Create public tar.bz2 package for Linux.">
	</target>


	<!-- Initialization - - - - - - - - - - - - - - - - - - - - - - - - -->
	<target name="init">
		
		<!-- TODO The following selects mac platform even when we are building (on mac) for windows ??? -->
		
		<!-- Find out which platform we are in -->
		<if>
			<equals arg1="${os.name}" arg2="Windows 2000, Windows XP" />
			<then>
				<property name="platform" value="windows" />
			</then>
		</if>
		<if>
			<equals arg1="${os.name}" arg2="Linux" />
			<then>
				<property name="platform" value="linux" />
			</then>
		</if>
		<if>
			<equals arg1="${os.name}" arg2="Mac OS X" />
			<then>
				<property name="platform" value="mac" />
			</then>
		</if>
		<!-- required when compiling WebContent/ITMILL/widgetsets (and also Java server-side classes) -->
		<property name="lib-gwt-dev" value="gwt-dev-${platform}.jar" />

		<echo>We are on ${platform} platform, using build/gwt/${platform}/${lib-gwt-dev}.</echo>

		<!-- Create result dir unless already exists -->
		<mkdir dir="build/result" />

		<property file="build/VERSION" />
		<property name="product-file" value="itmill-toolkit" />
		<property name="product-name" value="IT Mill Toolkit" />
		<property name="toolkit-package" value="com/itmill/toolkit" />

		<property file="build/html-style.properties" />

		<!-- Destination files -->
		<property name="lib-bin-jar-name" value="${product-file}-${version}.jar" />
		<property name="lib-dev-jar-name" value="${product-file}-dev-${version}.jar" />
		<property name="demo-lib-jar-name" value="${product-file}-demo-${version}.jar" />
		<property name="lib-src-jar-name" value="${product-file}-src-${version}.jar" />
		<property name="demo-war-name" value="${product-file}-demo-${version}.war" />

		<echo message="Prepared to build ${product-file} version ${version} packages" />

		<!-- Output directory -->
		<property name="output-dir" value="build/result/${product-file}-${version}" />
		<mkdir dir="${output-dir}" />

		<!-- Create Output Directory Hierarchy -->
		<mkdir dir="${output-dir}/doc/manual" />
		<mkdir dir="${output-dir}/doc/api" />
		<mkdir dir="${output-dir}/lib" />
		<mkdir dir="${output-dir}/WebContent" />
		<mkdir dir="${output-dir}/WebContent/WEB-INF" />
		<mkdir dir="${output-dir}/WebContent/WEB-INF/classes" />

		<!-- TODO Selection of classpath conflicts with bin/compile-gwt-components. build.xml expects gwt/mac/...
		and bin/compile-gwt-components expects gwt/gwt/... We should use constistent naming everywhere. I propose
		that we use gwt/mac/... everywhere. Still this init target should use the platform we are targeting, not the
		platform we are building on. -->
		
		<!-- Construct classpath used by java and javadoc compilation -->
		<path id="compile.classpath">
			<pathelement path="build/gwt/${platform}/gwt-user.jar" />
			<pathelement path="build/gwt/${platform}/${lib-gwt-dev}" />
			<pathelement path="WebContent/WEB-INF/lib/commons-fileupload-1.2.jar" />
			<pathelement path="lib/reservr/googlemaps_gwt.jar" />
			<pathelement path="lib/jetty/jetty-6.1.5.jar" />
			<pathelement path="lib/jetty/jetty-util-6.1.5.jar" />
			<pathelement path="lib/jetty/servlet-api-2.5-6.1.5.jar" />
		</path>

	</target>

	<target name="internal-package-windows">
		<echo>Creating package for Windows platform.</echo>
		<echo>1: ${package-platform}</echo>
		<var name="package-platform" value="windows" />
		<echo>2: ${package-platform}</echo>
		<antcall target="add-platform-specific-files" inheritAll="true" inheritRefs="true" />
		<zip zipfile="build/result/${product-file}-${package-platform}-${version}.zip">
			<zipfileset prefix="${product-file}-${package-platform}-${version}" dir="build/result/${product-file}-${version}">
				<patternset>
					<include name="**/*" />
				</patternset>
			</zipfileset>
			<zipfileset prefix="${product-file}-${package-platform}-${version}/gwt" dir="build/gwt/windows">
				<patternset>
{'fraction_non_alphanumeric': 0.1924553028175606, 'fraction_numerical': 0.005429186558082936, 'mean_word_length': 3.704535446939674, 'pattern_counts': {'":': 0, '<': 193, '<?xml version=': 2, '>': 193, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 3}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6764780', 'n_tokens_mistral': 3750, 'n_tokens_neox': 3406, 'n_words': 739}