Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit 5913b62

Browse files
authored
Merge pull request #1110 from tbocek/develop
Set NameOnlyOptions as user-based parameters and add GAS option
2 parents 121dfba + 3fc5422 commit 5913b62

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

ethereumj-core/src/main/java/org/ethereum/solidity/compiler/SolidityCompiler.java

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,34 @@ private enum OutputOption implements Option {
151151
}
152152
}
153153

154+
public static class CustomOption implements Option {
155+
private String name;
156+
private String value;
157+
158+
public CustomOption(String name) {
159+
if (name.startsWith("--")) {
160+
this.name = name.substring(2);
161+
} else {
162+
this.name = name;
163+
}
164+
}
165+
166+
public CustomOption(String name, String value) {
167+
this(name);
168+
this.value = value;
169+
}
170+
171+
@Override
172+
public String getValue() {
173+
return value;
174+
}
175+
176+
@Override
177+
public String getName() {
178+
return name;
179+
}
180+
}
181+
154182
public static class Result {
155183
public String errors;
156184
public String output;
@@ -260,6 +288,14 @@ private List<String> prepareCommandOptions(boolean optimize, boolean combinedJso
260288
commandParts.add("--" + option.getName());
261289
commandParts.add(option.getValue());
262290
}
291+
292+
for (Option option : getElementsOf(CustomOption.class, options)) {
293+
commandParts.add("--" + option.getName());
294+
if (option.getValue() != null) {
295+
commandParts.add(option.getValue());
296+
}
297+
}
298+
263299
return commandParts;
264300
}
265301

0 commit comments

Comments
 (0)