build.xml 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <project name="modern-locale" default=".help">
  3. <!--
  4. The build-impl.xml file imported here contains the guts of the build process. It is
  5. a great idea to read that file to understand how the process works, but it is best to
  6. limit your changes to this file.
  7. -->
  8. <script language="javascript">
  9. <![CDATA[
  10. var dir = project.getProperty("basedir"),
  11. cmdDir = project.getProperty("cmd.dir"),
  12. cmdLoaded = project.getReference("senchaloader");
  13. if (!cmdLoaded) {
  14. function echo(message, file) {
  15. var e = project.createTask("echo");
  16. e.setMessage(message);
  17. if (file) {
  18. e.setFile(file);
  19. }
  20. e.execute();
  21. };
  22. if (!cmdDir) {
  23. function exec(args) {
  24. var process = java.lang.Runtime.getRuntime().exec(args),
  25. input = new java.io.BufferedReader(new java.io.InputStreamReader(process.getInputStream())),
  26. headerFound = false,
  27. line;
  28. while (line = input.readLine()) {
  29. line = line + '';
  30. java.lang.System.out.println(line);
  31. if (line.indexOf("Sencha Cmd") > -1) {
  32. headerFound = true;
  33. }
  34. else if (headerFound && !cmdDir) {
  35. cmdDir = line;
  36. project.setProperty("cmd.dir", cmdDir);
  37. }
  38. }
  39. process.waitFor();
  40. return !!cmdDir;
  41. }
  42. if (!exec(["sencha", "which"])) {
  43. var tmpFile = "tmp.sh";
  44. echo("source ~/.bash_profile; sencha " + whichArgs.join(" "), tmpFile);
  45. exec(["/bin/sh", tmpFile]);
  46. new java.io.File(tmpFile)['delete']();
  47. }
  48. }
  49. }
  50. if (cmdDir && !project.getTargets().containsKey("init-cmd")) {
  51. var importTask = project.createTask("import");
  52. importTask.setOwningTarget(self.getOwningTarget());
  53. importTask.setLocation(self.getLocation());
  54. importTask.setFile(cmdDir + "/ant/build/package/build-impl.xml");
  55. importTask.execute();
  56. }
  57. ]]>
  58. </script>
  59. <import file="${basedir}/.sencha/test/test-impl.xml"/>
  60. <!--
  61. The following targets can be provided to inject logic before and/or after key steps
  62. of the build process:
  63. The "init-local" target is used to initialize properties that may be personalized
  64. for the local machine.
  65. <target name="-before-init-local"/>
  66. <target name="-after-init-local"/>
  67. The "clean" target is used to clean build output from the build.dir.
  68. <target name="-before-clean"/>
  69. <target name="-after-clean"/>
  70. The general "init" target is used to initialize all other properties, including
  71. those provided by Sencha Cmd.
  72. <target name="-before-init"/>
  73. <target name="-after-init"/>
  74. The "build" target performs the call to Sencha Cmd to build the application.
  75. <target name="-before-build"/>
  76. <target name="-after-build"/>
  77. -->
  78. <target name="build" depends="init,build-all"/>
  79. <target name="build-all" depends="init,-build-all,pkg"/>
  80. <target name="-build-all">
  81. <for param="build.locale.dir">
  82. <dirset dir="${package.dir}/overrides" includes="*"/>
  83. <sequential>
  84. <local name="build.locale"/>
  85. <basename file="@{build.locale.dir}"
  86. property="build.locale"/>
  87. <echo>Building locale ${build.locale}</echo>
  88. <concat encoding="UTF-8" outputencoding="UTF-8" destfile="${build.dir}/${package.name}-${build.locale}-debug.js">
  89. <fileset dir="@{build.locale.dir}" includes="**/*.js"/>
  90. <filterchain>
  91. <deletecharacters chars="&#xFEFF;" />
  92. </filterchain>
  93. </concat>
  94. <x-compress-js srcfile="${build.dir}/${package.name}-${build.locale}-debug.js"
  95. outfile="${build.dir}/${package.name}-${build.locale}.js"/>
  96. <!--
  97. <ant antfile="${package.dir}/build.xml"
  98. inheritall="false"
  99. target="js"
  100. useNativeBasedir="true"
  101. inheritrefs="true">
  102. <property name="package.framework" value="ext"/>
  103. <property name="cmd.dir" value="${cmd.dir}"/>
  104. <property name="compiler.ref.id"
  105. value="${compiler.ref.id}-${build.locale}"/>
  106. <property name="package.locale" value="${build.locale}"/>
  107. <property name="build.name.prefix" value="${package.name}-${build.locale}"/>
  108. <property name="build.name.css.prefix" value="${package.name}-${build.locale}"/>
  109. </ant>
  110. -->
  111. </sequential>
  112. </for>
  113. </target>
  114. </project>