11plugins {
2- id " org.gradle.test-retry" version " 1.5.9 "
2+ id " org.gradle.test-retry" version " 1.6.5 "
33 id " org.sonarqube" version " 2.6"
4- id " com.gorylenko.gradle-git-properties" version " 2.4 .1"
4+ id " com.gorylenko.gradle-git-properties" version " 4.0 .1"
55}
66
77gitProperties. failOnNoGitDirectory = false ;
8+ tasks. named(' generateGitProperties' ) {
9+ doNotTrackState(' The task snapshots .git, which may contain non-regular fsmonitor IPC files.' )
10+ }
811
912apply plugin : ' application'
1013apply plugin : ' checkstyle'
1114
12- mainClassName = ' org.tron.program.FullNode'
15+ application {
16+ mainClass = ' org.tron.program.FullNode'
17+ }
1318
1419def versions = [
1520 checkstyle : ' 8.7' ,
@@ -95,7 +100,7 @@ tasks.matching { it instanceof Test }.all {
95100}
96101
97102if (project. hasProperty(" mainClass" )) {
98- mainClassName = mainClass
103+ application . mainClass = mainClass
99104}
100105
101106run {
@@ -167,17 +172,17 @@ tasks.register('testWithRocksDb', Test) {
167172
168173jacocoTestReport {
169174 reports {
170- xml. enabled true
171- csv. enabled false
172- html. destination file(" ${ buildDir} /jacocoHtml" )
175+ xml. required . set( true )
176+ csv. required . set( false )
177+ html. outputLocation . set( file(" ${ buildDir} /jacocoHtml" ) )
173178 }
174179 getExecutionData(). setFrom(fileTree(' ../framework/build/jacoco' ). include(" **.exec" ))
175180}
176181
177182def binaryRelease (taskName , jarName , mainClass ) {
178183 return tasks. create(" ${ taskName} " , Jar ) {
179- baseName = jarName
180- version = null
184+ archiveBaseName . set( jarName)
185+ archiveVersion . set( " " )
181186 from(sourceSets. main. output) {
182187 include " /**"
183188 }
@@ -212,7 +217,7 @@ def createScript(project, mainClass, name) {
212217 unixStartScriptGenerator. template = resources. text. fromFile(' ../gradle/unixStartScript.txt' )
213218 windowsStartScriptGenerator. template = resources. text. fromFile(' ../gradle/windowsStartScript.txt' )
214219 outputDir = new File (project. buildDir, ' scripts' )
215- mainClassName = mainClass
220+ getMainClass() . set( mainClass)
216221 applicationName = name
217222 classpath = project. tasks[JavaPlugin . JAR_TASK_NAME ]. outputs. files + project. configurations. runtimeClasspath
218223// defaultJvmOpts = ['-XX:+UseConcMarkSweepGC',
@@ -225,23 +230,34 @@ def createScript(project, mainClass, name) {
225230// ]
226231 }
227232 project. tasks[name]. dependsOn(project. jar)
228- project. applicationDistribution . with {
233+ project. distributions . main . contents {
229234 into(" bin" ) {
230- from(project. tasks[name])
231- fileMode = 0755
235+ from(project. tasks[name]) {
236+ filePermissions {
237+ unix(" rwxr-xr-x" )
238+ }
239+ }
232240 }
233241 }
234242}
235- applicationDistribution. from(rootProject.archInfo.VMOptions ) {
236- into " bin"
243+ distributions {
244+ main {
245+ contents {
246+ from(rootProject.archInfo.VMOptions ) {
247+ into " bin"
248+ }
249+ }
250+ }
237251}
238252// distZip {
239253// doLast {
240254// file("$destinationDir/$archiveName").renameTo("$destinationDir/"+'java-tron-'+version+'-bin.zip')
241255// }
242256// }
243257configurations. archives. artifacts. removeAll { it. type == ' tar' }
244- applicationName = ' java-tron'
258+ application {
259+ applicationName = ' java-tron'
260+ }
245261startScripts. enabled = false
246262run. enabled = false
247263tasks. distTar. enabled = false
0 commit comments