build.xml 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <project name="core" 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="-after-apply-version">
  79. <replace file="${package.dir}/src/util/Version.js"
  80. token="'5.0.0'"
  81. value="'${build.version}'"/>
  82. </target>
  83. <!--
  84. ******************************************************************
  85. Private/Internal targets
  86. ******************************************************************
  87. -->
  88. <target name="bootstrap" depends="init">
  89. <x-sencha-command>
  90. <![CDATA[
  91. compile
  92. -ignore=diag
  93. union
  94. -tag=package-core
  95. and
  96. metadata
  97. -base-path=${basedir}
  98. +filenames
  99. -jsonp=ExtBootstrap.loadScript
  100. -out=${basedir}/bootstrap-files.js
  101. and
  102. include
  103. +all
  104. and
  105. exclude
  106. -file=Ext.js
  107. and
  108. metadata
  109. -base-path=${basedir}
  110. +loader-paths
  111. -jsonp=ExtBootstrap.loadClassPaths
  112. -out=${basedir}/bootstrap-data.js
  113. and
  114. metadata
  115. -base-path=${basedir}
  116. +alternates
  117. +append
  118. -out=${basedir}/bootstrap-data.js
  119. and
  120. metadata
  121. -base-path=${basedir}
  122. +alias
  123. +append
  124. -out=${basedir}/bootstrap-data.js
  125. ]]>
  126. </x-sencha-command>
  127. </target>
  128. </project>