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

  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You 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 name="falcon-js" default="jar" basedir=".">

    <pathconvert property="basedir1" dirsep="/">
      <path location="${basedir}"/>
    </pathconvert>
	
    <property name="build.version" value="329449.1"/>
	<property name="src" value="${basedir1}/src"/>
	<property name="lib" value="${basedir1}/lib"/>
	
	<property name="falcon.basedir" value="${basedir1}/../compiler"/>
	<property name="falcon.lib.dir" value="${falcon.basedir}/lib"/>
	<property name="falcon.dist.dir" value="${falcon.basedir}/generated/dist"/>
	<property name="falcon.src" value="${falcon.basedir}/src"/>
	
    <property name="build.output" value="${basedir1}/build"/>
	<property name="build.lib.dir" value="${build.output}/lib"/>
	<property name="build.generated.src" value="${build.output}/generatedSrc"/>
	
	<property name="classes.dir" value="${build.output}/classes"/>
	<property name="tests.results" value="${build.output}/tests/results"/>
	<property name="asc.jar" value="${build.lib.dir}/asc.jar"/>
	<property name="mxmlc.jar" value="${build.lib.dir}/mxmlc.jar"/>
	<property name="compc.jar" value="${build.lib.dir}/compc.jar"/>
	<property name="jsc.jar" value="${build.lib.dir}/jsc.jar"/>

	<property name="as3.codegen.generated.src" value="${build.generated.src}/as3.codegen"/>
	<property name="as3.codegen.package.dir" value="org/apache/flex/compiler/internal/as/codegen"/>
	<property name="falcon.as3.codegen.dir" value="${falcon.basedir}/src/${as3.codegen.package.dir}"/>

    <property name="ant.build.javac.target" value="1.6"/>
    <property name="ant.build.javac.source" value="1.6"/>

    <property name="javac.debug" value="true"/>
    <property name="javac.deprecation" value="false"/>
	
	<property name="falcon-js-as3.codegen" value="${basedir1}/src/${as3.codegen.package.dir}"/>
	<property name="jburg.jar" value="${falcon.lib.dir}/jburg.jar"/>
	<property name="antlr" value="${falcon.lib.dir}/antlr.jar"/>
	
	<property name="tests.root" value="${basedir1}/../compiler.tests"/>
	<property name="tamarin.dir" value="${tests.root}/resources/tamarin"/>
	
    <property name="manifest.Implementation-Vendor" value="Adobe Systems Incorporated"/>
    <property name="manifest.Implementation-Version" value="0.${build.version}"/>

    <property name="localizationIntermediates.dir" value="${basedir1}/intermediates/localization"/>
    <property name="errorMessagesPath" value="org/apache/flex/compiler/problems"/>
    <property name="errorMessagesSrc.dir" value="${basedir1}/localization/src/${errorMessagesPath}"/>
    <available property="haveLocalizedErrorMessages.set" file="${errorMessagesSrc.dir}" type="dir"/>

    <macrodef name="jburg-js">
		<attribute name="spec"/>
		<attribute name="output"/>
		<sequential>
			<dirname property="as3.codegen.emitter.@{spec}.dirname" file="@{spec}"/>
			<dirname property="as3.codegen.emitter.@{output}.dirname" file="@{output}"/>
			<basename property="as3.codegen.emitter.@{output}.basename" file="@{output}"/>
			<mkdir dir="${as3.codegen.emitter.@{output}.dirname}"/>
			<java classname="jburg.burg.JBurgMain" 
                classpath="${classes.dir}"
                fork="true"
                failonerror="true"
                dir="${as3.codegen.emitter.@{spec}.dirname}" >
				<arg value="@{spec}"/>
				<arg value="-outputdir"/>
				<arg value="${as3.codegen.emitter.@{output}.dirname}"/>
				<arg value="-outputfile"/>
				<arg value="${as3.codegen.emitter.@{output}.basename}"/>
				<arg value="-g"/>
				<classpath>
					<pathelement path="${jburg.jar}"/>
					<pathelement path="${antlr}"/>
					<pathelement path="${classes.dir}"/>
				</classpath>
			</java>
		</sequential>
	</macrodef>
	
	<path id="classpath">
		<filelist dir="${build.lib.dir}">
			<file name="commons-cli.jar"/>
			<file name="commons-io.jar"/>
			<file name="guava.jar"/>
        </filelist>
		<filelist dir="${build.lib.dir}/google/closure-compiler">
            <file name="compiler.jar"/>
        </filelist>
	</path>

    <target name="localizeCompilerErrors" if="haveLocalizedErrorMessages.set">
        <sequential>
            <echo level="info" message="Copying localization files to ${localizationIntermediates.dir}."/>
            <mkdir dir="${localizationIntermediates.dir}"/>
            <native2ascii encoding="UTF-8" src="${errorMessagesSrc.dir}" dest="${localizationIntermediates.dir}/${errorMessagesPath}" includes="**/*.xlr,**/*.properties"/>
        </sequential>   
    </target>

	<target name="createBuildFolders">
		<mkdir dir="${classes.dir}"/>
	</target>

	<target name="copyFiles" depends="createBuildFolders">
		<copy todir="${build.lib.dir}">
			<filelist dir="${falcon.lib.dir}">
				<file name="antlr.jar"/>
				<file name="commons-cli.jar"/>
				<file name="commons-io.jar"/>
				<file name="guava.jar"/>
			</filelist>
		</copy>
		<copy todir="${build.lib.dir}/google/closure-compiler">
			<filelist dir="${lib}/google/closure-compiler">
				<file name="compiler.jar"/>
			</filelist>
		</copy>
		<copy todir="${build.lib.dir}/abc">
			<filelist dir="${lib}/abc">
                <file name="asc.jar"/>
                <file name="compc.jar"/>
                <file name="flex-messaging-common.jar"/>
                <file name="fxgutils.jar"/>
                <file name="mxmlc.jar"/>
                <file name="optimizer.jar"/>
                <file name="swfutils.jar"/>
                <file name="velocity-dep-1.4-flex.jar"/>
			</filelist>
		</copy>
	    
	    <!-- TODO: temporary hack for breaking cm dependencies -->
		<copy todir="${build.lib.dir}">
			<filelist dir="${lib}">
				<file name="cm.jar"/>
				<file name="cm-dependencies.jar"/>
			</filelist>
		</copy>
	    
	</target>

	<target name="prepare" depends="copyFiles,localizeCompilerErrors">
		<echo level="info">${ant.file}</echo>
	</target>
	
	<target name="as3.codegen.support.uptodate">
			<echo level="info">${ant.file}</echo>
			<uptodate property="CmcEmitter.uptodate" 
	            targetfile="${as3.codegen.generated.src}/${as3.codegen.package.dir}/CmcJSEmitter.java">
	            <srcfiles dir="${falcon-js-as3.codegen}" includes="*.jbg"/>
				<srcfiles dir="${falcon.as3.codegen.dir}" includes="*.jbg"/>
	        </uptodate>
	</target>
	
	<target name="as3.codegen.support" depends="as3.codegen.support.uptodate,createBuildFolders">
		<javac debug="${javac.debug}" deprecation="${javac.deprecation}"
            destdir="${classes.dir}"
            classpathref="classpath">
			<src path="${falcon.src}"/><commit_msg>CopyFiles seemed to be copying things it didn't need.<commit_after><?xml version="1.0" ?>
<!--

  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You 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 name="falcon-js" default="jar" basedir=".">

    <pathconvert property="basedir1" dirsep="/">
      <path location="${basedir}"/>
    </pathconvert>
	
    <property name="build.version" value="329449.1"/>
	<property name="src" value="${basedir1}/src"/>
	<property name="lib" value="${basedir1}/lib"/>
	
	<property name="falcon.basedir" value="${basedir1}/../compiler"/>
	<property name="falcon.lib.dir" value="${falcon.basedir}/lib"/>
	<property name="falcon.dist.dir" value="${falcon.basedir}/generated/dist"/>
	<property name="falcon.src" value="${falcon.basedir}/src"/>
	
    <property name="build.output" value="${basedir1}/build"/>
	<property name="build.lib.dir" value="${build.output}/lib"/>
	<property name="build.generated.src" value="${build.output}/generatedSrc"/>
	
	<property name="classes.dir" value="${build.output}/classes"/>
	<property name="tests.results" value="${build.output}/tests/results"/>
	<property name="asc.jar" value="${build.lib.dir}/asc.jar"/>
	<property name="mxmlc.jar" value="${build.lib.dir}/mxmlc.jar"/>
	<property name="compc.jar" value="${build.lib.dir}/compc.jar"/>
	<property name="jsc.jar" value="${build.lib.dir}/jsc.jar"/>

	<property name="as3.codegen.generated.src" value="${build.generated.src}/as3.codegen"/>
	<property name="as3.codegen.package.dir" value="org/apache/flex/compiler/internal/as/codegen"/>
	<property name="falcon.as3.codegen.dir" value="${falcon.basedir}/src/${as3.codegen.package.dir}"/>

    <property name="ant.build.javac.target" value="1.6"/>
    <property name="ant.build.javac.source" value="1.6"/>

    <property name="javac.debug" value="true"/>
    <property name="javac.deprecation" value="false"/>
	
	<property name="falcon-js-as3.codegen" value="${basedir1}/src/${as3.codegen.package.dir}"/>
	<property name="jburg.jar" value="${falcon.lib.dir}/jburg.jar"/>
	<property name="antlr" value="${falcon.lib.dir}/antlr.jar"/>
	
	<property name="tests.root" value="${basedir1}/../compiler.tests"/>
	<property name="tamarin.dir" value="${tests.root}/resources/tamarin"/>
	
    <property name="manifest.Implementation-Vendor" value="Adobe Systems Incorporated"/>
    <property name="manifest.Implementation-Version" value="0.${build.version}"/>

    <property name="localizationIntermediates.dir" value="${basedir1}/intermediates/localization"/>
    <property name="errorMessagesPath" value="org/apache/flex/compiler/problems"/>
    <property name="errorMessagesSrc.dir" value="${basedir1}/localization/src/${errorMessagesPath}"/>
    <available property="haveLocalizedErrorMessages.set" file="${errorMessagesSrc.dir}" type="dir"/>

    <macrodef name="jburg-js">
		<attribute name="spec"/>
		<attribute name="output"/>
		<sequential>
			<dirname property="as3.codegen.emitter.@{spec}.dirname" file="@{spec}"/>
			<dirname property="as3.codegen.emitter.@{output}.dirname" file="@{output}"/>
			<basename property="as3.codegen.emitter.@{output}.basename" file="@{output}"/>
			<mkdir dir="${as3.codegen.emitter.@{output}.dirname}"/>
			<java classname="jburg.burg.JBurgMain" 
                classpath="${classes.dir}"
                fork="true"
                failonerror="true"
                dir="${as3.codegen.emitter.@{spec}.dirname}" >
				<arg value="@{spec}"/>
				<arg value="-outputdir"/>
				<arg value="${as3.codegen.emitter.@{output}.dirname}"/>
				<arg value="-outputfile"/>
				<arg value="${as3.codegen.emitter.@{output}.basename}"/>
				<arg value="-g"/>
				<classpath>
					<pathelement path="${jburg.jar}"/>
					<pathelement path="${antlr}"/>
					<pathelement path="${classes.dir}"/>
				</classpath>
			</java>
		</sequential>
	</macrodef>
	
	<path id="classpath">
		<filelist dir="${build.lib.dir}">
			<file name="commons-cli.jar"/>
			<file name="commons-io.jar"/>
			<file name="guava.jar"/>
        </filelist>
		<filelist dir="${build.lib.dir}/google/closure-compiler">
            <file name="compiler.jar"/>
        </filelist>
	</path>

    <target name="localizeCompilerErrors" if="haveLocalizedErrorMessages.set">
        <sequential>
            <echo level="info" message="Copying localization files to ${localizationIntermediates.dir}."/>
            <mkdir dir="${localizationIntermediates.dir}"/>
            <native2ascii encoding="UTF-8" src="${errorMessagesSrc.dir}" dest="${localizationIntermediates.dir}/${errorMessagesPath}" includes="**/*.xlr,**/*.properties"/>
        </sequential>   
    </target>

	<target name="createBuildFolders">
		<mkdir dir="${classes.dir}"/>
	</target>

	<target name="copyFiles" depends="createBuildFolders">
		<copy todir="${build.lib.dir}">
			<filelist dir="${falcon.lib.dir}">
				<file name="antlr.jar"/>
				<file name="commons-cli.jar"/>
				<file name="commons-io.jar"/>
				<file name="guava.jar"/>
			</filelist>
		</copy>
		<copy todir="${build.lib.dir}/google/closure-compiler">
			<filelist dir="${lib}/google/closure-compiler">
				<file name="compiler.jar"/>
			</filelist>
		</copy>
    </target>

	<target name="prepare" depends="copyFiles,localizeCompilerErrors">
		<echo level="info">${ant.file}</echo>
	</target>
	
	<target name="as3.codegen.support.uptodate">
			<echo level="info">${ant.file}</echo>
			<uptodate property="CmcEmitter.uptodate" 
	            targetfile="${as3.codegen.generated.src}/${as3.codegen.package.dir}/CmcJSEmitter.java">
	            <srcfiles dir="${falcon-js-as3.codegen}" includes="*.jbg"/>
				<srcfiles dir="${falcon.as3.codegen.dir}" includes="*.jbg"/>
	        </uptodate>
	</target>
	
	<target name="as3.codegen.support" depends="as3.codegen.support.uptodate,createBuildFolders">
		<javac debug="${javac.debug}" deprecation="${javac.deprecation}"
            destdir="${classes.dir}"
            classpathref="classpath">
			<src path="${falcon.src}"/>
{'fraction_non_alphanumeric': 0.19260588657573582, 'fraction_numerical': 0.007322325915290739, 'mean_word_length': 3.97891350964975, 'pattern_counts': {'":': 0, '<': 248, '<?xml version=': 2, '>': 248, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 7}, 'pii_count': 0, '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': '4784172', 'n_tokens_mistral': 4680, 'n_tokens_neox': 4339, 'n_words': 796}