public String encodeConfig(final ErlangProjectProperties info) {
return null;
}
public ErlangProjectProperties decodeConfig(final String config) {
ErlangProjectProperties _xblockexpression = null;
{
final ErlangProjectProperties result = new ErlangProjectProperties();
Path _path = new Path("ebin");
result.setOutputDir(_path);
IErlangEngine _instance = ErlangEngine.getInstance();
SimpleParserService _simpleParserService = _instance.getSimpleParserService();
final List<OtpErlangObject> content = _simpleParserService.parse(config);
boolean _isEmpty = content.isEmpty();
if (_isEmpty) {
result.copyFrom(ErlangProjectProperties.DEFAULT);
return result;
}
final Procedure1<OtpErlangObject> _function = new Procedure1<OtpErlangObject>() {
public void apply(final OtpErlangObject erl_opts) {
try {
final Bindings bindings = OtpErlang.match("{erl_opts,Opts}", erl_opts);
boolean _tripleNotEquals = (bindings != null);
if (_tripleNotEquals) {
final Collection<OtpErlangObject> opts = bindings.getList("Opts");
boolean _tripleNotEquals_1 = (opts != null);
if (_tripleNotEquals_1) {
final Procedure1<OtpErlangObject> _function = new Procedure1<OtpErlangObject>() {
public void apply(final OtpErlangObject opt) {
try {
final Bindings b = OtpErlang.match("{Tag,Arg}", opt);
boolean _tripleNotEquals = (b != null);
if (_tripleNotEquals) {
RebarConfigurationSerializer.this.parseOption(result, b);
}
} catch (Throwable _e) {
throw Exceptions.sneakyThrow(_e);
}
}
};
IterableExtensions.<OtpErlangObject>forEach(opts, _function);
}
}
} catch (Throwable _e) {
throw Exceptions.sneakyThrow(_e);
}
}
};
IterableExtensions.<OtpErlangObject>forEach(content, _function);
boolean _and = false;
Collection<IPath> _sourceDirs = result.getSourceDirs();
boolean _isEmpty_1 = _sourceDirs.isEmpty();
if (!_isEmpty_1) {
_and = false;
} else {
Collection<IPath> _includeDirs = result.getIncludeDirs();
boolean _isEmpty_2 = _includeDirs.isEmpty();
_and = _isEmpty_2;
}
if (_and) {
result.copyFrom(ErlangProjectProperties.DEFAULT);
}
_xblockexpression = result;
}
return _xblockexpression;
}