@@ -127,7 +127,7 @@ $(project.GENERATED_WARNING_HEADER:)
127
127
*/
128
128
129
129
buildscript {
130
- configurations.all {
130
+ configurations.configureEach {
131
131
resolutionStrategy {
132
132
force 'org.codehaus.groovy.modules.http-builder:http-builder:0.7.1'
133
133
}
@@ -207,7 +207,7 @@ dependencies {
207
207
// ------------------------------------------------------------------
208
208
// Build section
209
209
210
- task generateJniHeaders( type: Exec, dependsOn: 'classes') {
210
+ tasks.register('generateJniHeaders', type: Exec, dependsOn: 'classes') {
211
211
def classpath = sourceSets.main.output.classesDirs
212
212
def appclasspath = configurations.runtimeClasspath.files*.getAbsolutePath().join(File.pathSeparator)
213
213
def nativeIncludes = 'src/native/include'
@@ -222,14 +222,14 @@ task generateJniHeaders(type: Exec, dependsOn: 'classes') {
222
222
commandLine("javac", "-h", "$nativeIncludes", "-classpath", "$classpath${File.pathSeparator}$appclasspath", *jniClasses, *utilityClasses)
223
223
}
224
224
225
- tasks.withType(Test) {
225
+ tasks.withType(Test).configureEach {
226
226
def defaultJavaLibraryPath = System.getProperty("java.library.path")
227
227
if (osdetector.os == 'windows') {
228
- def extraJavaLibraryPath = hasNotEmptyProperty('buildPrefix') ? "$project.buildPrefix\\\\bin;$project.buildPrefix\\\\lib" : ''
229
- extraJavaLibraryPath = extraJavaLibraryPath.replace("/", "\\\\")
230
- systemProperty "java.library.path", "${projectDir}\\\\build\\\\Release${File.pathSeparator}" +
231
- "${extraJavaLibraryPath}${File.pathSeparator}" +
232
- "${defaultJavaLibraryPath}"
228
+ def extraJavaLibraryPath = hasNotEmptyProperty('buildPrefix') ? "$project.buildPrefix\\\\bin;$project.buildPrefix\\\\lib" : ''
229
+ extraJavaLibraryPath = extraJavaLibraryPath.replace("/", "\\\\")
230
+ systemProperty "java.library.path", "${projectDir}\\\\build\\\\Release${File.pathSeparator}" +
231
+ "${extraJavaLibraryPath}${File.pathSeparator}" +
232
+ "${defaultJavaLibraryPath}"
233
233
} else {
234
234
def extraJavaLibraryPath = hasNotEmptyProperty('buildPrefix') ? "$project.buildPrefix/lib" : ''
235
235
systemProperty "java.library.path", "${projectDir}/build${File.pathSeparator}" +
@@ -240,22 +240,22 @@ tasks.withType(Test) {
240
240
}
241
241
}
242
242
243
- task initCMake( type: Exec, dependsOn: 'generateJniHeaders') {
244
- workingDir 'build'
243
+ tasks.register('initCMake', type: Exec, dependsOn: 'generateJniHeaders') {
244
+ workingDir 'build'
245
245
def prefixPath = hasNotEmptyProperty('buildPrefix') ? "-DCMAKE_PREFIX_PATH=$project.buildPrefix" : ''
246
246
commandLine 'cmake', "$prefixPath", '..'
247
247
}
248
248
249
- task buildNative( type: Exec, dependsOn: 'initCMake') {
249
+ tasks.register('buildNative', type: Exec, dependsOn: 'initCMake') {
250
250
if (osdetector.os == 'windows') {
251
251
commandLine 'cmake',
252
- '--build', 'build',
252
+ '--build', 'build',
253
253
'--config', 'Release',
254
254
'--target', '$(project.linkname)jni',
255
- '--', '-verbosity:Minimal', '-maxcpucount'
255
+ '--', '-verbosity:Minimal', '-maxcpucount'
256
256
} else {
257
257
commandLine 'cmake',
258
- '--build', 'build'
258
+ '--build', 'build'
259
259
}
260
260
}
261
261
@@ -265,12 +265,12 @@ test.dependsOn buildNative
265
265
// ------------------------------------------------------------------
266
266
// Install and Publish section
267
267
268
- task sourcesJar( type: Jar, dependsOn: 'classes') {
268
+ tasks.register('sourcesJar', type: Jar, dependsOn: 'classes') {
269
269
archiveClassifier = 'sources'
270
270
from sourceSets.main.allSource
271
271
}
272
272
273
- task javadocJar( type: Jar, dependsOn: 'javadoc') {
273
+ tasks.register('javadocJar', type: Jar, dependsOn: 'javadoc') {
274
274
archiveClassifier = 'javadoc'
275
275
from javadoc.destinationDir
276
276
}
@@ -307,7 +307,6 @@ artifactoryPublish {
307
307
publications ('mavenJava')
308
308
}
309
309
310
-
311
310
bintray {
312
311
user = System.getenv('BINTRAY_USER')
313
312
key = System.getenv('BINTRAY_KEY')
@@ -397,7 +396,6 @@ artifactoryPublish {
397
396
publications ('mavenJava')
398
397
}
399
398
400
-
401
399
bintray {
402
400
user = System.getenv('BINTRAY_USER')
403
401
key = System.getenv('BINTRAY_KEY')
@@ -439,7 +437,7 @@ dependencies {
439
437
// ------------------------------------------------------------------
440
438
// Build section
441
439
442
- task copyLibs( type: Copy) {
440
+ tasks.register('copyLibs', type: Copy) {
443
441
def libraryPaths = []
444
442
if (project.hasProperty('buildPrefix')) {
445
443
if (osdetector.os == 'windows') {
@@ -450,7 +448,7 @@ task copyLibs(type: Copy) {
450
448
}
451
449
452
450
def javaLibraryPaths = System.getProperty('java.library.path').split(File.pathSeparator).toList()
453
- libraryPaths.addAll (javaLibraryPaths)
451
+ libraryPaths.addAll(javaLibraryPaths)
454
452
455
453
libraryPaths.add('/usr/local/lib')
456
454
if (osdetector.os == 'windows') {
0 commit comments