Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private function ndll(name:String):Void {
- var haxelib:Haxelib = null;
- if(name == "std" || name == "regexp" || name == "zlib") {
- haxelib = new Haxelib(config.getString("cpp.buildLibrary", "hxcpp"));
- }
- ndlls.push(new NDLL(name, haxelib));
- }
- private function dependencyByPath(path:String):Void {
- dependencies.push(new Dependency("", path));
- }
- private function dependency(name:String, path:String = ""):Void {
- if(name == null) {
- name = "";
- }
- if(path == null) {
- path = "";
- }
- if(target == Platform.IOS && path.length > 0
- && StringTools.endsWith(name, ".framework")) {
- trace("Warning: Setting both the name and the path of a dependency "
- + "leads to errors on some platforms. For your safety, and "
- + "the safety of others, the path will be omitted from the "
- + name + " dependency.");
- path = "";
- }
- dependencies.push(new Dependency(name, path));
- }
- private function templateFile(path:String, ?rename:String):Void {
- assets.push(new Asset(path, rename, AssetType.TEMPLATE));
- }
- private function templateDirectory(sourcePath:String, destPath:String = ""):Void {
- if(command == "build" || command == "test") {
- //Ensure that the source path ends with a "/", and that the
- //destination path does not.
- if(sourcePath.charCodeAt(sourcePath.length - 1) != "/".code
- && sourcePath.charCodeAt(sourcePath.length - 1) != "\\".code) {
- sourcePath += "/";
- }
- if(destPath.length > 0 &&
- (destPath.charCodeAt(destPath.length - 1) == "/".code
- || destPath.charCodeAt(destPath.length - 1) == "\\".code)) {
- destPath = destPath.substr(0, destPath.length - 1);
- }
- templateDirectoryHelper(sourcePath, destPath, "");
- }
- }
- private function templateDirectoryHelper(baseSourcePath:String, baseDestPath:String, pathAddition:String):Void {
- if(FileSystem.isDirectory(baseSourcePath + pathAddition)) {
- for(item in FileSystem.readDirectory(baseSourcePath + pathAddition)) {
- templateDirectoryHelper(baseSourcePath, baseDestPath,
- (pathAddition.length == 0 ? item
- : pathAddition + "/" + item));
- }
- } else {
- templateFile(baseSourcePath + pathAddition, baseDestPath + pathAddition);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement