SQOOP-3415: Fix gradle test+build when clean applied as the first command + warning...
authorSzabolcs Vasas <vasas@apache.org>
Mon, 3 Dec 2018 10:44:31 +0000 (11:44 +0100)
committerSzabolcs Vasas <vasas@apache.org>
Mon, 3 Dec 2018 10:44:31 +0000 (11:44 +0100)
(Attila Szabo via Szabolcs Vasas)

This closes #62

build.gradle

index f0beec9..47d4136 100644 (file)
@@ -84,6 +84,16 @@ configurations {
 
 compileJava.dependsOn(SqoopVersionFileGen)
 
+compileJava {
+    options.compilerArgs += '-proc:none'
+    options.compilerArgs += '-Xlint:all'
+}
+
+compileTestJava {
+    options.compilerArgs += '-proc:none'
+    options.compilerArgs += '-Xlint:all'
+}
+
 configurations.all {
     resolutionStrategy {
         force group: 'org.apache.avro', name: 'avro', version: avroVersion
@@ -320,16 +330,16 @@ task allTest (type: Test){
 def testBuildDir = "$buildDir/test/"
 def testBuildDirData ="$testBuildDir/data/"
 
-task buildFolder {
-    project.mkdir(testBuildDirData)
-}
-
 tasks.withType(Test) {
+    doFirst {
+        project.mkdir(testBuildDir)
+        project.mkdir(testBuildDirData)
+    }
+
     testLogging {
         events 'passed', 'skipped'
     }
     workingDir = testBuildDirData
-    project.mkdir(workingDir)
     systemProperties(System.getProperties())
     systemProperty "test.data.dir", "$projectDir/testdata"
     systemProperty 'test.build.data', "$testBuildDir/data"
@@ -346,8 +356,6 @@ tasks.withType(Test) {
     maxHeapSize = "8G"
     jvmArgs "-da:org.apache.hadoop.hive.thrift.HadoopThriftAuthBridge"
 
-    dependsOn buildFolder
-
     jacoco{
         excludes = ["**/SqoopVersion*"]
     }