Fix #extern with haxe 4.3.0
This commit is contained in:
@@ -29,8 +29,6 @@ typedef CompilationArgs = {
|
|||||||
?skipHaxelibInstall:Bool,
|
?skipHaxelibInstall:Bool,
|
||||||
// path to a package.json, requirements.txt, or setup.py file
|
// path to a package.json, requirements.txt, or setup.py file
|
||||||
?langProjectFile:String,
|
?langProjectFile:String,
|
||||||
// path to a haxe file defining the Main class
|
|
||||||
?mainHxFile:String,
|
|
||||||
// paths to extra files to copy
|
// paths to extra files to copy
|
||||||
?extraFiles:Array<String>
|
?extraFiles:Array<String>
|
||||||
}
|
}
|
||||||
@@ -119,25 +117,18 @@ class CompilerTools {
|
|||||||
var messageBeforePath = "haxelib repository is now ";
|
var messageBeforePath = "haxelib repository is now ";
|
||||||
var haxelibRepositoryPath = haxelibSetupOutput.substr(haxelibSetupOutput.indexOf(messageBeforePath)).replace(messageBeforePath, "");
|
var haxelibRepositoryPath = haxelibSetupOutput.substr(haxelibSetupOutput.indexOf(messageBeforePath)).replace(messageBeforePath, "");
|
||||||
|
|
||||||
// If a main haxe file was given, use it.
|
var mainHxFile = "ExternMain.hx";
|
||||||
// Otherwise use the default
|
|
||||||
var mainHxFile = "ScriptMain.hx";
|
|
||||||
if (args.mainHxFile != null) {
|
|
||||||
mainHxFile = args.mainHxFile;
|
|
||||||
copyToFolder(mainHxFile);
|
|
||||||
} else {
|
|
||||||
copyToFolder(mainHxFile, Path.join([Prelude.libPath("kiss"), "src", "kiss"]));
|
copyToFolder(mainHxFile, Path.join([Prelude.libPath("kiss"), "src", "kiss"]));
|
||||||
}
|
|
||||||
|
|
||||||
var mainClassName = mainHxFile.withoutDirectory().withoutExtension();
|
var mainClassName = mainHxFile.withoutDirectory().withoutExtension();
|
||||||
|
|
||||||
// make the kiss file just the given expressions dumped into a file,
|
// make the kiss file just the given expressions dumped into a file,
|
||||||
// with a corresponding name to the mainClassName
|
// with a corresponding name to the mainClassName
|
||||||
var kissFileContent = "";
|
var kissFileContent = '(addMetadata #"@:expose("Fuck")"#)\n';
|
||||||
for (exp in exps) {
|
for (exp in exps) {
|
||||||
kissFileContent += Reader.toString(exp.def) + "\n";
|
kissFileContent += Reader.toString(exp.def) + "\n";
|
||||||
}
|
}
|
||||||
File.saveContent(Path.join([args.outputFolder, '$mainClassName.kiss']), kissFileContent);
|
File.saveContent(Path.join([args.outputFolder, 'ScriptMain.kiss']), kissFileContent);
|
||||||
|
|
||||||
// generate build.hxml
|
// generate build.hxml
|
||||||
var buildHxmlContent = "";
|
var buildHxmlContent = "";
|
||||||
|
|||||||
7
kiss/src/kiss/ExternMain.hx
Normal file
7
kiss/src/kiss/ExternMain.hx
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
package;
|
||||||
|
|
||||||
|
class ExternMain {
|
||||||
|
static function main() {
|
||||||
|
ScriptMain.main();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
package;
|
|
||||||
|
|
||||||
import kiss.Kiss;
|
|
||||||
import kiss.Prelude;
|
|
||||||
|
|
||||||
@:build(kiss.Kiss.build())
|
|
||||||
class ScriptMain {}
|
|
||||||
Reference in New Issue
Block a user