1 module reggae.types; 2 3 import reggae.rules.common: exeExt; 4 import std.path: baseName, stripExtension, defaultExtension; 5 6 //Wrapper structs to ensure type-safety and readability 7 8 struct App { 9 string srcFileName; 10 string exeFileName; 11 12 this(string srcFileName) @safe pure nothrow { 13 immutable stripped = srcFileName.baseName.stripExtension; 14 immutable exeFileName = exeExt == "" ? stripped : stripped.defaultExtension(exeExt); 15 16 this(srcFileName, exeFileName); 17 } 18 19 this(string srcFileName, string exeFileName) @safe pure nothrow { 20 this.srcFileName = srcFileName; 21 this.exeFileName = exeFileName; 22 } 23 } 24 25 26 struct Flags { 27 string value; 28 } 29 30 struct ImportPaths { 31 string[] value; 32 } 33 34 struct StringImportPaths { 35 string[] value; 36 } 37 38 struct SrcDirs { 39 string[] value; 40 } 41 42 struct SrcFiles { 43 string[] value; 44 } 45 46 struct ExcludeFiles { 47 string[] value; 48 } 49 50 struct ExeName { 51 string value; 52 } 53 54 struct Configuration { 55 string value = "default"; 56 } 57 58 enum Backend { 59 none, 60 make, 61 ninja, 62 binary, 63 }