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

<project name="resources" default="deploy-resources" xmlns:artifact="antlib:org.apache.maven.artifact.ant">

<!--
  <target name="generate-resources-build" description="Generate resources build" depends="init">
-->
<!--
  <target name="generate-resources-build" description="Generate resources build" depends="init, set-classpath">
-->
<!-- The core needs to exist, because certain classes will be re-used within custom tasks -->
  <target name="generate-resources-build" description="Generate resources build" depends="init, compile-core, set-classpath">
    <echo>INFO: Generate build file to build resources</echo>

<!--
    <property name="property.classpath.compile" refid="classpath.compile"/>
    <echo>COMPILE CORE CLASSPATH: ${property.classpath.compile}</echo>
-->

    <!-- Build custom ant tasks -->
    <javac srcdir="${yanel.source.home}/src/build/java"
           destdir="${classes.dir}">
      <classpath refid="classpath.compile"/>
    </javac>

    <path id="classpath.taskdef.merge-resource-types-configs">
      <pathelement path="${yanel.source.home}/src/build/"/> <!-- Location of log4j.properties (NOTE: The conf directory also contains a log4j.properties and hence this lines needs to be set first!) -->
      <pathelement path="${yanel.source.home}/conf/"/>
      <pathelement path="${yanel.source.home}/conf/local-foaf/"/>
      <pathelement path="${classes.dir}"/> <!-- Location of the custom ant tasks -->
      <fileset dir="${yanel.source.home}/build/lib"> <!-- Location of yanel core lib -->
        <include name="*.jar"/>
      </fileset>
      <pathelement path="${maven2.cp}"/>
      <pathelement path="${maven2.compile.cp}"/>
    </path>

<!-- DEBUG
    <property name="property.classpath.taskdef.merge-resource-types-configs" refid="classpath.taskdef.merge-resource-types-configs"/>
    <echo>CLASSPATH: ${property.classpath.taskdef.merge-resource-types-configs}</echo>
-->

    <taskdef name="merge-resource-types-configs" classpathref="classpath.taskdef.merge-resource-types-configs" classname="org.wyona.yanel.ant.MergeResourceTypesConfigsTask"/>

<!--
    <taskdef name="merge-resource-types-configs" classname="org.wyona.yanel.ant.MergeResourceTypesConfigsTask">
      <classpath refid="classpath.taskdef.merge-resource-types-configs"/>
    </taskdef>
-->

<!-- TODO: An exception is thrown by the spring framework ...
    <merge-resource-types-configs defaultrealmsconfigdir="${yanel.source.home}/conf/" localrealmsconfigdir="${yanel.source.home}/${local.config.dir}/"/>
-->

    <condition property="local.resource-types.config.exists">
      <available file="${yanel.source.home}/${local.config.dir}/local.resource-types.xml" type="file"/>
    </condition>
    <antcall target="generate-resources-build-from-default"/>
    <antcall target="generate-resources-build-from-local"/>

    <replace file="../../build/build-resource-types.xml" value="${yanel.source.home.forward.slashes}">
      <replacetoken>@YANEL_SRC_DIR@</replacetoken>
    </replace>
  </target>

  <target name="generate-resources-build-from-default" description="Generate resources build from default config" depends="init" unless="local.resource-types.config.exists"><commit_msg>changes re taskdef commented because this does not seem to work on Windows<commit_after><?xml version="1.0"?>

<project name="resources" default="deploy-resources" xmlns:artifact="antlib:org.apache.maven.artifact.ant">

  <target name="generate-resources-build" description="Generate resources build" depends="init">
<!--
  <target name="generate-resources-build" description="Generate resources build" depends="init, set-classpath">
-->
<!-- The core needs to exist, because certain classes will be re-used within custom tasks -->
<!--
<target name="generate-resources-build" description="Generate resources build" depends="init, compile-core, set-classpath">
<echo>INFO: Generate build file to build resources</echo>
-->

<!--
    <property name="property.classpath.compile" refid="classpath.compile"/>
    <echo>COMPILE CORE CLASSPATH: ${property.classpath.compile}</echo>
-->

<!-- Build custom ant tasks -->
<!--
    <javac srcdir="${yanel.source.home}/src/build/java"
           destdir="${classes.dir}">
      <classpath refid="classpath.compile"/>
    </javac>
-->

    <path id="classpath.taskdef.merge-resource-types-configs">
      <pathelement path="${yanel.source.home}/src/build/"/> <!-- Location of log4j.properties (NOTE: The conf directory also contains a log4j.properties and hence this lines needs to be set first!) -->
      <pathelement path="${yanel.source.home}/conf/"/>
      <pathelement path="${yanel.source.home}/conf/local-foaf/"/>
      <pathelement path="${classes.dir}"/> <!-- Location of the custom ant tasks -->
      <fileset dir="${yanel.source.home}/build/lib"> <!-- Location of yanel core lib -->
        <include name="*.jar"/>
      </fileset>
      <pathelement path="${maven2.cp}"/>
      <pathelement path="${maven2.compile.cp}"/>
    </path>

<!-- DEBUG
    <property name="property.classpath.taskdef.merge-resource-types-configs" refid="classpath.taskdef.merge-resource-types-configs"/>
    <echo>CLASSPATH: ${property.classpath.taskdef.merge-resource-types-configs}</echo>
-->

<!--
<taskdef name="merge-resource-types-configs" classpathref="classpath.taskdef.merge-resource-types-configs" classname="org.wyona.yanel.ant.MergeResourceTypesConfigsTask"/>
-->

<!--
    <taskdef name="merge-resource-types-configs" classname="org.wyona.yanel.ant.MergeResourceTypesConfigsTask">
      <classpath refid="classpath.taskdef.merge-resource-types-configs"/>
    </taskdef>
-->

<!-- TODO: An exception is thrown by the spring framework ...
    <merge-resource-types-configs defaultrealmsconfigdir="${yanel.source.home}/conf/" localrealmsconfigdir="${yanel.source.home}/${local.config.dir}/"/>
-->

    <condition property="local.resource-types.config.exists">
      <available file="${yanel.source.home}/${local.config.dir}/local.resource-types.xml" type="file"/>
    </condition>
    <antcall target="generate-resources-build-from-default"/>
    <antcall target="generate-resources-build-from-local"/>

    <replace file="../../build/build-resource-types.xml" value="${yanel.source.home.forward.slashes}">
      <replacetoken>@YANEL_SRC_DIR@</replacetoken>
    </replace>
  </target>

  <target name="generate-resources-build-from-default" description="Generate resources build from default config" depends="init" unless="local.resource-types.config.exists">
{'fraction_non_alphanumeric': 0.17557836678412747, 'fraction_numerical': 0.0018385169296767274, 'mean_word_length': 4.260273972602739, 'pattern_counts': {'":': 0, '<': 113, '<?xml version=': 2, '>': 113, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 8}, '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': '3928810', 'n_tokens_mistral': 1935, 'n_tokens_neox': 1921, 'n_words': 351}