Skip to content

Commit

Permalink
Workflow changes
Browse files Browse the repository at this point in the history
  • Loading branch information
NeeEoo committed Oct 1, 2024
1 parent 120127b commit a8b6e8e
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
sudo apt-get install libvlc-dev libvlccore-dev
- name: Installing/Updating libraries
run: |
haxe -cp commandline -D analyzer-optimize --run Main setup
haxe -cp commandline -D analyzer-optimize --run Main setup -s
- name: Building the game
run: |
haxelib run lime build linux
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
cache-build-mac
- name: Installing/Updating libraries
run: |
haxe -cp commandline -D analyzer-optimize --run Main setup
haxe -cp commandline -D analyzer-optimize --run Main setup -s
- name: Building the game
run: |
haxelib run lime build mac
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
cache-build-windows
- name: Installing/Updating libraries
run: |
haxe -cp commandline -D analyzer-optimize --run Main setup
haxe -cp commandline -D analyzer-optimize --run Main setup -s
- name: Building the game
run: |
haxelib run lime build windows
Expand Down
32 changes: 26 additions & 6 deletions commandline/commands/Update.hx
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,40 @@ import sys.io.File;
import sys.io.Process;
import sys.FileSystem;

using StringTools;

class Update {
public static function main(args:Array<String>) {
prettyPrint("Preparing installation...");

// to prevent messing with currently installed libs
if (!FileSystem.exists('.haxelib'))
FileSystem.createDirectory('.haxelib');

var filename = "./libs.xml";
var isSilent = false;
for(arg in args) {
if (arg.startsWith("--lib=")) {
filename = arg.substr("--lib=".length);
}
if (arg == "--silent" || arg == "-s") {
isSilent = true;
}
}

if(!FileSystem.exists(filename)) {
prettyPrint('Cannot find libs.xml file at "$filename"');
return;
}

prettyPrint("Preparing installation...");

var libs:Array<Library> = [];
var libsXML:Access = new Access(Xml.parse(File.getContent('./libs.xml')).firstElement());
var libsXML:Access = new Access(Xml.parse(File.getContent(filename)).firstElement());

for (libNode in libsXML.elements) {
var lib:Library = {
name: libNode.att.name,
type: libNode.name
type: libNode.name,
skipDeps: libNode.has.skipDeps ? libNode.att.skipDeps == "true" : false
};
if (libNode.has.global) lib.global = libNode.att.global;
switch (lib.type) {
Expand All @@ -38,10 +57,10 @@ class Update {
switch(lib.type) {
case "lib":
prettyPrint((lib.global == "true" ? "Globally installing" : "Locally installing") + ' "${lib.name}"...');
Sys.command('haxelib install ${lib.name} ${lib.version != null ? " " + lib.version : " "}${globalism != null ? ' $globalism' : ''} --always');
Sys.command('haxelib install ${lib.name} ${lib.version != null ? " " + lib.version : " "}${globalism != null ? ' $globalism' : ''}${lib.skipDeps ? " --skip-dependencies" : ""} --always${isSilent ? " --quiet" : ""}');
case "git":
prettyPrint((lib.global == "true" ? "Globally installing" : "Locally installing") + ' "${lib.name}" from git url "${lib.url}"');
Sys.command('haxelib git ${lib.name} ${lib.url}${lib.ref != null ? ' ${lib.ref}' : ''}${globalism != null ? ' $globalism' : ''} --always');
Sys.command('haxelib git ${lib.name} ${lib.url}${lib.ref != null ? ' ${lib.ref}' : ''}${globalism != null ? ' $globalism' : ''}${lib.skipDeps ? " --skip-dependencies" : ""} --always${isSilent ? " --quiet" : ""}');
default:
prettyPrint('Cannot resolve library of type "${lib.type}"');
}
Expand Down Expand Up @@ -123,6 +142,7 @@ class Update {
typedef Library = {
var name:String;
var type:String;
var skipDeps:Bool;
var ?global:String;
var ?version:String;
var ?ref:String;
Expand Down
2 changes: 1 addition & 1 deletion libs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<git name="hscript-improved" url="https://github.com/FNF-CNE-Devs/hscript-improved" ref="custom-classes" />
<git name="flxanimate" url="https://github.com/FNF-CNE-Devs/flxanimate" />
<git name="hxdiscord_rpc" url="https://github.com/FNF-CNE-Devs/hxdiscord_rpc" />
<lib name="hxvlc" />
<lib name="hxvlc" skipDeps="true" />

<!-- Documentation and other features -->
<git name="away3d" url="https://github.com/FNF-CNE-Devs/away3d" />
Expand Down

0 comments on commit a8b6e8e

Please sign in to comment.