From 20cd9919f4954556afd01a0464b2d8cf89a5a45b Mon Sep 17 00:00:00 2001 From: Matt Yue Date: Mon, 20 Aug 2018 16:51:01 +0800 Subject: [PATCH] 1. resolve leveldb could not create radom file On windows;2. log tar.gz -> gz --- build.gradle | 22 ++++++++++++++++++++-- src/main/resources/logback.xml | 2 +- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index eb3dc017862..cf7546df0d8 100755 --- a/build.gradle +++ b/build.gradle @@ -49,6 +49,7 @@ repositories { maven { url 'http://mvnrepository.com' } mavenLocal() mavenCentral() + maven { url 'http://repo.spring.io/plugins-release' } } def versions = [ checkstyle: '8.7', @@ -68,6 +69,24 @@ configurations.getByName('checkstyleConfig') { transitive = false } +static def isWindows() { + return org.gradle.internal.os.OperatingSystem.current().isWindows() +} + +if (isWindows()) { + ext { + leveldbGroup = "org.ethereum" + leveldbName = "leveldbjni-all" + leveldbVersion = "1.18.3" + } +} else { + ext { + leveldbGroup = "org.fusesource.leveldbjni" + leveldbName = "leveldbjni-all" + leveldbVersion = "1.8" + } +} + dependencies { //local libraries compile fileTree(dir: 'libs', include: '*.jar') @@ -95,8 +114,7 @@ dependencies { compile "org.iq80.leveldb:leveldb:0.7" - compile group: 'org.fusesource.leveldbjni', name: 'leveldbjni-all', - version: '1.8' + compile group: leveldbGroup, name: leveldbName, version: leveldbVersion compile "org.apache.commons:commons-collections4:4.0" diff --git a/src/main/resources/logback.xml b/src/main/resources/logback.xml index 39fa5b16a4b..40574395921 100644 --- a/src/main/resources/logback.xml +++ b/src/main/resources/logback.xml @@ -20,7 +20,7 @@ - ./logs/tron-%d{yyyy-MM-dd}.%i.log.tar.gz + ./logs/tron-%d{yyyy-MM-dd}.%i.log.gz 500MB 720