Skip to content

Commit

Permalink
Merge pull request #114 from bilyana-gospodinova/add-generateBoth-flag
Browse files Browse the repository at this point in the history
Add generateBoth flag
  • Loading branch information
gtebrean authored Aug 16, 2024
2 parents 4dfeca2 + dca494d commit 3f17eef
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
### Features

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

### BREAKING CHANGES

Expand Down
10 changes: 7 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ plugins {
id "de.undercouch.download" version "4.1.2"
id "de.marcphilipp.nexus-publish" version "0.4.0"
id 'io.codearte.nexus-staging' version '0.30.0'
id "com.jfrog.bintray" version "1.8.4"
// TODO decide if kept or not
// id "com.jfrog.bintray" version "1.8.4"
}

description 'Web3j command line tools'
Expand All @@ -29,11 +30,13 @@ ext {
wireMockVersion = '3.6.0'
kotlinLoggin = '3.0.5'
dockerJavaVersion = '3.3.6'
web3jEpirusVersion = '0.0.7'
web3jEpirusVersion = '0.0.6'
log4jVersion = '2.23.1'
semverVersion = '0.10.2'
commonsLangVersion = '3.14.0'
jansiVersion = '2.4.1'
kotlinPoetVersion = '1.18.1'
javaPoetVersion = '1.13.0'
}


Expand All @@ -58,7 +61,6 @@ apply {
}

repositories {
jcenter()
mavenCentral()
mavenLocal()
maven { url "https://dl.bintray.com/ethereum/maven/" }
Expand Down Expand Up @@ -91,6 +93,8 @@ dependencies {
"org.web3j:hosted-providers:$web3jVersion",
"io.epirus:epirus-web3j:$web3jEpirusVersion",
"info.picocli:picocli:$picocli",
"com.squareup:kotlinpoet:$kotlinPoetVersion",
"com.squareup:javapoet:$javaPoetVersion",
files('libs/smartcheck.jar'),
"com.google.code.gson:gson:$gsonVersion",
"org.apache.commons:commons-lang3:$commonsLangVersion",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.web3j.codegen.Console;
import org.web3j.codegen.SolidityFunctionWrapperGenerator;
import org.web3j.console.Web3jVersionProvider;
import org.web3j.tx.Contract;

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

@Option(
names = {"-B", "--generateBoth"},
description = "Generate both send_ and call_ functions.")
private boolean generateBoth = false;

@Override
public void run() {
try {
Expand All @@ -111,7 +117,10 @@ public void run() {
packageName,
useJavaTypes,
primitiveTypes,
addressLength)
generateBoth,
Contract.class,
addressLength,
false)
.generate();
} catch (Exception e) {
exitError(e);
Expand Down

0 comments on commit 3f17eef

Please sign in to comment.