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

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

  <target name="generate-javadoc" description="Generate Javadoc" depends="init">
      <condition property="javadoc-does-not-exist-yet">
      <not>
        <available file="${build.dir}/javadoc" type="dir"/>
      </not>
    </condition>
    <antcall target="javadoc"/>
    <antcall target="javadoc-exists"/>
  </target>
  
<target name="javadoc" description="Generate Javadoc" depends="init,set-javadoc-classpath" if="javadoc-does-not-exist-yet">
    <mkdir dir="${build.dir}/javadoc"/>
    <javadoc
      packagenames="org.*"
      destdir="${yanel.source.home}/build/javadoc"
      classpathref="classpath.javadoc"
    >
    <fileset dir="${yanel.source.home}/src/" defaultexcludes="yes">
      <include name="impl/java/**"/>
      <include name="core/java/**"/>
      <include name="resources/*/src/java/**"/>
      <include name="realms/*/src/java/**"/>
      <exclude name="**/README.txt"/>
    </fileset>
    
    </javadoc>
    <echo/>
    <echo/>
    <echo>You should find the javadoc under: ${build.dir}/javadoc/index.html</echo>
  </target>

  <target name="javadoc-exists" unless="javadoc-does-not-exist-yet">
    <echo/>
    <echo/>
    <echo>The Javadoc already exists. You should find it under: ${build.dir}/javadoc/index.html</echo>
  </target>
  
  <target name="set-javadoc-classpath" description="Set javadoc classpath" depends="init, dependencies">
    <!-- TODO: This seems never to be used -->
    <path id="classpath.javadoc">
      <pathelement path="${yanel.source.home}/build/webapps/${servlet.context.prefix}/WEB-INF/classes"/>

      <fileset dir="${yanel.source.home}/build/webapps/${servlet.context.prefix}/WEB-INF/lib">
        <include name="*.jar"/>
      </fileset>

      <pathelement path="${maven2.cp}"/>
      <pathelement path="${maven2.compile.cp}"/>
    </path>
    <property name="javadoc.cp" refid="classpath.javadoc"/>
    <echo>INFO: Classpath to generate Javadoc: ${javadoc.cp}</echo>
  </target>

</project>  <commit_msg>Now checking for the presence of the index file instead of simply the directory to allow javadoc regeneration when it failed half-way (for example because of a too-long Windows classpath, see issue 6899).<commit_after><?xml version="1.0"?>

<project name="javadoc" default="generate-javadoc">
  <!-- Generate Javadoc (if not already done) -->
  <target name="generate-javadoc" depends="init">
      <condition property="javadoc-does-not-exist-yet">
      <not>
        <available file="${build.dir}/javadoc/index-all.html" type="file"/>
      </not>
    </condition>
    <antcall target="javadoc-not-exists"/>
    <antcall target="javadoc-exists"/>
  </target>
  
  <target name="javadoc-not-exists" depends="init,set-javadoc-classpath" if="javadoc-does-not-exist-yet">
    <mkdir dir="${build.dir}/javadoc"/>
    <javadoc
      packagenames="org.*"
      destdir="${yanel.source.home}/build/javadoc"
      classpathref="classpath.javadoc"
    >
    <fileset dir="${yanel.source.home}/src/" defaultexcludes="yes">
      <include name="impl/java/**"/>
      <include name="core/java/**"/>
      <include name="resources/*/src/java/**"/>
      <include name="realms/*/src/java/**"/>
      <exclude name="**/README.txt"/>
    </fileset>
    
    </javadoc>
    <echo/>
    <echo/>
    <echo>You should find the javadoc under: ${build.dir}/javadoc/index.html</echo>
  </target>

  <target name="javadoc-exists" unless="javadoc-does-not-exist-yet">
    <echo/>
    <echo/>
    <echo>The Javadoc already exists. You should find it under: ${build.dir}/javadoc/index.html</echo>
  </target>
  
  <!-- Set javadoc classpath -->
  <target name="set-javadoc-classpath" depends="init, dependencies">
    <path id="classpath.javadoc">
      <pathelement path="${yanel.source.home}/build/webapps/${servlet.context.prefix}/WEB-INF/classes"/>

      <fileset dir="${yanel.source.home}/build/webapps/${servlet.context.prefix}/WEB-INF/lib">
        <include name="*.jar"/>
      </fileset>

      <pathelement path="${maven2.cp}"/>
      <pathelement path="${maven2.compile.cp}"/>
    </path>
    <property name="javadoc.cp" refid="classpath.javadoc"/>
    <echo>INFO: Classpath to generate Javadoc: ${javadoc.cp}</echo>
  </target>

  <target name="javadoc" description="generate Javadoc (if not already done)" depends="generate-javadoc"/>

  <target name="clean-javadoc" description="clean javadoc" depends="init">
    <delete dir="${build.dir}/javadoc"/>
  </target>
</project>  
{'fraction_non_alphanumeric': 0.18872870249017037, 'fraction_numerical': 0.002621231979030144, 'mean_word_length': 3.5202369200394865, 'pattern_counts': {'":': 0, '<': 104, '<?xml version=': 2, '>': 104, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 3}, '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': '7294441', 'n_tokens_mistral': 1573, 'n_tokens_neox': 1469, 'n_words': 275}