Skip to content

Commit

Permalink
[ci] fix flash tests (need to insteall flex tools for flash as well now)
Browse files Browse the repository at this point in the history
  • Loading branch information
nadako committed Apr 26, 2019
1 parent e47d8c9 commit 0971b8a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 23 deletions.
24 changes: 1 addition & 23 deletions tests/runci/targets/As3.hx
Original file line number Diff line number Diff line change
@@ -1,33 +1,11 @@
package runci.targets;

import sys.FileSystem;
import runci.System.*;
import runci.Config.*;
import haxe.Json;
import sys.io.File;
import haxe.Http;

class As3 {
static public function run(args:Array<String>) {
runci.targets.Flash.setupFlashPlayerDebugger();

//setup flex sdk
if (commandSucceed("mxmlc", ["--version"])) {
infoMsg('mxmlc has already been installed.');
} else {
var apacheMirror = Json.parse(Http.requestUrl("http://www.apache.org/dyn/closer.lua?as_json=1")).preferred;
var flexVersion = "4.16.0";
runCommand("wget", ["-nv", '${apacheMirror}/flex/${flexVersion}/binaries/apache-flex-sdk-${flexVersion}-bin.tar.gz'], true);
runCommand("tar", ["-xf", 'apache-flex-sdk-${flexVersion}-bin.tar.gz', "-C", Sys.getEnv("HOME")]);
var flexsdkPath = Sys.getEnv("HOME") + '/apache-flex-sdk-${flexVersion}-bin';
addToPATH(flexsdkPath + "/bin");
var playerglobalswcFolder = flexsdkPath + "/player";
FileSystem.createDirectory(playerglobalswcFolder + "/11.1");
var flashVersion = runci.targets.Flash.getLatestFPVersion();
runCommand("wget", ["-nv", 'http://download.macromedia.com/get/flashplayer/updaters/${flashVersion[0]}/playerglobal${flashVersion[0]}_${flashVersion[1]}.swc', "-O", playerglobalswcFolder + "/11.1/playerglobal.swc"], true);
File.saveContent(flexsdkPath + "/env.properties", 'env.PLAYERGLOBAL_HOME=$playerglobalswcFolder');
runCommand("mxmlc", ["--version"]);
}
runci.targets.Flash.setupFlexSdk();

runCommand("haxe", ["compile-as3.hxml", "-D", "fdb"].concat(args));
var success = runci.targets.Flash.runFlash("bin/unit9_as3.swf");
Expand Down
22 changes: 22 additions & 0 deletions tests/runci/targets/Flash.hx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ package runci.targets;
import sys.io.File;
import sys.FileSystem;
import haxe.io.Path;
import haxe.Json;
import sys.io.Process;
import haxe.Http;

import runci.System.*;
import runci.Config.*;
Expand All @@ -15,6 +17,25 @@ class Flash {
return versionStr.split(",").map(Std.parseInt);
}

static public function setupFlexSdk():Void {
if (commandSucceed("mxmlc", ["--version"])) {
infoMsg('mxmlc has already been installed.');
} else {
var apacheMirror = Json.parse(Http.requestUrl("http://www.apache.org/dyn/closer.lua?as_json=1")).preferred;
var flexVersion = "4.16.0";
runCommand("wget", ["-nv", '${apacheMirror}/flex/${flexVersion}/binaries/apache-flex-sdk-${flexVersion}-bin.tar.gz'], true);
runCommand("tar", ["-xf", 'apache-flex-sdk-${flexVersion}-bin.tar.gz', "-C", Sys.getEnv("HOME")]);
var flexsdkPath = Sys.getEnv("HOME") + '/apache-flex-sdk-${flexVersion}-bin';
addToPATH(flexsdkPath + "/bin");
var playerglobalswcFolder = flexsdkPath + "/player";
FileSystem.createDirectory(playerglobalswcFolder + "/11.1");
var flashVersion = runci.targets.Flash.getLatestFPVersion();
runCommand("wget", ["-nv", 'http://download.macromedia.com/get/flashplayer/updaters/${flashVersion[0]}/playerglobal${flashVersion[0]}_${flashVersion[1]}.swc', "-O", playerglobalswcFolder + "/11.1/playerglobal.swc"], true);
File.saveContent(flexsdkPath + "/env.properties", 'env.PLAYERGLOBAL_HOME=$playerglobalswcFolder');
runCommand("mxmlc", ["--version"]);
}
}

static public function setupFlashPlayerDebugger():Void {
var mmcfgPath = switch (systemName) {
case "Linux":
Expand Down Expand Up @@ -120,6 +141,7 @@ class Flash {

static public function run(args:Array<String>) {
setupFlashPlayerDebugger();
setupFlexSdk();
runCommand("haxe", ["compile-flash9.hxml", "-D", "fdb", "-D", "dump", "-D", "dump_ignore_var_ids"].concat(args));
var success = runFlash("bin/unit9.swf");
if (!success)
Expand Down

0 comments on commit 0971b8a

Please sign in to comment.