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

<project name="install-default-tomcat" default="install-default-tomcat" xmlns:artifact="antlib:org.apache.maven.artifact.ant">
  <description>Install Default Tomcat</description>
  
  <target name="install-default-tomcat" description="Install Default Tomcat" depends="init" if="yes.install.default.tomcat">
    <echo>Install Default Tomcat ...</echo>

    <artifact:remoteRepository id="wyona.org.remote.repository" url="${maven.url}"/>

    <artifact:dependencies pathId="maven2.tomcat.classpath" filesetId="maven2.tomcat.fileset">
      <remoteRepository refid="wyona.org.remote.repository"/>
      <dependency groupId="apache-org" artifactId="apache-tomcat" version="${tomcat.version}" scope="provided"/>
    </artifact:dependencies>

<!-- DEBUG
    <property name="prop.maven2.tomcat.fileset" refid="maven2.tomcat.fileset"/>
    <echo>Refid: ${prop.maven2.tomcat.fileset}</echo>
-->

    <mkdir dir="${yanel.source.home}/local"/>
    <unzip dest="${yanel.source.home}/local">
      <fileset refid="maven2.tomcat.fileset"/>
    </unzip>
    <chmod perm="755">
      <fileset dir="${default.tomcat.home.dir}/bin">
        <include name="*.sh"/>
      </fileset>
    </chmod>
    <delete dir="${yanel.source.home}/local/META-INF"/>

    <input message="Are the ports 8080, 8005 and 8009 available? (YES/no)" addproperty="question.ports" defaultvalue="YES"/>
    <if>
      <equals arg1="${question.ports}" arg2="no"/>
      <then>
        <input message="WARNING: Please make sure to reconfigure the file '${default.tomcat.home.dir}/conf/server.xml' after this script has finished. Please hit return to continue." addproperty="confirm.reconfigure.server.xml"/>
      </then>
    </if>
<!-- TODO: Make the ports configurable ...
    <input message="Do you want to use 8080 as HTTP port? If so, then please just hit enter. If not, then please type another port and hit enter." addproperty="default.http.port" defaultvalue="8080"/>
    <input message="Do you want to use 8005 as shutdown port? If so, then please just hit enter. If not, then please type another port and hit enter." addproperty="default.shutdown.port" defaultvalue="8005"/>
    <input message="Do you want to use 8009 as AJP port? If so, then please just hit enter. If not, then please type another port and hit enter." addproperty="default.ajp.port" defaultvalue="8009"/>
-->
    <!-- INFO: SSL will be handled at some later stage -->

    <condition property="isJava1.4">
      <equals arg1="${ant.java.version}" arg2="1.4"/>
    </condition>
    <antcall target="copy-java1.4-libs"/>

    <!-- INFO: Set ALLOW_ENCODED_SLASH to 'true' -->
    <condition property="isTomcat7.0.25">
      <equals arg1="${tomcat.version}" arg2="7.0.25"/>
    </condition>
    <antcall target="copy-catalina-script"/>
    
    <replace file="${yanel.source.home}/src/build/local.build.properties" value="tomcat1.home.dir=${default.tomcat.home.dir.forward.slashes}">
      <replacetoken>#tomcat1.home.dir=../tomcat-cluster/build/jakarta-tomcat-5.0.30-cnode1</replacetoken>
    </replace>

    <!-- NOTE: Assume that SSL will be enabled (see targets/webapp/cluster.xml), and if not, then the target comment-local-tomcat1-ports will disable them again! -->
    <replace file="${yanel.source.home}/src/build/local.build.properties" value="tomcat1.http.port=8080">
      <replacetoken>#tomcat1.http.port=9190</replacetoken>
    </replace>
    <replace file="${yanel.source.home}/src/build/local.build.properties" value="tomcat1.ssl.port=8443">
      <replacetoken>#tomcat1.ssl.port=9143</replacetoken>
    </replace>
  </target>
  
  <target name="copy-java1.4-libs" if="isJava1.4" description="Copy jars specific to java 1.4" depends="init">
    <copy file="${yanel.source.home}/tools/apache-tomcat/java-1.4/apache-tomcat-${tomcat.version}/bin/jmx.jar" todir="${default.tomcat.home.dir}/bin"/>
  </target>
  
  <target name="copy-catalina-script" if="isTomcat7.0.25" description="Copy patched catalina script for 7.0.25" depends="init">
    <copy file="${yanel.source.home}/tools/apache-tomcat/7.0.25/bin/catalina.sh" todir="${default.tomcat.home.dir}/bin"/>
  </target>
    
</project><commit_msg>make sure that in case we upgrade in the future, but still want to support this version, that we notice in case somebody should delete this script<commit_after><?xml version="1.0"?>

<project name="install-default-tomcat" default="install-default-tomcat" xmlns:artifact="antlib:org.apache.maven.artifact.ant">
  <description>Install Default Tomcat</description>
  
  <target name="install-default-tomcat" description="Install Default Tomcat" depends="init" if="yes.install.default.tomcat">
    <echo>Install Default Tomcat ...</echo>

    <artifact:remoteRepository id="wyona.org.remote.repository" url="${maven.url}"/>

    <artifact:dependencies pathId="maven2.tomcat.classpath" filesetId="maven2.tomcat.fileset">
      <remoteRepository refid="wyona.org.remote.repository"/>
      <dependency groupId="apache-org" artifactId="apache-tomcat" version="${tomcat.version}" scope="provided"/>
    </artifact:dependencies>

<!-- DEBUG
    <property name="prop.maven2.tomcat.fileset" refid="maven2.tomcat.fileset"/>
    <echo>Refid: ${prop.maven2.tomcat.fileset}</echo>
-->

    <mkdir dir="${yanel.source.home}/local"/>
    <unzip dest="${yanel.source.home}/local">
      <fileset refid="maven2.tomcat.fileset"/>
    </unzip>
    <chmod perm="755">
      <fileset dir="${default.tomcat.home.dir}/bin">
        <include name="*.sh"/>
      </fileset>
    </chmod>
    <delete dir="${yanel.source.home}/local/META-INF"/>

    <input message="Are the ports 8080, 8005 and 8009 available? (YES/no)" addproperty="question.ports" defaultvalue="YES"/>
    <if>
      <equals arg1="${question.ports}" arg2="no"/>
      <then>
        <input message="WARNING: Please make sure to reconfigure the file '${default.tomcat.home.dir}/conf/server.xml' after this script has finished. Please hit return to continue." addproperty="confirm.reconfigure.server.xml"/>
      </then>
    </if>
<!-- TODO: Make the ports configurable ...
    <input message="Do you want to use 8080 as HTTP port? If so, then please just hit enter. If not, then please type another port and hit enter." addproperty="default.http.port" defaultvalue="8080"/>
    <input message="Do you want to use 8005 as shutdown port? If so, then please just hit enter. If not, then please type another port and hit enter." addproperty="default.shutdown.port" defaultvalue="8005"/>
    <input message="Do you want to use 8009 as AJP port? If so, then please just hit enter. If not, then please type another port and hit enter." addproperty="default.ajp.port" defaultvalue="8009"/>
-->
    <!-- INFO: SSL will be handled at some later stage -->

    <condition property="isJava1.4">
      <equals arg1="${ant.java.version}" arg2="1.4"/>
    </condition>
    <antcall target="copy-java1.4-libs"/>

    <!-- INFO: Set ALLOW_ENCODED_SLASH to 'true' -->
    <condition property="isTomcat7.0.25">
      <equals arg1="${tomcat.version}" arg2="7.0.25"/>
    </condition>
    <antcall target="copy-catalina-script"/>
    
    <replace file="${yanel.source.home}/src/build/local.build.properties" value="tomcat1.home.dir=${default.tomcat.home.dir.forward.slashes}">
      <replacetoken>#tomcat1.home.dir=../tomcat-cluster/build/jakarta-tomcat-5.0.30-cnode1</replacetoken>
    </replace>

    <!-- NOTE: Assume that SSL will be enabled (see targets/webapp/cluster.xml), and if not, then the target comment-local-tomcat1-ports will disable them again! -->
    <replace file="${yanel.source.home}/src/build/local.build.properties" value="tomcat1.http.port=8080">
      <replacetoken>#tomcat1.http.port=9190</replacetoken>
    </replace>
    <replace file="${yanel.source.home}/src/build/local.build.properties" value="tomcat1.ssl.port=8443">
      <replacetoken>#tomcat1.ssl.port=9143</replacetoken>
    </replace>
  </target>
  
  <target name="copy-java1.4-libs" if="isJava1.4" description="Copy jars specific to java 1.4" depends="init">
    <copy file="${yanel.source.home}/tools/apache-tomcat/java-1.4/apache-tomcat-${tomcat.version}/bin/jmx.jar" todir="${default.tomcat.home.dir}/bin"/>
  </target>
  
  <target name="copy-catalina-script" if="isTomcat7.0.25" description="Copy patched catalina script for 7.0.25" depends="init">
    <copy file="${yanel.source.home}/tools/apache-tomcat/7.0.25/bin/catalina.sh" todir="${default.tomcat.home.dir}/bin" failonerror="true"/>
  </target>
    
</project>
{'fraction_non_alphanumeric': 0.1683901292596945, 'fraction_numerical': 0.02702702702702703, 'mean_word_length': 4.036094674556213, 'pattern_counts': {'":': 0, '<': 139, '<?xml version=': 2, '>': 139, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 10}, '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': '2960628', 'n_tokens_mistral': 2874, 'n_tokens_neox': 2703, 'n_words': 594}