Skip to content

Commit 3f17eef

Browse files
authored
Merge pull request #114 from bilyana-gospodinova/add-generateBoth-flag
Add generateBoth flag
2 parents 4dfeca2 + dca494d commit 3f17eef

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
1212
### Features
1313

1414
* Updated web3j to latest version 4.12.0 [#111](https://github.com/hyperledger/web3j-cli/pull/111)
15+
* Add generateBoth flag [#114](https://github.com/hyperledger/web3j-cli/pull/114)
1516

1617
### BREAKING CHANGES
1718

build.gradle

+7-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ plugins {
1111
id "de.undercouch.download" version "4.1.2"
1212
id "de.marcphilipp.nexus-publish" version "0.4.0"
1313
id 'io.codearte.nexus-staging' version '0.30.0'
14-
id "com.jfrog.bintray" version "1.8.4"
14+
// TODO decide if kept or not
15+
// id "com.jfrog.bintray" version "1.8.4"
1516
}
1617

1718
description 'Web3j command line tools'
@@ -29,11 +30,13 @@ ext {
2930
wireMockVersion = '3.6.0'
3031
kotlinLoggin = '3.0.5'
3132
dockerJavaVersion = '3.3.6'
32-
web3jEpirusVersion = '0.0.7'
33+
web3jEpirusVersion = '0.0.6'
3334
log4jVersion = '2.23.1'
3435
semverVersion = '0.10.2'
3536
commonsLangVersion = '3.14.0'
3637
jansiVersion = '2.4.1'
38+
kotlinPoetVersion = '1.18.1'
39+
javaPoetVersion = '1.13.0'
3740
}
3841

3942

@@ -58,7 +61,6 @@ apply {
5861
}
5962

6063
repositories {
61-
jcenter()
6264
mavenCentral()
6365
mavenLocal()
6466
maven { url "https://dl.bintray.com/ethereum/maven/" }
@@ -91,6 +93,8 @@ dependencies {
9193
"org.web3j:hosted-providers:$web3jVersion",
9294
"io.epirus:epirus-web3j:$web3jEpirusVersion",
9395
"info.picocli:picocli:$picocli",
96+
"com.squareup:kotlinpoet:$kotlinPoetVersion",
97+
"com.squareup:javapoet:$javaPoetVersion",
9498
files('libs/smartcheck.jar'),
9599
"com.google.code.gson:gson:$gsonVersion",
96100
"org.apache.commons:commons-lang3:$commonsLangVersion",

src/main/java/org/web3j/console/wrapper/subcommand/SolidityGenerateCommand.java

+10-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import org.web3j.codegen.Console;
2222
import org.web3j.codegen.SolidityFunctionWrapperGenerator;
2323
import org.web3j.console.Web3jVersionProvider;
24+
import org.web3j.tx.Contract;
2425

2526
import static org.web3j.codegen.Console.exitError;
2627
import static picocli.CommandLine.Help.Visibility.ALWAYS;
@@ -94,6 +95,11 @@ public class SolidityGenerateCommand implements Runnable {
9495
description = "Use Java primitive types.")
9596
private boolean primitiveTypes = false;
9697

98+
@Option(
99+
names = {"-B", "--generateBoth"},
100+
description = "Generate both send_ and call_ functions.")
101+
private boolean generateBoth = false;
102+
97103
@Override
98104
public void run() {
99105
try {
@@ -111,7 +117,10 @@ public void run() {
111117
packageName,
112118
useJavaTypes,
113119
primitiveTypes,
114-
addressLength)
120+
generateBoth,
121+
Contract.class,
122+
addressLength,
123+
false)
115124
.generate();
116125
} catch (Exception e) {
117126
exitError(e);

0 commit comments

Comments
 (0)