<commit_before><?xml version="1.0" encoding="UTF-8"?>

<!-- Copyright 2008 Cloud.com, Inc. All Rights Reserved -->

<project name="Cloud Stack Package" basedir=".">
  <description>
        This is a package.xml with tools to package the cloud stack distribution
    </description>

  <dirname property="base.dir" file="${ant.file.Cloud Stack Package}/.." />
  <property name="build.dir" location="${base.dir}/build" />

  <import file="${build.dir}/build-cloud.xml" optional="false"/>
  
  <property name="target.dir" location="${base.dir}/target"/>
  <property name="scripts.target.dir" location="${target.dir}/scripts"/>
  
  <property name="dist.dir" location="${base.dir}/dist" />
  <property name="publish.dir" location="${dist.dir}" />
  <property name="client.dist.dir" location="${dist.dir}/client" />
  <property name="server.dist.dir" location="${dist.dir}/client" />
  <property name="agent.dist.dir" location="${dist.dir}/agent" />
  <property name="docs.dist.dir" location="${dist.dir}/docs" />
  <property name="db.dist.dir" location="${dist.dir}/db" />
  <property name="usage.dist.dir" location="${dist.dir}/usage" />
  
  <condition property="mkisofs" value="${mkisofs.override}" else="mkisofs">
    <isset property="mkisofs.override" />
  </condition>
  
  <target name="-init-package">
    <mkdir dir="${dist.dir}" />
    <mkdir dir="${publish.dir}" />
  </target>

  <target name="package-server" depends="-init-package">
    <delete file="${dist.dir}/client.zip" />
    <zip destfile="${dist.dir}/client.zip" basedir="${server.dist.dir}" />
  </target>

  <target name="package-client" depends="-init-package">
    <zip destfile="${dist.dir}/client.zip" basedir="${client.dist.dir}">
      <zipfileset dir="${client.dist.dir}">
        <exclude name="**/*.sh" />
      </zipfileset>
      <zipfileset dir="${client.dist.dir}" filemode="555">
        <include name="**/*.sh" />
      </zipfileset>
    </zip>
  </target>

  <target name="package-usage" depends="-init-package">
    <zip destfile="${dist.dir}/usage.zip" basedir="${usage.dist.dir}" />
  </target>

  <target name="package-agent-common" depends="-init-package">
    <zip destfile="${dist.dir}/agent.zip" duplicate="preserve">
      <zipfileset dir="${deps.dir}">
        <include name="cloud-xmlrpc-client-3.1.3.jar" />
        <include name="cloud-xmlrpc-common-3.1.3.jar" />
        <include name="cloud-ws-commons-util-1.0.2.jar" />
        <include name="cloud-log4j.jar" />
        <include name="cloud-apache-log4j-extras-1.0.jar" />
        <include name="cloud-gson.jar" />
        <include name="cloud-commons-httpclient-3.1.jar" />
        <include name="cloud-commons-logging-1.1.1.jar" />
        <include name="cloud-commons-collections-3.2.1.jar" />
        <include name="cloud-commons-codec-1.4.jar" />
        <include name="cloud-commons-pool-1.4.jar" />
        <include name="cloud-libvirt-0.4.5.jar" />
        <include name="cloud-jna.jar" />
        <include name="cloud-cglib.jar" />
      </zipfileset>
      <zipfileset dir="${jar.dir}">
        <include name="${agent.jar}" />
        <include name="${utils.jar}" />
        <include name="${core.jar}" />
        <include name="${api.jar}" />
      </zipfileset>

      <zipfileset dir="${agent.dist.dir}" filemode="770">
        <include name="run.sh" />
        <include name="agent.sh" />
      </zipfileset>
      <zipfileset dir="${agent.dist.dir}">
        <exclude name="run.sh/" />
        <exclude name="agent.sh" />
        <include name="**/*" />
      </zipfileset>
      <zipfileset dir="${scripts.dir}" prefix="scripts" filemode="555">
        <exclude name="**/.project" />
        <exclude name="**/.classpath" />
      </zipfileset>
    </zip>
  </target>


  <target name="package-agent" depends="-init-package, package-oss-systemvm,  build-systemvm-patch, package-agent-common">
    <zip destfile="${dist.dir}/agent.zip" duplicate="preserve" update="true">
      <zipfileset dir="${dist.dir}" prefix="vms">
        <include name="patch.tgz" />
      </zipfileset>
      <zipfileset dir="${dist.dir}" prefix="vms" filemode="555">
        <include name="systemvm.zip" />
      </zipfileset>
    </zip>
  </target>

  <target name="package-oss-systemvm-iso" depends="-init-package, package-oss-systemvm,  build-systemvm-patch">
    <exec executable="${mkisofs}" dir="${dist.dir}">
      <arg value="-quiet"/>
      <arg value="-r"/>
      <arg value="-o"/>
      <arg value="systemvm.iso"/>
      <arg value="systemvm.zip"/>
      <arg value="cloud-scripts.tgz"/>
      <arg value="authorized_keys"/>
    </exec>
  </target>


  <target name="package-agent-simulator" depends="-init-package">
    <delete file="${dist.dir}/agent-simulator.zip" />
    <zip destfile="${dist.dir}/agent-simulator.zip" duplicate="preserve">
      <zipfileset dir="${agent-simulator.dist.dir}">
        <exclude name="**/*.sh" />
        <exclude name="**/vnetd" />
        <exclude name="**/send_arp" />
        <exclude name="**/vn" />
        <exclude name="**/*.exp" />
      </zipfileset>
      <zipfileset dir="${agent-simulator.dist.dir}" filemode="555">
        <include name="**/*.sh" />
        <include name="**/vnetd" />
        <include name="**/send_arp" />
        <include name="**/vn" />
        <include name="**/*.exp" />
      </zipfileset>
    </zip>
  </target>

  <target name="build-all" depends="build-opensource, build-ui, build-war-oss">
  </target>

  <target name="build-war-oss" depends="-init-package" description="Compile the GWT client UI and builds WAR file.">
    <mkdir dir="${client.dist.dir}" />

    <war destfile="${client.dist.dir}/client.war" webxml="${client.dir}/WEB-INF/web.xml">
      <fileset dir="${client.target.dir}">
        <include name="**/*" />
      	<exclude name="**/*.properties" />
      </fileset>
      <classes dir="${client.target.dir}">
    	  <include name="**/resources/*.properties" />
      </classes>
      <lib dir="${jar.dir}">
        <include name="cloud-*.jar" />
		<include name="vmware-*.jar" />
        <exclude name="cloud-servlet-api.jar"/>
      </lib>
      <zipfileset dir="${scripts.target.dir}" prefix="WEB-INF/lib/scripts" filemode="555">
        <include name="**/*" />
      </zipfileset>
    </war>
  </target>


  <target name="package-oss-systemvm" depends="-init-package">
    <zip destfile="${dist.dir}/systemvm.zip" duplicate="preserve" update="true">
      <!-- Console proxy now includes an agent shell, therefore we need to package agent related distribution -->
      <zipfileset dir="${deps.dir}">
        <include name="cloud-xmlrpc-client-3.1.3.jar" />
        <include name="cloud-xmlrpc-common-3.1.3.jar" />
        <include name="cloud-ws-commons-util-1.0.2.jar" />
        <include name="cloud-log4j.jar" />
        <include name="cloud-apache-log4j-extras-1.0.jar" />
        <include name="cloud-gson.jar" />
        <include name="cloud-commons-httpclient-3.1.jar" />
        <include name="cloud-commons-logging-1.1.1.jar" />
        <include name="cloud-commons-collections-3.2.1.jar" />
        <include name="cloud-commons-codec-1.4.jar" />
        <include name="cloud-commons-pool-1.4.jar" />
        <include name="cloud-cglib.jar" />
      </zipfileset>
      <zipfileset dir="${jar.dir}">
        <include name="${agent.jar}" />
        <include name="${utils.jar}" />
        <include name="${core.jar}" />
        <include name="${api.jar}" />
      </zipfileset>
      <zipfileset dir="${console-proxy.dist.dir}" filemode="555">
        <include name="**/*.sh" />
        <include name="**/certs/" />
      </zipfileset>
      <zipfileset dir="${scripts.dir}/storage/secondary" prefix="scripts/storage/secondary" filemode="555">
        <exclude name="**/.project" />
        <exclude name="**/.classpath" />
      </zipfileset>
    </zip>
  </target>

  <target name="package-docs" depends="-init-package">
    <delete file="${dist.dir}/docs.zip" />
    <zip destfile="${dist.dir}/docs.zip" compress="false">
      <fileset dir="${docs.dist.dir}" />
    </zip>
  </target>

  <target name="package-test" depends="-init-package">
    <delete file="${publish.dir}/test.zip" />
    <zip destfile="${publish.dir}/test.zip" compress="false">
      <zipfileset dir="${testclient.dist.dir}" filemode="555" />
    </zip>
  </target>

  <target name="package-tools" depends="-init-package">
    <delete file="${publish.dir}/cloudapitools.zip" />
    <zip destfile="${publish.dir}/cloudapitools.zip" compress="false">
      <zipfileset dir="${tools.dist.dir}" filemode="555" /><commit_msg>fix systemvm start failure casued by missing files<commit_after><?xml version="1.0" encoding="UTF-8"?>

<!-- Copyright 2008 Cloud.com, Inc. All Rights Reserved -->

<project name="Cloud Stack Package" basedir=".">
  <description>
        This is a package.xml with tools to package the cloud stack distribution
    </description>

  <dirname property="base.dir" file="${ant.file.Cloud Stack Package}/.." />
  <property name="build.dir" location="${base.dir}/build" />

  <import file="${build.dir}/build-cloud.xml" optional="false"/>
  
  <property name="target.dir" location="${base.dir}/target"/>
  <property name="scripts.target.dir" location="${target.dir}/scripts"/>
  
  <property name="dist.dir" location="${base.dir}/dist" />
  <property name="publish.dir" location="${dist.dir}" />
  <property name="client.dist.dir" location="${dist.dir}/client" />
  <property name="server.dist.dir" location="${dist.dir}/client" />
  <property name="agent.dist.dir" location="${dist.dir}/agent" />
  <property name="docs.dist.dir" location="${dist.dir}/docs" />
  <property name="db.dist.dir" location="${dist.dir}/db" />
  <property name="usage.dist.dir" location="${dist.dir}/usage" />
  
  <condition property="mkisofs" value="${mkisofs.override}" else="mkisofs">
    <isset property="mkisofs.override" />
  </condition>
  
  <target name="-init-package">
    <mkdir dir="${dist.dir}" />
    <mkdir dir="${publish.dir}" />
  </target>

  <target name="package-server" depends="-init-package">
    <delete file="${dist.dir}/client.zip" />
    <zip destfile="${dist.dir}/client.zip" basedir="${server.dist.dir}" />
  </target>

  <target name="package-client" depends="-init-package">
    <zip destfile="${dist.dir}/client.zip" basedir="${client.dist.dir}">
      <zipfileset dir="${client.dist.dir}">
        <exclude name="**/*.sh" />
      </zipfileset>
      <zipfileset dir="${client.dist.dir}" filemode="555">
        <include name="**/*.sh" />
      </zipfileset>
    </zip>
  </target>

  <target name="package-usage" depends="-init-package">
    <zip destfile="${dist.dir}/usage.zip" basedir="${usage.dist.dir}" />
  </target>

  <target name="package-agent-common" depends="-init-package">
    <zip destfile="${dist.dir}/agent.zip" duplicate="preserve">
      <zipfileset dir="${deps.dir}">
        <include name="cloud-xmlrpc-client-3.1.3.jar" />
        <include name="cloud-xmlrpc-common-3.1.3.jar" />
        <include name="cloud-ws-commons-util-1.0.2.jar" />
        <include name="cloud-log4j.jar" />
        <include name="cloud-apache-log4j-extras-1.0.jar" />
        <include name="cloud-gson.jar" />
        <include name="cloud-commons-httpclient-3.1.jar" />
        <include name="cloud-commons-logging-1.1.1.jar" />
        <include name="cloud-commons-collections-3.2.1.jar" />
        <include name="cloud-commons-codec-1.4.jar" />
        <include name="cloud-commons-pool-1.4.jar" />
        <include name="cloud-libvirt-0.4.5.jar" />
        <include name="cloud-jna.jar" />
        <include name="cloud-cglib.jar" />
      </zipfileset>
      <zipfileset dir="${jar.dir}">
        <include name="${agent.jar}" />
        <include name="${utils.jar}" />
        <include name="${core.jar}" />
        <include name="${api.jar}" />
      </zipfileset>

      <zipfileset dir="${agent.dist.dir}" filemode="770">
        <include name="run.sh" />
        <include name="agent.sh" />
      </zipfileset>
      <zipfileset dir="${agent.dist.dir}">
        <exclude name="run.sh/" />
        <exclude name="agent.sh" />
        <include name="**/*" />
      </zipfileset>
      <zipfileset dir="${scripts.dir}" prefix="scripts" filemode="555">
        <exclude name="**/.project" />
        <exclude name="**/.classpath" />
      </zipfileset>
    </zip>
  </target>


  <target name="package-agent" depends="-init-package, package-oss-systemvm,  build-systemvm-patch, package-agent-common">
    <zip destfile="${dist.dir}/agent.zip" duplicate="preserve" update="true">
      <zipfileset dir="${dist.dir}" prefix="vms">
        <include name="patch.tgz" />
      </zipfileset>
      <zipfileset dir="${dist.dir}" prefix="vms" filemode="555">
        <include name="systemvm.zip" />
      </zipfileset>
    </zip>
  </target>

  <target name="package-oss-systemvm-iso" depends="-init-package, package-oss-systemvm,  build-systemvm-patch">
    <exec executable="${mkisofs}" dir="${dist.dir}">
      <arg value="-quiet"/>
      <arg value="-r"/>
      <arg value="-o"/>
      <arg value="systemvm.iso"/>
      <arg value="systemvm.zip"/>
      <arg value="cloud-scripts.tgz"/>
      <arg value="authorized_keys"/>
    </exec>
  </target>


  <target name="package-agent-simulator" depends="-init-package">
    <delete file="${dist.dir}/agent-simulator.zip" />
    <zip destfile="${dist.dir}/agent-simulator.zip" duplicate="preserve">
      <zipfileset dir="${agent-simulator.dist.dir}">
        <exclude name="**/*.sh" />
        <exclude name="**/vnetd" />
        <exclude name="**/send_arp" />
        <exclude name="**/vn" />
        <exclude name="**/*.exp" />
      </zipfileset>
      <zipfileset dir="${agent-simulator.dist.dir}" filemode="555">
        <include name="**/*.sh" />
        <include name="**/vnetd" />
        <include name="**/send_arp" />
        <include name="**/vn" />
        <include name="**/*.exp" />
      </zipfileset>
    </zip>
  </target>

  <target name="build-all" depends="build-opensource, build-ui, build-war-oss">
  </target>

  <target name="build-war-oss" depends="-init-package" description="Compile the GWT client UI and builds WAR file.">
    <mkdir dir="${client.dist.dir}" />

    <war destfile="${client.dist.dir}/client.war" webxml="${client.dir}/WEB-INF/web.xml">
      <fileset dir="${client.target.dir}">
        <include name="**/*" />
      	<exclude name="**/*.properties" />
      </fileset>
      <classes dir="${client.target.dir}">
    	  <include name="**/resources/*.properties" />
      </classes>
      <lib dir="${jar.dir}">
        <include name="cloud-*.jar" />
		<include name="vmware-*.jar" />
        <exclude name="cloud-servlet-api.jar"/>
      </lib>
      <zipfileset dir="${scripts.target.dir}" prefix="WEB-INF/lib/scripts" filemode="555">
        <include name="**/*" />
      </zipfileset>
    </war>
  </target>


  <target name="package-oss-systemvm" depends="-init-package">
    <zip destfile="${dist.dir}/systemvm.zip" duplicate="preserve" update="true">
      <!-- Console proxy now includes an agent shell, therefore we need to package agent related distribution -->
      <zipfileset dir="${deps.dir}">
        <include name="cloud-xmlrpc-client-3.1.3.jar" />
        <include name="cloud-xmlrpc-common-3.1.3.jar" />
        <include name="cloud-ws-commons-util-1.0.2.jar" />
        <include name="cloud-log4j.jar" />
        <include name="cloud-apache-log4j-extras-1.0.jar" />
        <include name="cloud-gson.jar" />
        <include name="cloud-commons-httpclient-3.1.jar" />
        <include name="cloud-commons-logging-1.1.1.jar" />
        <include name="cloud-commons-collections-3.2.1.jar" />
        <include name="cloud-commons-codec-1.4.jar" />
        <include name="cloud-commons-pool-1.4.jar" />
        <include name="cloud-cglib.jar" />
      </zipfileset>
      <zipfileset dir="${jar.dir}">
        <include name="${agent.jar}" />
        <include name="${utils.jar}" />
        <include name="${core.jar}" />
        <include name="${api.jar}" />
      </zipfileset>
      <zipfileset dir="${console-proxy.dist.dir}" filemode="555">
      </zipfileset>
      <zipfileset dir="${scripts.dir}/storage/secondary" prefix="scripts/storage/secondary" filemode="555">
        <exclude name="**/.project" />
        <exclude name="**/.classpath" />
      </zipfileset>
    </zip>
  </target>

  <target name="package-docs" depends="-init-package">
    <delete file="${dist.dir}/docs.zip" />
    <zip destfile="${dist.dir}/docs.zip" compress="false">
      <fileset dir="${docs.dist.dir}" />
    </zip>
  </target>

  <target name="package-test" depends="-init-package">
    <delete file="${publish.dir}/test.zip" />
    <zip destfile="${publish.dir}/test.zip" compress="false">
      <zipfileset dir="${testclient.dist.dir}" filemode="555" />
    </zip>
  </target>

  <target name="package-tools" depends="-init-package">
    <delete file="${publish.dir}/cloudapitools.zip" />
    <zip destfile="${publish.dir}/cloudapitools.zip" compress="false">
      <zipfileset dir="${tools.dist.dir}" filemode="555" />
{'fraction_non_alphanumeric': 0.2159709618874773, 'fraction_numerical': 0.010538024705813477, 'mean_word_length': 2.9377593360995853, 'pattern_counts': {'":': 0, '<': 385, '<?xml version=': 2, '>': 385, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 18}, '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': '4579210', 'n_tokens_mistral': 5659, 'n_tokens_neox': 5522, 'n_words': 901}