build.xml 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <project name="google" 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. <!--
  60. The following targets can be provided to inject logic before and/or after key steps
  61. of the build process:
  62. The "init-local" target is used to initialize properties that may be personalized
  63. for the local machine.
  64. <target name="-before-init-local"/>
  65. <target name="-after-init-local"/>
  66. The "clean" target is used to clean build output from the build.dir.
  67. <target name="-before-clean"/>
  68. <target name="-after-clean"/>
  69. The general "init" target is used to initialize all other properties, including
  70. those provided by Sencha Cmd.
  71. <target name="-before-init"/>
  72. <target name="-after-init"/>
  73. The "build" target performs the call to Sencha Cmd to build the application.
  74. <target name="-before-build"/>
  75. <target name="-after-build"/>
  76. -->
  77. </project>