浏览代码

allow custom filter in UnitBuilder

Simon Krajewski 11 年之前
父节点
当前提交
866821eef5
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      tests/unit/UnitBuilder.hx

+ 2 - 2
tests/unit/UnitBuilder.hx

@@ -29,7 +29,7 @@ using StringTools;
 
 class UnitBuilder {
 	
-	static public macro function build(basePath:String):Array<Field> {
+	static public macro function build(basePath:String, filter:String = ".unit.hx"):Array<Field> {
 		var ret = Context.getBuildFields();
 		var numFiles = 0;
 			
@@ -38,7 +38,7 @@ class UnitBuilder {
 			path = path.endsWith("\\") || path.endsWith("/") ? path : path + "/";
 			for (file in dir) {
 				var filePath = path + file;
-				if (file.endsWith(".unit.hx")) {
+				if (file.endsWith(filter)) {
 					numFiles++;
 					var func = {
 						args: [],