Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion src/net/pickhaxe/tools/commands/Build.hx
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,17 @@ class Build implements ICommand
}
}

// Include the user's dependencies.
for (dependency in defines.pickhaxe.mod.dependencies)
{
var isExtern:String = !dependency.externLib ? '' : '-extern';

if (dependency.value.endsWith('.jar'))
{
args = args.concat(['--java-lib' + isExtern, '${dependency.value}']);
}
}

// Pass options to the native Java compiler.
// Any values passed here will be passed to `javac` when generating a JAR.

Expand Down Expand Up @@ -686,4 +697,4 @@ class Build implements ICommand

// CLI.print(exitCode);
}
}
}
7 changes: 6 additions & 1 deletion src/net/pickhaxe/tools/schema/PickHaxeDefines.hx
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ typedef PickHaxeDefinesMod =
version:String,
description:String,
entryPoints:Array<PickHaxeProject.ModEntryPoint>,
dependencies:Array<PickHaxeProject.ModDependency>,
license:String,

authorData:AuthorData,
Expand Down Expand Up @@ -373,6 +374,8 @@ class Builder

entryPoints: projectFile.entryPoints,

dependencies: projectFile?.dependencies ?? [],

// Default license
license: projectFile?.license?.value ?? 'All Rights Reserved',

Expand Down Expand Up @@ -538,6 +541,8 @@ class Builder

entryPoints: projectFile.entryPoints,

dependencies: projectFile?.dependencies ?? [],

license: projectFile?.license?.value ?? 'All Rights Reserved',

authorData: {
Expand Down Expand Up @@ -602,4 +607,4 @@ class Builder

return result;
}
}
}
15 changes: 15 additions & 0 deletions src/net/pickhaxe/tools/schema/PickHaxeProject.hx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ typedef PickHaxe =

@:list('mod-contributor') var contributors:Array<ModAuthor>;

@:list('mod-dependency') var dependencies:Array<ModDependency>;

/**
* Add new Haxelibs as dependencies to the project.
*/
Expand Down Expand Up @@ -167,3 +169,16 @@ typedef ModLicense =
{
> ValueTag,
};

/**
* `<mod-dependency>` tag.
*/
typedef ModDependency =
{
> ValueTag,

/**
* Should the dependency be external.
*/
@:optional @:attr var externLib:Bool;
};
10 changes: 8 additions & 2 deletions templates/pickhaxe-project.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,21 @@
</xs:complexContent>
</xs:complexType>

<xs:complexType name="dependency">
<xs:attribute name="value" type="xs:string" use="required" />
<xs:attribute name="externLib" type="xs:boolean" use="optional" />
</xs:complexType>

<xs:element name="pickhaxe">
<xs:complexType>
<xs:all>
<xs:element name="mod" type="mod" minOccurs="1" maxOccurs="1" />
<xs:element name="mod-metadata" type="metadata" minOccurs="1" maxOccurs="1" />
<xs:element name="mod-license" type="license" minOccurs="0" maxOccurs="1" />
<xs:element name="mod-contact" type="contact-info" minOccurs="0" maxOccurs="1" />
<xs:element name="mod-entry-point" type="entry-point" minOccurs="1" maxOccurs="unbounded"/>
<xs:element name="mod-author" type="author" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="mod-entry-point" type="entry-point" minOccurs="1" maxOccurs="unbounded" />
<xs:element name="mod-author" type="author" minOccurs="0" maxOccurs="unbounded" />
<xs:element name="mod-dependency" type="dependency" minOccurs="0" maxOccurs="unbounded" />
</xs:all>
</xs:complexType>
</xs:element>
Expand Down