<commit_before><?xml version="1.0"?>
<project name="selenium-ide" default="create-xpi">
  <property file="build.properties" />
  <property name="build" value="build"/>
  <property name="output.path" value="${build}/classes"/>
  <property name="browser.launcher" value="*chrome" />
  <property name="profile.template.dir" value="${build}/profile-template" />
  
  <target name="prepare">
    <tstamp/>
    <echo message="Building Selenium IDE ${app.version}" />
    <mkdir dir="${build}"/>
    <mkdir dir="${build}/chrome"/>
  </target>

  <target name="clean" description="Delete build files">
    <delete dir="${build}"/>
    <delete dir="content/selenium"/>
    <delete dir="content/selenium-tests"/>
    <delete dir="content/jsunit"/>
  </target>

  <target name="copy-sources" if="output.path">
    <copy todir="${output.path}">
      <fileset dir=".">
	<include name="content/**" />
	<include name="locale/**" />
	<include name="skin/**" />
      </fileset>
    </copy>
  </target>

  <target name="import-selenium" description="Import Selenium source into the extension">
    <fail message="Please set selenium.core.dir property in build.properties file." unless="selenium.core.dir"/>
    <copy todir="content/selenium">
      <fileset dir="${selenium.core.dir}/core">
	<include name="**"/>
      </fileset>
    </copy>
    <copy todir="content/selenium" overwrite="true">
      <fileset dir="content/selenium-src"/>
    </copy>
    <copy todir="content/selenium-tests/tests">
      <fileset dir="${selenium.core.dir}/tests">
	<include name="**"/>
      </fileset>
    </copy>
    <copy todir="content/selenium">
      <fileset dir="${selenium.core.dir}">
	<include name="reference.html"/>
      </fileset>
    </copy>
    <copy todir="content/jsunit">
      <fileset dir="${selenium.core.dir}/jsunit">
	<include name="**"/>
      </fileset>
    </copy>
  </target>
  
  <target name="create-xpi" depends="prepare,import-selenium,copy-sources" description="Create Extension Packages">
    <create-xpi suffix="-test">
    </create-xpi>
    <create-xpi suffix="">
      <jar-fileset>
        <exclude name="content/selenium-tests/**" />
        <exclude name="content/jsunit/**" />
        <exclude name="content/tests/**" />
      </jar-fileset>
    </create-xpi>
  </target>

  <target name="prepare-profile-template" depends="create-xpi">
    <property name="profile.extension.dir" value="${profile.template.dir}/extensions/{a6fd85ed-e919-4a43-a5af-8da18bda539f}" />
    <mkdir dir="${profile.extension.dir}" />
    <unzip src="${build}/${ant.project.name}-${app.version}-test.xpi" dest="${profile.extension.dir}" />
  </target>

  <target name="integration-test" unless="skip-integration-test">
    <java classname="org.openqa.selenium.server.SeleniumServer" fork="true" failonerror="true">
      <classpath>
        <dirset dir="target/assembly/work">
          <include name="*" />
        </dirset>
      </classpath>
      <arg value="-htmlSuite" />
      <arg value="${browser.launcher}" />
      <arg value="http://localhost:4444" />
      <arg value="content/tests/functional/TestSuite.html" />
      <arg value="${build}/results.html" />
      <arg value="-firefoxProfileTemplate" />
      <arg value="${profile.template.dir}" />
      <arg value="-userExtensions" />
      <arg value="content/selenium-src/scripts/user-extensions.js" />
    </java>
  </target>

  <macrodef name="create-xpi">
    <attribute name="suffix" />
    <element name="jar-fileset" optional="true" />
    <sequential><commit_msg>Integration tests run a little better in -singleWindow mode, although there are still failures.<commit_after><?xml version="1.0"?>
<project name="selenium-ide" default="create-xpi">
  <property file="build.properties" />
  <property name="build" value="build"/>
  <property name="output.path" value="${build}/classes"/>
  <property name="browser.launcher" value="*chrome" />
  <property name="profile.template.dir" value="${build}/profile-template" />
  
  <target name="prepare">
    <tstamp/>
    <echo message="Building Selenium IDE ${app.version}" />
    <mkdir dir="${build}"/>
    <mkdir dir="${build}/chrome"/>
  </target>

  <target name="clean" description="Delete build files">
    <delete dir="${build}"/>
    <delete dir="content/selenium"/>
    <delete dir="content/selenium-tests"/>
    <delete dir="content/jsunit"/>
  </target>

  <target name="copy-sources" if="output.path">
    <copy todir="${output.path}">
      <fileset dir=".">
	<include name="content/**" />
	<include name="locale/**" />
	<include name="skin/**" />
      </fileset>
    </copy>
  </target>

  <target name="import-selenium" description="Import Selenium source into the extension">
    <fail message="Please set selenium.core.dir property in build.properties file." unless="selenium.core.dir"/>
    <copy todir="content/selenium">
      <fileset dir="${selenium.core.dir}/core">
	<include name="**"/>
      </fileset>
    </copy>
    <copy todir="content/selenium" overwrite="true">
      <fileset dir="content/selenium-src"/>
    </copy>
    <copy todir="content/selenium-tests/tests">
      <fileset dir="${selenium.core.dir}/tests">
	<include name="**"/>
      </fileset>
    </copy>
    <copy todir="content/selenium">
      <fileset dir="${selenium.core.dir}">
	<include name="reference.html"/>
      </fileset>
    </copy>
    <copy todir="content/jsunit">
      <fileset dir="${selenium.core.dir}/jsunit">
	<include name="**"/>
      </fileset>
    </copy>
  </target>
  
  <target name="create-xpi" depends="prepare,import-selenium,copy-sources" description="Create Extension Packages">
    <create-xpi suffix="-test">
    </create-xpi>
    <create-xpi suffix="">
      <jar-fileset>
        <exclude name="content/selenium-tests/**" />
        <exclude name="content/jsunit/**" />
        <exclude name="content/tests/**" />
      </jar-fileset>
    </create-xpi>
  </target>

  <target name="prepare-profile-template" depends="create-xpi">
    <property name="profile.extension.dir" value="${profile.template.dir}/extensions/{a6fd85ed-e919-4a43-a5af-8da18bda539f}" />
    <mkdir dir="${profile.extension.dir}" />
    <unzip src="${build}/${ant.project.name}-${app.version}-test.xpi" dest="${profile.extension.dir}" />
  </target>

  <target name="integration-test" unless="skip-integration-test">
    <java classname="org.openqa.selenium.server.SeleniumServer" fork="true" failonerror="true">
      <classpath>
        <dirset dir="target/assembly/work">
          <include name="*" />
        </dirset>
      </classpath>
      <arg value="-htmlSuite" />
      <arg value="${browser.launcher}" />
      <arg value="http://localhost:4444" />
      <arg value="content/tests/functional/TestSuite.html" />
      <arg value="${build}/results.html" />
      <arg value="-firefoxProfileTemplate" />
      <arg value="${profile.template.dir}" />
      <arg value="-userExtensions" />
      <arg value="content/selenium-src/scripts/user-extensions.js" />
      <arg value="-singleWindow" />
    </java>
  </target>

  <macrodef name="create-xpi">
    <attribute name="suffix" />
    <element name="jar-fileset" optional="true" />
    <sequential>
{'fraction_non_alphanumeric': 0.20027932960893854, 'fraction_numerical': 0.006145251396648044, 'mean_word_length': 3.4561294337274426, 'pattern_counts': {'":': 0, '<': 188, '<?xml version=': 2, '>': 188, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '3339081', 'n_tokens_mistral': 2361, 'n_tokens_neox': 2254, 'n_words': 400}