Fix Gradle deprecation warnings

This commit is contained in:
Vedran Pavic
2017-01-12 21:54:53 +01:00
parent 3cc3784313
commit 41fbc90ec2
4 changed files with 66 additions and 54 deletions

View File

@@ -55,12 +55,14 @@ sonarqube {
} }
} }
task configDocsZip(dependsOn: [':docs:asciidoctor',':spring-session:javadoc']) << { task configDocsZip(dependsOn: [':docs:asciidoctor',':spring-session:javadoc']) {
project.tasks.docsZip.from(project(':docs').asciidoctor) { doLast {
into('reference') project.tasks.docsZip.from(project(':docs').asciidoctor) {
} into('reference')
project.tasks.docsZip.from(project(':spring-session').javadoc) { }
into('api') project.tasks.docsZip.from(project(':spring-session').javadoc) {
into('api')
}
} }
} }

View File

@@ -41,25 +41,27 @@ springBoot {
mainClass = 'sample.client.Application' mainClass = 'sample.client.Application'
} }
task runGemFireServer() << { task runGemFireServer() {
println 'STARTING GEMFIRE SERVER...' doLast {
println 'STARTING GEMFIRE SERVER...'
ext.port = reservePort() ext.port = reservePort()
String classpath = sourceSets.main.runtimeClasspath.collect { it }.join(File.pathSeparator) String classpath = sourceSets.main.runtimeClasspath.collect { it }.join(File.pathSeparator)
String[] commandLine = ['java', '-server', '-ea', '-classpath', classpath, String[] commandLine = ['java', '-server', '-ea', '-classpath', classpath,
"-Dgemfire.cache.server.port=$port", "-Dgemfire.cache.server.port=$port",
//"-Dgemfire.log-file=gemfire-server.log", //"-Dgemfire.log-file=gemfire-server.log",
"-Dgemfire.log-level=" + System.getProperty('gemfire.log.level', 'config'), "-Dgemfire.log-level=" + System.getProperty('gemfire.log.level', 'config'),
'sample.server.GemFireServer'] 'sample.server.GemFireServer']
//println commandLine //println commandLine
ext.process = commandLine.execute() ext.process = commandLine.execute()
process.in.close() process.in.close()
process.out.close() process.out.close()
process.err.close() process.err.close()
}
} }

View File

@@ -27,29 +27,33 @@ mainClassName = 'sample.Application'
def port def port
def process def process
task availablePort() << { task availablePort() {
def serverSocket = new ServerSocket(0) doLast {
port = serverSocket.localPort def serverSocket = new ServerSocket(0)
serverSocket.close() port = serverSocket.localPort
serverSocket.close()
}
} }
task runGemFireServer(dependsOn: availablePort) << { task runGemFireServer(dependsOn: availablePort) {
println 'STARTING GEMFIRE SERVER...' doLast {
println 'STARTING GEMFIRE SERVER...'
String classpath = sourceSets.main.runtimeClasspath.collect { it }.join(File.pathSeparator) String classpath = sourceSets.main.runtimeClasspath.collect { it }.join(File.pathSeparator)
String[] commandLine = ['java', '-server', '-ea', String[] commandLine = ['java', '-server', '-ea',
"-Dspring.session.data.gemfire.port=$port", "-Dspring.session.data.gemfire.port=$port",
"-Dsample.httpsession.gemfire.log-level=" "-Dsample.httpsession.gemfire.log-level="
+ System.getProperty('sample.httpsession.gemfire.log-level', 'warning'), + System.getProperty('sample.httpsession.gemfire.log-level', 'warning'),
'-classpath', classpath, 'sample.Application' ] '-classpath', classpath, 'sample.Application']
//println commandLine //println commandLine
process = commandLine.execute() process = commandLine.execute()
process.in.close() process.in.close()
process.out.close() process.out.close()
process.err.close() process.err.close()
}
} }
integrationTest.doLast { integrationTest.doLast {

View File

@@ -28,29 +28,33 @@ def process
mainClassName = "sample.ServerConfig" mainClassName = "sample.ServerConfig"
task availablePort() << { task availablePort() {
def serverSocket = new ServerSocket(0) doLast {
port = serverSocket.localPort def serverSocket = new ServerSocket(0)
serverSocket.close() port = serverSocket.localPort
serverSocket.close()
}
} }
task runGemFireServer(dependsOn: availablePort) << { task runGemFireServer(dependsOn: availablePort) {
println 'STARTING GEMFIRE SERVER...' doLast {
println 'STARTING GEMFIRE SERVER...'
String classpath = sourceSets.main.runtimeClasspath.collect { it }.join(File.pathSeparator) String classpath = sourceSets.main.runtimeClasspath.collect { it }.join(File.pathSeparator)
String[] commandLine = ['java', '-server', '-ea', String[] commandLine = ['java', '-server', '-ea',
"-Dspring.session.data.gemfire.port=$port", "-Dspring.session.data.gemfire.port=$port",
"-Dsample.httpsession.gemfire.log-level=" "-Dsample.httpsession.gemfire.log-level="
+ System.getProperty('sample.httpsession.gemfire.log-level', 'warning'), + System.getProperty('sample.httpsession.gemfire.log-level', 'warning'),
'-classpath', classpath, 'sample.ServerConfig'] '-classpath', classpath, 'sample.ServerConfig']
//println commandLine //println commandLine
process = commandLine.execute() process = commandLine.execute()
process.in.close() process.in.close()
process.out.close() process.out.close()
process.err.close() process.err.close()
}
} }
integrationTest.doLast { integrationTest.doLast {