1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
|
project.ext.srcRoot = file('src/main/java')
testClasses << {
def resolvedArtifact = configurations.testCompile.resolvedConfiguration.resolvedArtifacts.find { it.name == 'svn-javahl-tests' }
copy {
from zipTree(resolvedArtifact.file)
into sourceSets.test.output.classesDir
}
}
classes << {
def resolvedArtifact = configurations.testCompile.resolvedConfiguration.resolvedArtifacts.find { it.name == 'svn-javahl-api' }
copy {
from zipTree(resolvedArtifact.file)
into sourceSets.main.output.classesDir
exclude 'META-INF/**'
eachFile { details ->
if (details.isDirectory()) {
return
} else if (details.name.endsWith('.class')) {
String javaFilePath = details.path
javaFilePath = javaFilePath.substring(0, javaFilePath.lastIndexOf('.'))
while (javaFilePath.indexOf('$') > 0) {
javaFilePath = javaFilePath.substring(0, javaFilePath.lastIndexOf('$'))
}
File candidate = new File(srcRoot, javaFilePath + '.java')
if (candidate.exists()) {
details.exclude()
}
}
}
}
}
test {
includes = ['**/tigris/subversion/javahl/BasicTests*', '**/tigris/subversion/javahl/SVNAdminTests*']
//does not pass on Windows: BasicTests.testBasicChangelist
systemProperty 'svnkit.wc.17', 'false'
ignoreFailures = true
workingDir = file('build/tests-working-dir')
}
task testJavaHL2(type: Test) {
includes = ['*/apache/subversion/javahl/BasicTests*']
//does not pass on Windows: BasicTests.testBasicChangelist
ignoreFailures = true
workingDir = file('build/tests-working-dir')
enableAssertions = true
}
test.doFirst() {
mkdir('build/tests-working-dir')
}
testJavaHL2.doFirst() {
mkdir('build/tests-working-dir')
}
configurations {
javahlSources
}
dependencies {
javahlSources group: 'org.tigris.subversion', name: 'svn-javahl-api', version: '1.6.18-v2', classifier: 'sources'
}
sourcesJar {
into('') {
from configurations.javahlSources.files.collect { zipTree(it) }
exclude 'META-INF/**'
eachFile { f ->
if (new File(srcRoot, f.path).exists()) {
f.exclude()
}
}
}
}
sourcesJar.dependsOn configurations.javahlSources
|