<commit_before><project name="com.mbeddr.core build and test" default="build">

  <property file="../build.properties"/>

  <property name="jvm.arg.Xss" value="-Xss1024k"/>
  <property name="jvm.arg.Xmx" value="-Xmx2048m"/>
  <property name="jvm.arg.XX:MaxPermSize" value="-XX:MaxPermSize=128m"/>
  
  <taskdef name="make-tests" classname="com.mbeddr.tools.ant.MakeTestsTask" classpath="${mbeddr.github.core.home}/tools/ant/tasks/MakeTestsTask.jar" />
  <taskdef name="move-plugin-jars" classname="com.mbeddr.shortenpluginnames.ShortPluginNamesTask" classpath="${mbeddr.github.core.home}/tools/ant/tasks/ShortenPluginJarsTask.jar" />
  
  <!-- validate if path properties are set in build.properties -->
  <fail unless="mbeddr.github.core.home">mbeddr.github.core.home must be set in your build.properties</fail>
  <fail unless="mps.platform.caches">mps.platform.caches must be set in your build.properties</fail>
  <fail unless="mps.home">mps.home must be set in your build.properties</fail>
  
  <path id="mps.ant.path">
   <pathelement location="${mps.home}/lib/mps-backend.jar"/>
   <pathelement location="${mps.home}/lib/jdom.jar"/>
   <pathelement location="${mps.home}/lib/log4j.jar"/>
   <pathelement location="${mps.home}/lib/mps-core.jar"/>
 </path>
 
 <taskdef resource="jetbrains/mps/build/ant/antlib.xml"
          classpathref="mps.ant.path"/>

  <property name="mbeddr.core.project.dir" value="code/languages/com.mbeddr.core"/>
  <property name="mbeddr.core.project.mpr" value="code/languages/com.mbeddr.core/core.dev.mpr"/>  
  
  <property name="util.project.dir" value="code/languages/com.mbeddr.mpsutil"/>
  <property name="util.project.mpr" value="code/languages/com.mbeddr.mpsutil/mpsutil.dev.mpr"/>
  <property name="debugger.project.dir" value="code/languages/com.mbeddr.debugger/"/>
  <property name="debugger.project.mpr" value="code/languages/com.mbeddr.debugger/debugger.dev.mpr"/>
 
  <property name="utilLanguageDir" value="${mbeddr.github.core.home}/${util.project.dir}/languages"/>
  <property name="debuggerLanguageDir" value="${mbeddr.github.core.home}/${debugger.project.dir}/languages"/>
 
  <jvmargs id="myargs">
      <arg value="-ea"/>
      <arg value="${jvm.arg.Xss}"/>
      <arg value="${jvm.arg.Xmx}"/>
      <arg value="${jvm.arg.XX:MaxPermSize}"/>
      <arg value="-XX:+HeapDumpOnOutOfMemoryError"/>
      <arg value="-Didea.system.path=${mps.platform.caches}/system"/>
      <arg value="-Didea.config.path=${mps.platform.caches}/config"/>
      <arg value="-Didea.plugins.path=${mps.platform.caches}/plugins"/>
  </jvmargs>
  
  <target name="init">
      <delete dir="${mps.platform.caches}"/>
      <mkdir dir="${mps.platform.caches}"/>
  </target>
  
  <target name="build">
    <antcall target="build-languages"/>
    <antcall target="build-tests"/>
  </target>
   
  
  <target name="build-languages" depends="init">
    <mps.generate parallelMode="true" fork="true" >
      <jvmargs refid="myargs"/>

      <macro name="mbeddr.github.core.home" path="${mbeddr.github.core.home}"/>

      <library name="util.languages" dir="${utilLanguageDir}"/>
      <library name="debugger.languages" dir="${debuggerLanguageDir}"/>
      <macro name="mbeddr.github.core.home" path="${mbeddr.github.core.home}"/>

      <modules dir="${mbeddr.github.core.home}/${mbeddr.core.project.dir}/languages"/>
      
      <!-- we don't have any solutions at this time -->
      <!--<modules dir="${mbeddr.github.core.home}/${mbeddr.core.project.dir}/solutions"/>-->
    </mps.generate>
  </target>

  
  <target name="build-tests" depends="init">
    <mps.generate parallelMode="false" fork="true">
      <macro name="mbeddr.github.core.home" path="${mbeddr.github.core.home}"/>
      <jvmargs refid="myargs"/>
      
      <macro name="mbeddr.github.core.home" path="${mbeddr.github.core.home}"/>
      
      <library name="mbeddr.project" dir="${mbeddr.github.core.home}/${mbeddr.core.project.dir}"/>
      <library name="util.languages" dir="${utilLanguageDir}"/>
      <library name="debugger.languages" dir="${debuggerLanguageDir}"/>
      
      <modules dir="${mbeddr.github.core.home}/${mbeddr.core.project.dir}/tests"/>

      </mps.generate>
  </target>

  <target name="delete-mps-generated-code" >
      <delete includeemptydirs="true">
      <fileset dir="${mbeddr.github.core.home}/${mbeddr.core.project.dir}" defaultexcludes="false">
         <include name="**/source_gen/**" />
         <include name="**/source_gen.caches/**" />
         <include name="**/classes_gen/**" />
      </fileset>
    </delete>
  </target>
  
  <target name="make-tests" description="Run 'make test' for child Makefiles">
  		
  		<make-tests workingDirectory="${basedir}"/>
		
  </target>
  
  <target name="move-plugin-jars" >  		
  		<move-plugin-jars mpsLocation="${mps.home}"/>		
  </target>
  
  <target name="run-ts-tests" >
    
    <echo message="mbeddr.github.core.home = ${mbeddr.github.core.home}"/>
    <echo message="path.macro.mbeddr.github.core.home := ${mbeddr.github.core.home}"/>
    <echo message="mps.home := ${mps.home}"/>
    
    <junit haltonfailure="true" showoutput="true" fork="true" dir="${mps.home}">
      <jvmarg value="-ea"/>
      <jvmarg value="-Xss1024k"/>
      <jvmarg value="-Xmx1024m"/>
      <jvmarg value="-XX:MaxPermSize=256m"/><commit_msg>cstub-related test code wasn't deleted by core's delete-generated-code task<commit_after><project name="com.mbeddr.core build and test" default="build">

  <property file="../build.properties"/>

  <property name="jvm.arg.Xss" value="-Xss1024k"/>
  <property name="jvm.arg.Xmx" value="-Xmx2048m"/>
  <property name="jvm.arg.XX:MaxPermSize" value="-XX:MaxPermSize=128m"/>
  
  <taskdef name="make-tests" classname="com.mbeddr.tools.ant.MakeTestsTask" classpath="${mbeddr.github.core.home}/tools/ant/tasks/MakeTestsTask.jar" />
  <taskdef name="move-plugin-jars" classname="com.mbeddr.shortenpluginnames.ShortPluginNamesTask" classpath="${mbeddr.github.core.home}/tools/ant/tasks/ShortenPluginJarsTask.jar" />
  
  <!-- validate if path properties are set in build.properties -->
  <fail unless="mbeddr.github.core.home">mbeddr.github.core.home must be set in your build.properties</fail>
  <fail unless="mps.platform.caches">mps.platform.caches must be set in your build.properties</fail>
  <fail unless="mps.home">mps.home must be set in your build.properties</fail>
  
  <path id="mps.ant.path">
   <pathelement location="${mps.home}/lib/mps-backend.jar"/>
   <pathelement location="${mps.home}/lib/jdom.jar"/>
   <pathelement location="${mps.home}/lib/log4j.jar"/>
   <pathelement location="${mps.home}/lib/mps-core.jar"/>
 </path>
 
 <taskdef resource="jetbrains/mps/build/ant/antlib.xml"
          classpathref="mps.ant.path"/>

  <property name="mbeddr.core.project.dir" value="code/languages/com.mbeddr.core"/>
  <property name="mbeddr.core.project.mpr" value="code/languages/com.mbeddr.core/core.dev.mpr"/>  
  
  <property name="util.project.dir" value="code/languages/com.mbeddr.mpsutil"/>
  <property name="util.project.mpr" value="code/languages/com.mbeddr.mpsutil/mpsutil.dev.mpr"/>
  <property name="debugger.project.dir" value="code/languages/com.mbeddr.debugger/"/>
  <property name="debugger.project.mpr" value="code/languages/com.mbeddr.debugger/debugger.dev.mpr"/>
 
  <property name="utilLanguageDir" value="${mbeddr.github.core.home}/${util.project.dir}/languages"/>
  <property name="debuggerLanguageDir" value="${mbeddr.github.core.home}/${debugger.project.dir}/languages"/>
 
  <jvmargs id="myargs">
      <arg value="-ea"/>
      <arg value="${jvm.arg.Xss}"/>
      <arg value="${jvm.arg.Xmx}"/>
      <arg value="${jvm.arg.XX:MaxPermSize}"/>
      <arg value="-XX:+HeapDumpOnOutOfMemoryError"/>
      <arg value="-Didea.system.path=${mps.platform.caches}/system"/>
      <arg value="-Didea.config.path=${mps.platform.caches}/config"/>
      <arg value="-Didea.plugins.path=${mps.platform.caches}/plugins"/>
  </jvmargs>
  
  <target name="init">
      <delete dir="${mps.platform.caches}"/>
      <mkdir dir="${mps.platform.caches}"/>
  </target>
  
  <target name="build">
    <antcall target="build-languages"/>
    <antcall target="build-tests"/>
  </target>
   
  
  <target name="build-languages" depends="init">
    <mps.generate parallelMode="true" fork="true" >
      <jvmargs refid="myargs"/>

      <macro name="mbeddr.github.core.home" path="${mbeddr.github.core.home}"/>

      <library name="util.languages" dir="${utilLanguageDir}"/>
      <library name="debugger.languages" dir="${debuggerLanguageDir}"/>
      <macro name="mbeddr.github.core.home" path="${mbeddr.github.core.home}"/>

      <modules dir="${mbeddr.github.core.home}/${mbeddr.core.project.dir}/languages"/>
      
      <!-- we don't have any solutions at this time -->
      <!--<modules dir="${mbeddr.github.core.home}/${mbeddr.core.project.dir}/solutions"/>-->
    </mps.generate>
  </target>

  
  <target name="build-tests" depends="init">
    <mps.generate parallelMode="false" fork="true">
      <macro name="mbeddr.github.core.home" path="${mbeddr.github.core.home}"/>
      <jvmargs refid="myargs"/>
      
      <macro name="mbeddr.github.core.home" path="${mbeddr.github.core.home}"/>
      
      <library name="mbeddr.project" dir="${mbeddr.github.core.home}/${mbeddr.core.project.dir}"/>
      <library name="util.languages" dir="${utilLanguageDir}"/>
      <library name="debugger.languages" dir="${debuggerLanguageDir}"/>
      
      <modules dir="${mbeddr.github.core.home}/${mbeddr.core.project.dir}/tests"/>

      </mps.generate>
  </target>

  <target name="delete-mps-generated-code" >
      <delete includeemptydirs="true">
      <fileset dir="${mbeddr.github.core.home}/${mbeddr.core.project.dir}" defaultexcludes="false">
         <include name="**/source_gen/**" />
         <include name="**/source_gen.caches/**" />
         <include name="**/classes_gen/**" />
         <include name="**/test_gen/**" />
         <include name="**/test_gen.caches/**" />		 		 
      </fileset>
    </delete>
  </target>
  
  <target name="make-tests" description="Run 'make test' for child Makefiles">
  		
  		<make-tests workingDirectory="${basedir}"/>
		
  </target>
  
  <target name="move-plugin-jars" >  		
  		<move-plugin-jars mpsLocation="${mps.home}"/>		
  </target>
  
  <target name="run-ts-tests" >
    
    <echo message="mbeddr.github.core.home = ${mbeddr.github.core.home}"/>
    <echo message="path.macro.mbeddr.github.core.home := ${mbeddr.github.core.home}"/>
    <echo message="mps.home := ${mps.home}"/>
    
    <junit haltonfailure="true" showoutput="true" fork="true" dir="${mps.home}">
      <jvmarg value="-ea"/>
      <jvmarg value="-Xss1024k"/>
      <jvmarg value="-Xmx1024m"/>
      <jvmarg value="-XX:MaxPermSize=256m"/>
{'fraction_non_alphanumeric': 0.19983300862788755, 'fraction_numerical': 0.004267557287317933, 'mean_word_length': 3.7468075737560547, 'pattern_counts': {'":': 0, '<': 195, '<?xml version=': 0, '>': 195, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '3617094', 'n_tokens_mistral': 3825, 'n_tokens_neox': 3742, 'n_words': 501}