Java.hx 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. package runci.targets;
  2. import sys.FileSystem;
  3. import runci.System.*;
  4. import runci.Config.*;
  5. using StringTools;
  6. class Java {
  7. static var miscJavaDir(get,never):String;
  8. static inline function get_miscJavaDir() return miscDir + 'java/';
  9. static public function getJavaDependencies() {
  10. haxelibInstallGit("HaxeFoundation", "hxjava", true);
  11. runCommand("javac", ["-version"]);
  12. }
  13. static public function run(args:Array<String>) {
  14. deleteDirectoryRecursively("bin/java");
  15. getJavaDependencies();
  16. runCommand("haxe", ["compile-java.hxml"].concat(args));
  17. runCommand("java", ["-jar", "bin/java/TestMain-Debug.jar"]);
  18. runCommand("haxe", ["compile-java.hxml","-dce","no"].concat(args));
  19. runCommand("java", ["-jar", "bin/java/TestMain-Debug.jar"]);
  20. changeDirectory(miscJavaDir);
  21. runCommand("haxe", ["run.hxml"]);
  22. changeDirectory(sysDir);
  23. runCommand("haxe", ["compile-java.hxml"].concat(args));
  24. runCommand("java", ["-jar", "bin/java/Main-Debug.jar"]);
  25. changeDirectory(threadsDir);
  26. runCommand("haxe", ["build.hxml", "-java", "export/java"].concat(args));
  27. if (systemName != "Windows") { // #8154
  28. runCommand("java", ["-jar", "export/java/Main.jar"]);
  29. }
  30. infoMsg("Testing java-lib extras");
  31. changeDirectory('$unitDir/bin');
  32. if (!FileSystem.exists('java-lib-tests')) {
  33. runCommand("git", ["clone", "https://github.com/waneck/java-lib-tests.git", "--depth", "1"], true);
  34. }
  35. for (dir in FileSystem.readDirectory('java-lib-tests'))
  36. {
  37. var path = 'java-lib-tests/$dir';
  38. if (FileSystem.isDirectory(path)) for (file in FileSystem.readDirectory(path))
  39. {
  40. if (file.endsWith('.hxml'))
  41. {
  42. runCommand("haxe", ["--cwd",'java-lib-tests/$dir',file]);
  43. }
  44. }
  45. }
  46. }
  47. }