This project simulates the turing machine https://cromer.cl/mt
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

mt.xml 9.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <project name="mt" default="all">
  3. <property file="mt.properties"/>
  4. <!-- Uncomment the following property if no tests compilation is needed -->
  5. <!--
  6. <property name="skip.tests" value="true"/>
  7. -->
  8. <!-- Compiler options -->
  9. <property name="compiler.debug" value="on"/>
  10. <property name="compiler.generate.no.warnings" value="off"/>
  11. <property name="compiler.args" value=""/>
  12. <property name="compiler.max.memory" value="700m"/>
  13. <patternset id="ignored.files">
  14. <exclude name="**/*.hprof/**"/>
  15. <exclude name="**/*.pyc/**"/>
  16. <exclude name="**/*.pyo/**"/>
  17. <exclude name="**/*.rbc/**"/>
  18. <exclude name="**/*.yarb/**"/>
  19. <exclude name="**/*~/**"/>
  20. <exclude name="**/.DS_Store/**"/>
  21. <exclude name="**/.git/**"/>
  22. <exclude name="**/.hg/**"/>
  23. <exclude name="**/.svn/**"/>
  24. <exclude name="**/CVS/**"/>
  25. <exclude name="**/__pycache__/**"/>
  26. <exclude name="**/_svn/**"/>
  27. <exclude name="**/vssver.scc/**"/>
  28. <exclude name="**/vssver2.scc/**"/>
  29. </patternset>
  30. <patternset id="library.patterns">
  31. <include name="*.war"/>
  32. <include name="*.swc"/>
  33. <include name="*.apk"/>
  34. <include name="*.zip"/>
  35. <include name="*.egg"/>
  36. <include name="*.ane"/>
  37. <include name="*.jar"/>
  38. <include name="*.ear"/>
  39. </patternset>
  40. <patternset id="compiler.resources">
  41. <exclude name="**/?*.java"/>
  42. <exclude name="**/?*.form"/>
  43. <exclude name="**/?*.class"/>
  44. <exclude name="**/?*.groovy"/>
  45. <exclude name="**/?*.scala"/>
  46. <exclude name="**/?*.flex"/>
  47. <exclude name="**/?*.kt"/>
  48. <exclude name="**/?*.clj"/>
  49. </patternset>
  50. <!-- JDK definitions -->
  51. <property name="jdk.bin.1.8" value="${jdk.home.1.8}/bin"/>
  52. <path id="jdk.classpath.1.8">
  53. <fileset dir="${jdk.home.1.8}">
  54. <include name="jre/lib/charsets.jar"/>
  55. <include name="jre/lib/deploy.jar"/>
  56. <include name="jre/lib/ext/cldrdata.jar"/>
  57. <include name="jre/lib/ext/dnsns.jar"/>
  58. <include name="jre/lib/ext/jaccess.jar"/>
  59. <include name="jre/lib/ext/jfxrt.jar"/>
  60. <include name="jre/lib/ext/localedata.jar"/>
  61. <include name="jre/lib/ext/nashorn.jar"/>
  62. <include name="jre/lib/ext/sunec.jar"/>
  63. <include name="jre/lib/ext/sunjce_provider.jar"/>
  64. <include name="jre/lib/ext/sunpkcs11.jar"/>
  65. <include name="jre/lib/ext/zipfs.jar"/>
  66. <include name="jre/lib/javaws.jar"/>
  67. <include name="jre/lib/jce.jar"/>
  68. <include name="jre/lib/jfr.jar"/>
  69. <include name="jre/lib/jfxswt.jar"/>
  70. <include name="jre/lib/jsse.jar"/>
  71. <include name="jre/lib/management-agent.jar"/>
  72. <include name="jre/lib/plugin.jar"/>
  73. <include name="jre/lib/resources.jar"/>
  74. <include name="jre/lib/rt.jar"/>
  75. </fileset>
  76. </path>
  77. <property name="project.jdk.home" value="${jdk.home.1.8}"/>
  78. <property name="project.jdk.bin" value="${jdk.bin.1.8}"/>
  79. <property name="project.jdk.classpath" value="jdk.classpath.1.8"/>
  80. <!-- Register Custom Compiler Taskdefs -->
  81. <property name="javac2.home" value="${idea.home}/lib"/>
  82. <path id="javac2.classpath">
  83. <pathelement location="${javac2.home}/javac2.jar"/>
  84. <pathelement location="${javac2.home}/jdom.jar"/>
  85. <pathelement location="${javac2.home}/asm-all.jar"/>
  86. <pathelement location="${javac2.home}/jgoodies-forms.jar"/>
  87. </path>
  88. <target name="register.custom.compilers">
  89. <taskdef name="javac2" classname="com.intellij.ant.Javac2" classpathref="javac2.classpath"/>
  90. <taskdef name="instrumentIdeaExtensions" classname="com.intellij.ant.InstrumentIdeaExtensions" classpathref="javac2.classpath"/>
  91. </target>
  92. <!-- Modules -->
  93. <!-- Module MT -->
  94. <dirname property="module.mt.basedir" file="${ant.file}"/>
  95. <property name="module.jdk.home.mt" value="${jdk.home.1.8}"/>
  96. <property name="module.jdk.bin.mt" value="${jdk.bin.1.8}"/>
  97. <property name="module.jdk.classpath.mt" value="jdk.classpath.1.8"/>
  98. <property name="compiler.args.mt" value="-encoding UTF-8 -source 8 -target 8 ${compiler.args}"/>
  99. <property name="mt.output.dir" value="${module.mt.basedir}/out/production/MT"/>
  100. <property name="mt.testoutput.dir" value="${module.mt.basedir}/out/test/MT"/>
  101. <path id="mt.module.bootclasspath">
  102. <!-- Paths to be included in compilation bootclasspath -->
  103. </path>
  104. <path id="mt.module.production.classpath">
  105. <path refid="${module.jdk.classpath.mt}"/>
  106. </path>
  107. <path id="mt.runtime.production.module.classpath">
  108. <pathelement location="${mt.output.dir}"/>
  109. </path>
  110. <path id="mt.module.classpath">
  111. <path refid="${module.jdk.classpath.mt}"/>
  112. <pathelement location="${mt.output.dir}"/>
  113. </path>
  114. <path id="mt.runtime.module.classpath">
  115. <pathelement location="${mt.testoutput.dir}"/>
  116. <pathelement location="${mt.output.dir}"/>
  117. </path>
  118. <patternset id="excluded.from.module.mt">
  119. <patternset refid="ignored.files"/>
  120. </patternset>
  121. <patternset id="excluded.from.compilation.mt">
  122. <patternset refid="excluded.from.module.mt"/>
  123. </patternset>
  124. <path id="mt.module.sourcepath">
  125. <dirset dir="${module.mt.basedir}">
  126. <include name="src"/>
  127. <include name="ejemplos"/>
  128. </dirset>
  129. </path>
  130. <target name="compile.module.mt" depends="compile.module.mt.production,compile.module.mt.tests" description="Compile module MT"/>
  131. <target name="compile.module.mt.production" depends="register.custom.compilers" description="Compile module MT; production classes">
  132. <mkdir dir="${mt.output.dir}"/>
  133. <javac2 destdir="${mt.output.dir}" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memorymaximumsize="${compiler.max.memory}" fork="true" executable="${module.jdk.bin.mt}/javac">
  134. <compilerarg line="${compiler.args.mt}"/>
  135. <bootclasspath refid="mt.module.bootclasspath"/>
  136. <classpath refid="mt.module.production.classpath"/>
  137. <src refid="mt.module.sourcepath"/>
  138. <patternset refid="excluded.from.compilation.mt"/>
  139. </javac2>
  140. <copy todir="${mt.output.dir}">
  141. <fileset dir="${module.mt.basedir}/src">
  142. <patternset refid="compiler.resources"/>
  143. <type type="file"/>
  144. </fileset>
  145. <fileset dir="${module.mt.basedir}/ejemplos">
  146. <patternset refid="compiler.resources"/>
  147. <type type="file"/>
  148. </fileset>
  149. </copy>
  150. </target>
  151. <target name="compile.module.mt.tests" depends="register.custom.compilers,compile.module.mt.production" description="compile module MT; test classes" unless="skip.tests"/>
  152. <target name="clean.module.mt" description="cleanup module">
  153. <delete dir="${mt.output.dir}"/>
  154. <delete dir="${mt.testoutput.dir}"/>
  155. </target>
  156. <target name="init" description="Build initialization">
  157. <!-- Perform any build initialization in this target -->
  158. </target>
  159. <target name="clean" depends="clean.module.mt, clean.artifact.mt" description="cleanup all"/>
  160. <target name="build.modules" depends="init, clean, compile.module.mt" description="build all modules"/>
  161. <target name="init.artifacts">
  162. <property name="artifacts.temp.dir" value="${basedir}/__artifacts_temp"/>
  163. <property name="artifact.output.mt" value="${basedir}/out/artifacts/MT"/>
  164. <mkdir dir="${artifacts.temp.dir}"/>
  165. <property name="artifact.temp.output.MT" value="${artifacts.temp.dir}/MT.jar"/>
  166. <taskdef resource="com/sun/javafx/tools/ant/antlib.xml" uri="javafx:com.sun.javafx.tools.ant" classpath="${jdk.home.1.8}/lib/ant-javafx.jar"/>
  167. </target>
  168. <target name="clean.artifact.mt" description="clean MT artifact output">
  169. <delete dir="${artifact.output.mt}"/>
  170. </target>
  171. <target xmlns:fx="javafx:com.sun.javafx.tools.ant" name="artifact.mt" depends="init.artifacts, compile.module.mt" description="Build &#39;MT&#39; artifact">
  172. <mkdir dir="${artifact.output.mt}"/>
  173. <copy todir="${artifact.temp.output.MT}">
  174. <fileset dir="${mt.output.dir}"/>
  175. </copy>
  176. <fx:fileset id="all_but_MT" dir="${artifact.temp.output.MT}" includes="**/*.jar">
  177. <exclude name="MT.jar"/>
  178. </fx:fileset>
  179. <fx:fileset id="all_MT" dir="${artifact.temp.output.MT}" includes="**/*.jar"/>
  180. <fx:application id="MT_id" name="MT" mainClass="cl.cromer.mt.MT"/>
  181. <fx:jar destfile="${artifact.temp.output.MT}/MT.jar">
  182. <fx:application refid="MT_id"/>
  183. <fileset dir="${artifact.temp.output.MT}" excludes="**/*.jar"/>
  184. <fx:resources>
  185. <fx:fileset refid="all_but_MT"/>
  186. </fx:resources>
  187. <manifest>
  188. <attribute name="Implementation-Title" value="MT"/>
  189. <attribute name="Implementation-Version" value=""/>
  190. <attribute name="Implementation-Vendor" value=""/>
  191. </manifest>
  192. </fx:jar>
  193. <condition property="app.icon.path" value="${basedir}/src/cl/cromer/mt/images/icon.png">
  194. <and>
  195. <os family="unix"/>
  196. <not>
  197. <os family="mac"/>
  198. </not>
  199. </and>
  200. </condition>
  201. <condition property="app.icon.path" value="${basedir}/src/cl/cromer/mt/images/icon.icns">
  202. <os family="mac"/>
  203. </condition>
  204. <condition property="app.icon.path" value="${basedir}/src/cl/cromer/mt/images/icon.ico">
  205. <os family="windows"/>
  206. </condition>
  207. <fx:deploy width="640" height="480" updatemode="background" outdir="${artifact.temp.output.MT}/deploy" outfile="MT" nativeBundles="all">
  208. <fx:application refid="MT_id"/>
  209. <fx:info title="MT">
  210. <fx:icon href="${app.icon.path}"/>
  211. </fx:info>
  212. <fx:resources>
  213. <fx:fileset refid="all_MT"/>
  214. </fx:resources>
  215. </fx:deploy>
  216. <copy todir="${artifact.output.mt}">
  217. <fileset dir="${artifact.temp.output.MT}/deploy"/>
  218. </copy>
  219. <delete includeemptydirs="true">
  220. <fileset dir="${artifact.temp.output.MT}"/>
  221. </delete>
  222. </target>
  223. <target name="build.all.artifacts" depends="artifact.mt" description="Build all artifacts">
  224. <!-- Delete temporary files -->
  225. <delete dir="${artifacts.temp.dir}"/>
  226. </target>
  227. <target name="all" depends="build.modules, build.all.artifacts" description="build all"/>
  228. </project>