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

<project name="update BRMS config" default="configure">

  <property file="build.properties" />

  <path id="client-classpath">
    <fileset dir="../../s-ramp-client/target/lib">
      <include name="**/*.jar" />
    </fileset>
    <fileset dir="../../s-ramp-client/target/">
      <include name="s-ramp-client-${sramp.version}.jar" />
    </fileset>
  </path>

  <target name="install">
    <mkdir dir="${sramp.jbpm5.dir}" />
    <echo>Downloading the jbpm5.4 installer. This may take a while, go get some coffee</echo>
    <get src="${sramp.jbpm5.url}" dest="${sramp.jbpm5.dir}" usetimestamp="true" />
    <echo>Unzipping jbpm5 to ${sramp.jbpm5.dir}</echo>
    <unzip src="${sramp.jbpm5.dir}/jbpm-5.4.0.Final-installer-full.zip" dest="${sramp.jbpm5.dir}" overwrite="false" />
    <ant dir="${sramp.jbpm5.dir}/jbpm-installer" target="install.demo.noeclipse" />
    <echo>Upgrading JBossAS to RESTeasy 2.3.5</echo>
    <get src="${sramp.resteasy.url}" dest="${sramp.jbpm5.dir}/resteasy-jaxrs-2.3.5.Final-all.zip" usetimestamp="true" />
    <echo>Unzipping RESTeasy to ${sramp.jbpm5.dir}</echo>
    <unzip src="${sramp.jbpm5.dir}/resteasy-jaxrs-2.3.5.Final-all.zip" dest="${sramp.jbpm5.dir}" overwrite="false" />
    <echo>Upgrading RESTEasy in JBossAS</echo>
    <unzip src="${sramp.jbpm5.dir}/resteasy-jaxrs-2.3.5.Final/resteasy-jboss-modules-2.3.5.Final.zip" dest="${sramp.jboss.home}/modules" overwrite="false" />
    <echo>Patching ${sramp.jboss.home}/modules/org/jboss/resteasy/resteasy-jaxrs/main/module.xml in JBossAS</echo>
    <copy file="updates/module.xml" tofile="${sramp.jboss.home}/modules/org/jboss/resteasy/resteasy-jaxrs/main/module.xml" />
  </target>

  <target name="configure" depends="patch.jbpm-gwt-console-server,deploy.sramp">
    <!-- pointing jBPM to S-RAMP -->
    <copy file="updates/default.jbpm.console.properties" todir="${sramp.jboss.home}/standalone/deployments/jbpm-gwt-console-server.war/WEB-INF/classes/" overwrite="true" />
  </target>

  <target name="start">
    <ant dir="${sramp.jbpm5.dir}/jbpm-installer" target="start.demo.noeclipse" />
  </target>

  <target name="tail">
    <exec executable="tail">
      <arg value="-f" />
      <arg value="${sramp.jbpm5.dir}/jbpm-installer/jboss-as-7.1.1.Final/standalone/log/server.log" />
    </exec>
  </target>

  <target name="upload" depends="dist.check,upload.to.brms.fromsrc,brms.to.sramp.fromsrc,upload.to.brms.fromdist,brms.to.sramp.fromdist" />
  
  <target name="dist.check">
    <condition property="is.dist">
      <available file="bin/s-ramp-shell-${sramp.version}.jar" type="file" />
    </condition>
  </target>

  <target name="stop">
    <ant dir="${sramp.jbpm5.dir}/jbpm-installer" target="stop.demo" />
  </target>

  <target name="deploy.sramp" depends="patch.jbpm-gwt-console-server">
    <copy file="${sramp.war.path}" tofile="${sramp.jboss.home}/standalone/deployments/s-ramp-atom.war" failonerror="true" />
    <copy file="${sramp-ui.war.path}" tofile="${sramp.jboss.home}/standalone/deployments/s-ramp-ui.war" failonerror="false" />
  </target>

  <target name="upload.to.brms.fromsrc" unless="is.dist">
    <java classname="org.overlord.sramp.client.shell.commands.brms.Dir2BrmsCommand">
      <classpath refid="client-classpath" />
    </java>
  </target>
  <target name="upload.to.brms.fromdist" if="is.dist">
    <java jar="bin/s-ramp-shell-${sramp.version}.jar" fork="true">
      <arg value="-f" />
      <arg value="updates/upload-to-brms.cmds.txt" />
    </java>
  </target>

  <target name="brms.to.sramp.fromsrc" unless="is.dist">
  	<echo>Load Workflows into S-RAMP</echo>
    <java classname="org.overlord.sramp.client.shell.commands.brms.Pkg2SrampCommand">
      <classpath refid="client-classpath" />
    </java>
  </target>
  <target name="brms.to.sramp.fromdist" if="is.dist">
    <java jar="bin/s-ramp-shell-${sramp.version}.jar" fork="true">
      <arg value="-f" />
      <arg value="updates/brms-to-sramp.cmds.txt" />
    </java>
  </target>

  <target name="patch.jbpm-gwt-console-server" depends="explode.jbpm-gwt-console-server">
    <mkdir dir="restore" />
    <copy file="${sramp.workitems.path}" tofile="${sramp.jboss.home}/standalone/deployments/jbpm-gwt-console-server.war/WEB-INF/lib/s-ramp-workitems.jar" />
    <copy file="updates/CustomWorkItemHandlers.conf" todir="${sramp.jboss.home}/standalone/deployments/jbpm-gwt-console-server.war/WEB-INF/classes/META-INF/" overwrite="true" />
  </target>

  <target name="explode.jbpm-gwt-console-server" depends="dir.check" unless="dir.exists">
    <echo>Exploding the jbpm-gwt-console-server.war, keeping a backup in restore</echo>
    <move file="${sramp.jboss.home}/standalone/deployments/jbpm-gwt-console-server.war" todir="restore" />
    <mkdir dir="${sramp.jboss.home}/standalone/deployments/jbpm-gwt-console-server.war" />
    <unzip src="restore/jbpm-gwt-console-server.war" dest="${sramp.jboss.home}/standalone/deployments/jbpm-gwt-console-server.war" />
  	<touch file="${sramp.jboss.home}/standalone/deployments/jbpm-gwt-console-server.war.dodeploy" />
  </target>

  <target name="dir.check">
    <condition property="dir.exists">
      <available file="${sramp.jboss.home}/standalone/deployments/jbpm-gwt-console-server.war" type="dir" />
    </condition>
  </target>

  <target name="clean">
    <delete dir="${sramp.jboss.home}/standalone/deployments/jbpm-gwt-console-server.war" />
    <copy file="restore/jbpm-gwt-console-server.war" todir="${sramp.jboss.home}/standalone/deployments/" />
  </target>

</project>
<commit_msg>fixing the build.xml so upload works again<commit_after><?xml version="1.0" encoding="UTF-8"?>

<project name="update BRMS config" default="configure">

  <property file="build.properties" />

  <path id="client-classpath">
    <fileset dir="../../s-ramp-client/target/lib">
      <include name="**/*.jar" />
    </fileset>
    <fileset dir="../../s-ramp-client/target/">
      <include name="s-ramp-client-${sramp.version}.jar" />
    </fileset>
  	<fileset dir="../target/">
      <include name="s-ramp-governance-classes.jar" />
    </fileset>
  </path>

  <target name="install">
    <mkdir dir="${sramp.jbpm5.dir}" />
    <echo>Downloading the jbpm5.4 installer. This may take a while, go get some coffee</echo>
    <get src="${sramp.jbpm5.url}" dest="${sramp.jbpm5.dir}" usetimestamp="true" />
    <echo>Unzipping jbpm5 to ${sramp.jbpm5.dir}</echo>
    <unzip src="${sramp.jbpm5.dir}/jbpm-5.4.0.Final-installer-full.zip" dest="${sramp.jbpm5.dir}" overwrite="false" />
    <ant dir="${sramp.jbpm5.dir}/jbpm-installer" target="install.demo.noeclipse" />
    <echo>Upgrading JBossAS to RESTeasy 2.3.5</echo>
    <get src="${sramp.resteasy.url}" dest="${sramp.jbpm5.dir}/resteasy-jaxrs-2.3.5.Final-all.zip" usetimestamp="true" />
    <echo>Unzipping RESTeasy to ${sramp.jbpm5.dir}</echo>
    <unzip src="${sramp.jbpm5.dir}/resteasy-jaxrs-2.3.5.Final-all.zip" dest="${sramp.jbpm5.dir}" overwrite="false" />
    <echo>Upgrading RESTEasy in JBossAS</echo>
    <unzip src="${sramp.jbpm5.dir}/resteasy-jaxrs-2.3.5.Final/resteasy-jboss-modules-2.3.5.Final.zip" dest="${sramp.jboss.home}/modules" overwrite="false" />
    <echo>Patching ${sramp.jboss.home}/modules/org/jboss/resteasy/resteasy-jaxrs/main/module.xml in JBossAS</echo>
    <copy file="updates/module.xml" tofile="${sramp.jboss.home}/modules/org/jboss/resteasy/resteasy-jaxrs/main/module.xml" />
  </target>

  <target name="configure" depends="patch.jbpm-gwt-console-server,deploy.sramp">
    <!-- pointing jBPM to S-RAMP -->
    <copy file="updates/default.jbpm.console.properties" todir="${sramp.jboss.home}/standalone/deployments/jbpm-gwt-console-server.war/WEB-INF/classes/" overwrite="true" />
  </target>

  <target name="start">
    <ant dir="${sramp.jbpm5.dir}/jbpm-installer" target="start.demo.noeclipse" />
  </target>

  <target name="tail">
    <exec executable="tail">
      <arg value="-f" />
      <arg value="${sramp.jbpm5.dir}/jbpm-installer/jboss-as-7.1.1.Final/standalone/log/server.log" />
    </exec>
  </target>

  <target name="upload" depends="dist.check,upload.to.brms.fromsrc,brms.to.sramp.fromsrc,upload.to.brms.fromdist,brms.to.sramp.fromdist" />
  
  <target name="dist.check">
    <condition property="is.dist">
      <available file="bin/s-ramp-shell-${sramp.version}.jar" type="file" />
    </condition>
  </target>

  <target name="stop">
    <ant dir="${sramp.jbpm5.dir}/jbpm-installer" target="stop.demo" />
  </target>

  <target name="deploy.sramp" depends="patch.jbpm-gwt-console-server">
    <copy file="${sramp.war.path}" tofile="${sramp.jboss.home}/standalone/deployments/s-ramp-atom.war" failonerror="true" />
    <copy file="${sramp-ui.war.path}" tofile="${sramp.jboss.home}/standalone/deployments/s-ramp-ui.war" failonerror="false" />
  </target>

  <target name="upload.to.brms.fromsrc" unless="is.dist">
    <java classname="org.overlord.sramp.governance.shell.commands.Dir2BrmsCommand">
      <classpath refid="client-classpath" />
    </java>
  </target>
  <target name="upload.to.brms.fromdist" if="is.dist">
    <java jar="bin/s-ramp-shell-${sramp.version}.jar" fork="true">
      <arg value="-f" />
      <arg value="updates/upload-to-brms.cmds.txt" />
    </java>
  </target>

  <target name="brms.to.sramp.fromsrc" unless="is.dist">
  	<echo>Load Workflows into S-RAMP</echo>
    <java classname="org.overlord.sramp.governance.shell.commands.Pkg2SrampCommand">
      <classpath refid="client-classpath" />
    </java>
  </target>
  <target name="brms.to.sramp.fromdist" if="is.dist">
    <java jar="bin/s-ramp-shell-${sramp.version}.jar" fork="true">
      <arg value="-f" />
      <arg value="updates/brms-to-sramp.cmds.txt" />
    </java>
  </target>

  <target name="patch.jbpm-gwt-console-server" depends="explode.jbpm-gwt-console-server">
    <mkdir dir="restore" />
    <copy file="${sramp.workitems.path}" tofile="${sramp.jboss.home}/standalone/deployments/jbpm-gwt-console-server.war/WEB-INF/lib/s-ramp-workitems.jar" />
    <copy file="updates/CustomWorkItemHandlers.conf" todir="${sramp.jboss.home}/standalone/deployments/jbpm-gwt-console-server.war/WEB-INF/classes/META-INF/" overwrite="true" />
  </target>

  <target name="explode.jbpm-gwt-console-server" depends="dir.check" unless="dir.exists">
    <echo>Exploding the jbpm-gwt-console-server.war, keeping a backup in restore</echo>
    <move file="${sramp.jboss.home}/standalone/deployments/jbpm-gwt-console-server.war" todir="restore" />
    <mkdir dir="${sramp.jboss.home}/standalone/deployments/jbpm-gwt-console-server.war" />
    <unzip src="restore/jbpm-gwt-console-server.war" dest="${sramp.jboss.home}/standalone/deployments/jbpm-gwt-console-server.war" />
  	<touch file="${sramp.jboss.home}/standalone/deployments/jbpm-gwt-console-server.war.dodeploy" />
  </target>

  <target name="dir.check">
    <condition property="dir.exists">
      <available file="${sramp.jboss.home}/standalone/deployments/jbpm-gwt-console-server.war" type="dir" />
    </condition>
  </target>

  <target name="clean">
    <delete dir="${sramp.jboss.home}/standalone/deployments/jbpm-gwt-console-server.war" />
    <copy file="restore/jbpm-gwt-console-server.war" todir="${sramp.jboss.home}/standalone/deployments/" />
  </target>

</project>

{'fraction_non_alphanumeric': 0.20361349747586574, 'fraction_numerical': 0.007793818085200602, 'mean_word_length': 3.9635164835164836, 'pattern_counts': {'":': 0, '<': 218, '<?xml version=': 2, '>': 218, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 9}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7227056', 'n_tokens_mistral': 4436, 'n_tokens_neox': 4198, 'n_words': 503}