Skip to content

Commit 20cd991

Browse files
committed
1. resolve leveldb could not create radom file On windows;2. log tar.gz -> gz
1 parent f9a5058 commit 20cd991

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

build.gradle

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ repositories {
4949
maven { url 'http://mvnrepository.com' }
5050
mavenLocal()
5151
mavenCentral()
52+
maven { url 'http://repo.spring.io/plugins-release' }
5253
}
5354
def versions = [
5455
checkstyle: '8.7',
@@ -68,6 +69,24 @@ configurations.getByName('checkstyleConfig') {
6869
transitive = false
6970
}
7071

72+
static def isWindows() {
73+
return org.gradle.internal.os.OperatingSystem.current().isWindows()
74+
}
75+
76+
if (isWindows()) {
77+
ext {
78+
leveldbGroup = "org.ethereum"
79+
leveldbName = "leveldbjni-all"
80+
leveldbVersion = "1.18.3"
81+
}
82+
} else {
83+
ext {
84+
leveldbGroup = "org.fusesource.leveldbjni"
85+
leveldbName = "leveldbjni-all"
86+
leveldbVersion = "1.8"
87+
}
88+
}
89+
7190
dependencies {
7291
//local libraries
7392
compile fileTree(dir: 'libs', include: '*.jar')
@@ -95,8 +114,7 @@ dependencies {
95114

96115
compile "org.iq80.leveldb:leveldb:0.7"
97116

98-
compile group: 'org.fusesource.leveldbjni', name: 'leveldbjni-all',
99-
version: '1.8'
117+
compile group: leveldbGroup, name: leveldbName, version: leveldbVersion
100118

101119
compile "org.apache.commons:commons-collections4:4.0"
102120

src/main/resources/logback.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<rollingPolicy
2121
class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
2222
<!-- rollover daily -->
23-
<fileNamePattern>./logs/tron-%d{yyyy-MM-dd}.%i.log.tar.gz</fileNamePattern>
23+
<fileNamePattern>./logs/tron-%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
2424
<!-- each file should be at most 500MB, keep 30 days worth of history, but at most 50GB -->
2525
<maxFileSize>500MB</maxFileSize>
2626
<maxHistory>720</maxHistory>

0 commit comments

Comments
 (0)