1- import java.text.SimpleDateFormat
21
32buildscript {
43 repositories {
@@ -17,7 +16,7 @@ buildscript {
1716 password = project. findProperty(" gpr.key" ) ?: System . getenv(" GITHUB_TOKEN" )
1817 }
1918 }
20- maven { url " http ://repo.springsource.org/plugins-release" }
19+ maven { url " https ://repo.springsource.org/plugins-release" }
2120 jcenter()
2221 mavenCentral()
2322 }
@@ -196,35 +195,6 @@ task buildDockerPgsql(type: Docker) {
196195 }
197196}
198197
199- /**
200- * Runs all tests
201- * EthereumJ also runs common Ethereum clients tests
202- * See {@link #prepareGithubTests()} if you want to use local repo
203- * instead of downloading tests during test execution
204- */
205- test {
206-
207- beforeTest { descriptor ->
208- logger. lifecycle(" Running test: ${ descriptor} " )
209- }
210-
211- jvmArgs = [" -Xss8m" , " -Xmx3G" ]
212-
213- prepareGithubTests()
214- // If Github tests directory is provided, it's passed to test runner
215- if (System . getProperty(" GitHubTests.testPath" ) != null ) {
216- jvmArgs. add(' -DGitHubTests.testPath' + ' =' + System . getProperty(" GitHubTests.testPath" ))
217- }
218-
219- testLogging {
220- events " failed"
221- exceptionFormat " short"
222- }
223-
224- systemProperties System . properties
225- systemProperty " user.dir" , workingDir
226- systemProperty " file.encoding" , " UTF-8"
227- }
228198
229199ext {
230200 slf4jVersion = ' 1.7.7'
@@ -302,6 +272,7 @@ dependencies {
302272 compile group : ' org.apache.commons' , name : ' commons-dbcp2' , version : ' 2.6.0'
303273 compile group : ' org.hibernate.validator' , name : ' hibernate-validator' , version : ' 6.0.17.Final'
304274 compile group : ' org.apache.httpcomponents' , name : ' httpclient' , version : ' 4.5.8'
275+ compile " org.springframework.boot:spring-boot-starter-websocket:${ springbootVersion} "
305276
306277 compile group : ' io.netty' , name : ' netty-all' , version : ' 4.1.42.Final'
307278 compile " io.grpc:grpc-netty-shaded:${ gRPCVersion} "
@@ -339,19 +310,6 @@ dependencies {
339310 compile group : ' com.h2database' , name : ' h2' , version : ' 1.4.200'
340311}
341312
342-
343- javadoc {
344- options. author = true
345- options. header = project. name
346- options. addStringOption(' -quiet' )
347- options. encoding = " UTF-8"
348- options. links(
349- " http://docs.oracle.com/javase/8/docs/api/" ,
350- " http://netty.io/4.0/api/"
351- )
352- }
353-
354-
355313task copyDependencies (type : Copy ) {
356314 from configurations. runtime
357315 destinationDir = file(' build/libs/lib' )
@@ -364,151 +322,5 @@ jar {
364322 }
365323}
366324
367- // jar.dependsOn += copyDependencies
368-
369-
370- // create a single Jar with all dependencies
371- task fatJar (type : Jar ) {
372- classifier = ' all'
373- manifest {
374- attributes ' Main-Class' : mainClassName
375- attributes ' Class-Path' : configurations. compile. collect { ' lib/' + it. getName() }. join(' ' )
376- }
377- from { configurations. compile. collect { it. isDirectory() ? it : zipTree(it) } }
378- with jar
379- }
380-
381- task sourcesJar (type : Jar , dependsOn : classes) {
382- classifier = ' sources'
383- from sourceSets. main. allSource
384- }
385-
386- task javadocJar (type : Jar ) {
387- classifier = " javadoc"
388- from javadoc
389- }
390-
391-
392- artifacts {
393- archives sourcesJar
394- archives javadocJar
395- }
396-
397- // jacocoTestReport {
398- // reports {
399- // xml.enabled = true
400- // html.enabled = true
401- // }
402- // }
403-
404- def bintrayUsername = project. hasProperty(' bintrayUser' ) ? project. bintrayUser : ' '
405- def bintrayPassword = project. hasProperty(' bintrayKey' ) ? project. bintrayKey : ' '
406- def pullRequest = System . getenv(' TRAVIS_PULL_REQUEST' )
407- def branchName = System . getenv(' TRAVIS_BRANCH' )
408-
409- artifactory {
410- contextUrl = ' http://oss.jfrog.org/artifactory'
411- publish {
412- repository {
413- repoKey = ' oss-snapshot-local'
414- username = bintrayUsername
415- password = bintrayPassword
416- }
417- }
418- resolve {
419- repository {
420- repoKey = ' libs-release'
421- }
422- }
423-
424- }
425-
426- artifactoryPublish. onlyIf {
427- (branchName != null ) &&
428- (! pullRequest || pullRequest == ' false' ) &&
429- project. version. endsWith(' -SNAPSHOT' ) &&
430- (branchName. startsWith(' master' ) ||
431- branchName. startsWith(' develop' ) ||
432- branchName. startsWith(' stage' ))
433- }
434-
435- bintrayUpload. onlyIf {
436- // comment 'false' and uncomment the next line to publish next release
437- (! pullRequest || pullRequest == ' false' ) && ! project. version. endsWith(' -SNAPSHOT' )
438- // false
439- }
440-
441- tasks. processResources. doLast() {
442- println ' This will be printed after the build task even if something else calls the build task'
443-
444- File versionfile = file(new File (' build/resources/main/build-info.properties' ))
445- versionfile. text = ' build.hash=' + gitCommitHash() + ' \n ' + ' build.time=' + buildTime() + ' \n ' + ' build.branch=' + gitCurBranch() + ' \n '
446- }
447-
448- task publish {
449-
450- println " publishing if master || develop current branch: " + branchName
451- description = " Publishes snapshots to oss.jfrog.org and releases to Bintray/JCenter"
452- dependsOn artifactoryPublish, bintrayUpload
453- }
454-
455- def gitCommitHash () {
456- def process = " git rev-parse --short HEAD" . execute()
457- return process. text. trim()
458- }
459-
460- def buildTime () {
461- def df = new SimpleDateFormat (" [dd/MMM/yyyy]-[HH:mm]" )
462- df. setTimeZone(TimeZone . getTimeZone(" GMT" ));
463- return ' [GMT]-' + df. format(new Date ())
464- }
465-
466- def gitCurBranch () {
467- def branchName = System . getenv(' TRAVIS_BRANCH' )
468- if (branchName) return branchName
469- def process = " git rev-parse --abbrev-ref HEAD" . execute()
470- return process. text. trim()
471- }
472-
473-
474- import org.ajoberstar.grgit.Grgit
475- import com.typesafe.config.Config
476- import com.typesafe.config.ConfigFactory
477-
478- def prepareGithubTests () {
479- String testsPathKey = " GitHubTests.testPath"
480- String testsCommitKey = " GitHubTests.commit"
481- String testUserConf = " wisdom-core/src/test/resources/test-user.conf"
482- String githubTestsProp = " wisdom-core/src/test/resources/github-tests.prop"
483- def repoPath = System . getProperty(testsPathKey)
484- if (repoPath == null ) {
485- try {
486- Config userTest = ConfigFactory . parseFile(new File (testUserConf))
487- repoPath = userTest. getString(testsPathKey)
488- } catch (Exception ex) {
489- }
490- }
491- if (repoPath == null ) return
492- def commit = System . getProperty(testsCommitKey)
493- if (commit == null ) {
494- Properties testProp = new Properties ();
495- testProp. load(new File (githubTestsProp). newDataInputStream());
496- commit = testProp. getProperty(testsCommitKey)
497- }
498- if (repoPath != null && commit != null ) {
499- println " Tests: Checking out Ethereum Tests repo at " + repoPath + " to commit #" + commit
500- try {
501- def testsRepo = Grgit . open(dir : repoPath)
502- testsRepo. fetch()
503- testsRepo. checkout(branch : commit)
504- } catch (Exception ex) {
505- println " Error occurs while trying to checkout local Ethereum tests repo to specific commit"
506- println " Either remove " + testsPathKey + " property to use remote repo in tests or fix the issue"
507- println " Error: "
508- println ex
509- throw ex
510- }
511- }
512- }
513325
514326run. jvmArgs= [' -Xms16g' ]
0 commit comments