You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was wondering if the 'include' directiveshould be supported for properties files? I currently does not seem to work, but I can understand if this is intentional.
For example, if I have a file 'test.properties' with the following definition:
include file("test2.conf")
test.hello = "world"test.open = "sesame"
No worries if there are no plans to support this, I was hoping to use HOCON as a drop in replacement to give us some more flexibility/extensibility to our test framework configuration. We currently use property files and would be nice for us to have the capability to allow some to use HOCON configs, while allowing others to continue using things the way they were.
The text was updated successfully, but these errors were encountered:
It can't be supported because that is a valid properties file (as you can see, Java's properties parser interprets it as something). So if we allowed includes in properties files we'd be incompatible with them somehow, for example maybe you couldn't have a property named "include".
A more mundane issue is that we just use Java's properties parser and don't implement our own so there's no way to customize it really.
FWIW, in many cases renaming .properties files to .conf works or almost works, sometimes you have to add a few quotation marks for special characters.
Another option would be to pre-process .properties files yourself (potentially using a custom url protocol or ConfigIncluder as mentioned in another context here #122 (comment) ). You could do something as simple as regex out include statements and replace them with the included file.
Hi @havocp, thanks for the quick response. I agree with the rationale with regards to compatibility. I'll look into some of your suggestions as I think any of those will work for us!
I was wondering if the 'include' directiveshould be supported for properties files? I currently does not seem to work, but I can understand if this is intentional.
For example, if I have a file 'test.properties' with the following definition:
And I specify it as my config like:
Should I expect test2.conf to be included in my Config object?
Currently what I observe is that 'include' gets defined as a property key:
No worries if there are no plans to support this, I was hoping to use HOCON as a drop in replacement to give us some more flexibility/extensibility to our test framework configuration. We currently use property files and would be nice for us to have the capability to allow some to use HOCON configs, while allowing others to continue using things the way they were.
The text was updated successfully, but these errors were encountered: