-
Notifications
You must be signed in to change notification settings - Fork 15
Configuration
Heromyth edited this page Jun 5, 2018
·
2 revisions
app.name = Hunt
app.version = 1.0
app.description = Shanghai Putao Ltd.
[dev]
app.buildMode = dev
[release]
app.buildMode = release
@Configuration("app")
class TestConfig
{
string name = "Kiss";
string buildMode = "dev";
@Value("version")
string ver = "1.0";
@property void description(string d) { _desc = d; }
@property string description() { return _desc; }
private string _desc = "Putao Ltd.";
}
ConfigBuilder builder = new ConfigBuilder("test.config", "release");
TestConfig config = builder.build!(TestConfig)();
assert(config.name == "Hunt", config.name);
assert(config.ver == "1.0", config.ver);
assert(config.buildMode == "release", config.buildMode);
assert(config.description == "Shanghai Putao Ltd.", config.description);