No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

build.xml 3.3 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <?xml version="1.0"?>
  2. <project name="Ticketing System."
  3. default="targets" basedir="."
  4. xmlns:dn="antlib:org.apache.ant.dotnet"
  5. xmlns="antlib:org.apache.tools.ant"
  6. xmlns:cpptasks="antlib:net.sf.antcontrib.cpptasks">
  7. <taskdef resource="cpptasks.tasks"/>
  8. <taskdef resource="net/sf/antcontrib/antcontrib.properties"/>
  9. <property name="src" value="src/"/>
  10. <property name="obj.dir" value="obj"/>
  11. <property name="lib" value="./lib" />
  12. <property name="dist.dir" value="bin"/>
  13. <property environment="env"/>
  14. <property name="user" value="${env.USERNAME}"/>
  15. <path id="compile.classpath">
  16. <pathelement location="${build}"/>
  17. <pathelement path="${lib}/json.jar"/>
  18. </path>
  19. <target name="targets">
  20. <echo message="Targets are clean, build, execute, targets"/>
  21. </target>
  22. <target name="build">
  23. <tstamp/>
  24. <!-- Create the build directory structure used by compile -->
  25. <mkdir dir="${dist.dir}" />
  26. <mkdir dir="${obj.dir}" />
  27. <condition property="build.host.islinux">
  28. <and>
  29. <os family="unix" />
  30. <not>
  31. <contains string="${os.name}" substring="mac"
  32. casesensitive="false"/>
  33. </not>
  34. </and>
  35. </condition>
  36. <condition property="build.host.platform" value="linux">
  37. <isset property="build.host.islinux" />
  38. </condition>
  39. <condition property="build.host.ismac">
  40. <and>
  41. <os family="unix" />
  42. <contains string="${os.name}" substring="mac" casesensitive="false"/>
  43. </and>
  44. </condition>
  45. <condition property="build.host.platform" value="mac">
  46. <isset property="build.host.ismac" />
  47. </condition>
  48. <fail unless="build.host.platform"
  49. message="Building on ${os.name} is not supported" />
  50. <echo message="build.host.platform is: ${build.host.platform}"/>
  51. <if>
  52. <isset property="build.host.ismac"/>
  53. <then>
  54. <echo message="detected a mac host"/>
  55. <property name="includepath" value="/opt/local/include:/usr/local/include"/>
  56. <property name="client.lib.path" value="/opt/local/lib"/>
  57. <property name="client.lib.list" value="c++,jsoncpp,stdc++"/>
  58. </then>
  59. <elseif>
  60. <isset property="build.host.islinux"/>
  61. <then>
  62. <echo message="detected a linux host"/>
  63. <property name="includepath" value="/usr/include/jsoncpp"/>
  64. <property name="client.lib.path" value="/usr/local/lib"/>
  65. <property name="client.lib.list" value="jsoncpp,stdc++"/>
  66. </then>
  67. </elseif>
  68. <else>
  69. <echo message="failed to detect a host I know how to build on"/>
  70. </else>
  71. </if>
  72. <echo message="includepath is ${includepath}"/>
  73. <cc outtype="executable" subsystem="console"
  74. outfile="${dist.dir}/main"
  75. objdir="${obj.dir}">
  76. <includepath>
  77. <pathelement path="${includepath}"/>
  78. </includepath>
  79. <libset dir="${client.lib.path}" libs="${client.lib.list}"/>
  80. <fileset dir="${src}" includes="Person.cpp,LogInSystem.cpp,Vehicle.cpp,VehicleManager.cpp,main.cpp"/>
  81. </cc>
  82. </target>
  83. <target name="execute" depends="build">
  84. <exec executable="./bin/main"/>
  85. </target>
  86. <target name="clean">
  87. <delete dir="${obj.dir}" failonerror="false"/>
  88. <delete dir="${dist.dir}" failonerror="false"/>
  89. </target>
  90. </project>