-apply plugin: "java"
+plugins {
+ id "java"
+ id "eclipse"
+}
+
+def getCurrentVersion() {
+ "DEVELOPMENT-SNAPSHOT"
+}
+
+version = currentVersion
sourceCompatibility = 1.8
targetCompatibility = 1.8
attributes(
"Built-By": System.getProperty("user.name"),
"Implementation-Vendor": "NASA Ames Research Center",
- "Implementation-Version": "1234" // FIXME
+ "Implementation-Version": version
)
}
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()
}
task copyResources(type: Copy) {
- group = "JPF Build"
+ group = "JPF Build Resources"
description = "Copies .version and build.properties files to the build directory."
dependsOn generateBuildInfo
}
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()
+ version = project.version
classifier = "src"
extension = "zip"
include "gradlew"
include "gradlew.bat"
include "gradle/**/*"
- include "nbproject/**/*"
- include "eclipse/**/*"
include "src/**/*"
include "bin/**/*"
include "jpf.properties"
}
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()
+ version = project.version
extension = "zip"
destinationDir = buildDir
}
test {
- group = "JPF Build"
description = "Runs core regression tests."
dependsOn buildJars
}
}
+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"