Issue #95 - Updated ReporterResourcesTest
[jpf-core.git] / build.gradle
index fd4261d41517518d3bb61e6938ce434d7d201ea1..d105247dc45c3c9f873ae6c64755b118acf44523 100644 (file)
@@ -1,4 +1,9 @@
-apply plugin: "java"
+plugins {
+    id "com.gradle.build-scan" version "1.14"
+    id "java"
+    id "jacoco"
+    id "eclipse"
+}
 
 sourceCompatibility = 1.8
 targetCompatibility = 1.8
@@ -7,10 +12,22 @@ ext.manifestCommonAttrbutes = manifest {
     attributes(
         "Built-By": System.getProperty("user.name"),
         "Implementation-Vendor": "NASA Ames Research Center",
-        "Implementation-Version": "1234" // FIXME
+        "Implementation-Version": "8.0"
     )
 }
 
+buildScan {
+    termsOfServiceUrl = 'https://gradle.com/terms-of-service'
+    termsOfServiceAgree = 'yes'
+}
+
+jacocoTestReport {
+    reports {
+        xml.enabled = true
+        html.enabled = false
+    }
+}
+
 repositories {
     mavenCentral()
 }
@@ -68,13 +85,9 @@ task generateBuildInfo {
     description = "Generates the build.properties file."
     doLast {
 
-        // Must fail if there are uncommitted changes
-        def status  = "git status --short".execute().text.trim()
-        if (!status.isEmpty()) {
-            throw new GradleException("There are uncomitted changes:\n " + status)
-        }
         Properties info = new Properties()
 
+        def status  = "git status --short".execute().text.trim()
         def revision = "git rev-parse --short HEAD".execute().text.trim()
         def userName = ["git", "log", "-1", "--format=%an <%ae>"].execute().text.trim()
         def date = "git log -1 --format=%ci".execute().text.trim()
@@ -94,7 +107,7 @@ task generateBuildInfo {
 }
 
 task copyResources(type: Copy) {
-    group = "JPF Build"
+    group = "JPF Build Resources"
     description = "Copies .version and build.properties files to the build directory."
 
     dependsOn generateBuildInfo
@@ -119,8 +132,8 @@ task compile {
 }
 
 task srcDist(type: Zip) {
-    group = "JPF Build"
-    description = "Builds the source distribution"
+    group = "JPF Distribution"
+    description = "Builds the source distribution."
 
     baseName = project.name
     version = "git rev-parse --short HEAD".execute().text.trim()
@@ -136,8 +149,6 @@ task srcDist(type: Zip) {
     include "gradlew"
     include "gradlew.bat"
     include "gradle/**/*"
-    include "nbproject/**/*"
-    include "eclipse/**/*"
     include "src/**/*"
     include "bin/**/*"
     include "jpf.properties"
@@ -147,8 +158,8 @@ task srcDist(type: Zip) {
 }
 
 task dist(type: Zip) {
-    group = "JPF Build"
-    description = "Builds binary distribution"
+    group = "JPF Distribution"
+    description = "Builds binary distribution."
 
     baseName = project.name
     version = "git rev-parse --short HEAD".execute().text.trim()
@@ -320,7 +331,6 @@ task buildJars {
 }
 
 test {
-    group = "JPF Build"
     description = "Runs core regression tests."
 
     dependsOn buildJars
@@ -352,4 +362,22 @@ test {
     }
 }
 
+eclipse {
+    group = "JPF IDE Support"
+
+    project {
+        natures = ["org.eclipse.buildship.core.gradleprojectnature"]
+    }
+    classpath {
+        defaultOutputDir = buildDir
+        file {
+            whenMerged { classpath ->
+                classpath.entries.findAll{ entry -> entry.kind == "src" }*.every { srcNode ->
+                    srcNode.output = srcNode.output.replace("bin", "${buildDir.name}")
+                }
+            }
+        }
+    }
+}
+
 defaultTasks "buildJars"