diff --git a/build.gradle b/build.gradle index 166a51994..b5fbcae26 100644 --- a/build.gradle +++ b/build.gradle @@ -10,12 +10,12 @@ sourceCompatibility = 1.8 targetCompatibility = JavaVersion.VERSION_1_8 [compileJava, compileTestJava]*.options*.encoding = 'UTF-8' -compileJava.options*.compilerArgs = [ - "-Xlint:serial", "-Xlint:varargs", "-Xlint:classfile", "-Xlint:dep-ann", - "-Xlint:divzero", "-Xlint:empty", "-Xlint:finally", "-Xlint:overrides", - "-Xlint:path", "-Xlint:static", "-Xlint:try", "-Xlint:fallthrough", - "-Xlint:deprecation", "-Xlint:unchecked", "-Xlint:-options" -] +//compileJava.options*.compilerArgs = [ +// "-Xlint:serial", "-Xlint:varargs", "-Xlint:classfile", "-Xlint:dep-ann", +// "-Xlint:divzero", "-Xlint:empty", "-Xlint:finally", "-Xlint:overrides", +// "-Xlint:path", "-Xlint:static", "-Xlint:try", "-Xlint:fallthrough", +// "-Xlint:deprecation", "-Xlint:unchecked", "-Xlint:-options" +//] repositories { mavenLocal() @@ -23,6 +23,9 @@ repositories { maven { url 'https://jitpack.io' } } +def protobufVersion = "3.21.12" +def grpcVersion = "1.60.0" + sourceSets { main { proto { @@ -33,8 +36,8 @@ sourceSets { srcDir 'src/main/java' } } - } + buildscript { repositories { mavenLocal() @@ -43,59 +46,57 @@ buildscript { } mavenCentral() } - ext { - projectVersion = '1.3.0-RELEASE' - grpcVersion = '1.60.0' - protobufVersion = '3.21.12' - protobufGradlePluginVersion = '0.8.0' - } dependencies { - classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.2' - classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.3' - classpath "gradle.plugin.com.liferay:gradle-plugins-node:4.3.0" + classpath 'com.github.jengelman.gradle.plugins:shadow:5.2.0' + classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.12' + classpath "gradle.plugin.com.liferay:gradle-plugins-node:7.0.2" } } -task wrapper(type: Wrapper) { - gradleVersion = '3.3' -} dependencies { - compile group: 'junit', name: 'junit', version: '4.13.2' - compile group: 'com.beust', name: 'jcommander', version: '1.82' + implementation group: 'junit', name: 'junit', version: '4.13.2' + implementation group: 'com.beust', name: 'jcommander', version: '1.82' //compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25' - compile group: 'org.slf4j', name: 'jcl-over-slf4j', version: '1.7.25' - compile group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.13' - - // google grpc - compile group: 'io.grpc', name: 'grpc-netty', version: "${grpcVersion}" - compile group: 'io.grpc', name: 'grpc-protobuf', version: "${grpcVersion}" - compile group: 'io.grpc', name: 'grpc-stub', version: "${grpcVersion}" - - compile group: 'com.googlecode.protobuf-java-format', name: 'protobuf-java-format', version: '1.4' - compile group: 'org.bouncycastle', name: 'bcprov-jdk18on', version: '1.78.1' - compile group: 'com.typesafe', name: 'config', version: '1.3.2' - compile "org.apache.commons:commons-lang3:3.14.0" - compile group: 'com.google.api.grpc', name: 'googleapis-common-protos', version: '0.0.3' - compile 'com.alibaba:fastjson:1.2.83' - - compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.16.1' - compile group: 'org.projectlombok', name: 'lombok', version: '1.18.2' - - compile group: 'org.jline', name: 'jline', version: '3.25.0' - compile 'io.github.tronprotocol:zksnark-java-sdk:1.0.0' + implementation group: 'org.slf4j', name: 'jcl-over-slf4j', version: '1.7.25' + implementation group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.13' + + // grpc + implementation group: 'io.grpc', name: 'grpc-netty', version: grpcVersion + implementation group: 'io.grpc', name: 'grpc-protobuf', version: grpcVersion + implementation group: 'io.grpc', name: 'grpc-stub', version: grpcVersion + + // google protobuf + implementation group: 'com.google.protobuf', name: 'protobuf-java', version: protobufVersion + implementation group: 'com.google.protobuf', name: 'protobuf-java-util', version: protobufVersion + + implementation group: 'com.google.code.gson', name: 'gson', version: '2.11.0' + + implementation group: 'com.googlecode.protobuf-java-format', name: 'protobuf-java-format', version: '1.4' + implementation group: 'org.bouncycastle', name: 'bcprov-jdk18on', version: '1.78.1' + implementation group: 'com.typesafe', name: 'config', version: '1.3.2' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.14.0' + implementation group: 'com.alibaba', name: 'fastjson', version: '1.2.83' + implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.16.1' + + compileOnly 'org.projectlombok:lombok:1.18.24' + annotationProcessor 'org.projectlombok:lombok:1.18.24' + testCompileOnly 'org.projectlombok:lombok:1.18.24' + testAnnotationProcessor 'org.projectlombok:lombok:1.18.24' + + implementation group: 'org.jline', name: 'jline', version: '3.25.0' + implementation group: 'io.github.tronprotocol', name: 'zksnark-java-sdk', version: '1.0.0' } protobuf { - generatedFilesBaseDir = "$projectDir/src/" + generatedFilesBaseDir = "$projectDir/src" protoc { - artifact = "com.google.protobuf:protoc:${protobufVersion}" - + artifact = "com.google.protobuf:protoc:$protobufVersion" } plugins { grpc { - artifact = "io.grpc:protoc-gen-grpc-java:${grpcVersion}" + artifact = "io.grpc:protoc-gen-grpc-java:$grpcVersion" } } generateProtoTasks { @@ -114,6 +115,10 @@ protobuf { } } +clean.doFirst { + delete "src/main/gen" +} + run { standardInput = System.in mainClassName = 'org.tron.walletcli.Client' diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 5df222377..490fda857 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index a0ac4c699..a4b442974 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,5 @@ -#Tue Mar 06 21:13:26 CST 2018 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-all.zip diff --git a/gradlew b/gradlew index cccdd3d51..2fe81a7d9 100755 --- a/gradlew +++ b/gradlew @@ -1,5 +1,21 @@ #!/usr/bin/env sh +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + ############################################################################## ## ## Gradle start up script for UN*X @@ -28,7 +44,7 @@ APP_NAME="Gradle" APP_BASE_NAME=`basename "$0"` # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD="maximum" @@ -109,8 +125,8 @@ if $darwin; then GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" fi -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then APP_HOME=`cygpath --path --mixed "$APP_HOME"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` JAVACMD=`cygpath --unix "$JAVACMD"` @@ -138,19 +154,19 @@ if $cygwin ; then else eval `echo args$i`="\"$arg\"" fi - i=$((i+1)) + i=`expr $i + 1` done case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; esac fi @@ -159,14 +175,9 @@ save () { for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done echo " " } -APP_ARGS=$(save "$@") +APP_ARGS=`save "$@"` # Collect all arguments for the java command, following the shell quoting and substitution rules eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" -# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong -if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then - cd "$(dirname "$0")" -fi - exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat index e95643d6a..9109989e3 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -1,3 +1,19 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + @if "%DEBUG%" == "" @echo off @rem ########################################################################## @rem @@ -13,8 +29,11 @@ if "%DIRNAME%" == "" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome