Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for customMetas and customDefines fields #573

Merged
merged 11 commits into from Nov 23, 2022
2 changes: 2 additions & 0 deletions src/haxelib/Data.hx
Expand Up @@ -153,6 +153,8 @@ typedef Infos = {
@:optional var tags : Array<String>;
@:optional var dependencies : Dependencies;
@:optional var main:String;
@:optional var customDefines:String;
@:optional var customMetas:String;
tobil4sk marked this conversation as resolved.
Show resolved Hide resolved
}

/** An abstract enum representing the different Licenses a project can have. **/
Expand Down
12 changes: 12 additions & 0 deletions src/haxelib/api/GlobalScope.hx
Expand Up @@ -185,6 +185,18 @@ class GlobalScope extends Scope {
);
addLine('-D ${info.name}=${info.version}');

// custom defines if defined
if (info.customDefines != null && info.customDefines != "") {
var path = Path.join([resolved.path, info.customDefines]);
addLine('--macro addDefinesDescriptionFile(\'$path\')');
}

// custom metadatas if defined
if (info.customMetas != null && info.customMetas != "") {
var path = Path.join([resolved.path, info.customMetas]);
addLine('--macro addMetadataDescriptionFile(\'$path\')');
}

tobil4sk marked this conversation as resolved.
Show resolved Hide resolved
// add dependencies to stack
final dependencies = info.dependencies.extractDataArray();

Expand Down