X-Git-Url: http://plrg.eecs.uci.edu/git/?p=jpf-core.git;a=blobdiff_plain;f=build.gradle;h=c8582eb28bdde00804d462cfb48babc8261ea42a;hp=555abff2ca320a99b272cda8ad11ca98a027cd59;hb=67d3fe6d9a919c2d495d13cf2fbdf8f1839da3b7;hpb=c5696ce03cc75f336df4da90e2624f8e0b87ef25 diff --git a/build.gradle b/build.gradle index 555abff..c8582eb 100644 --- a/build.gradle +++ b/build.gradle @@ -1,8 +1,14 @@ plugins { - id "com.gradle.build-scan" id "java" + id "eclipse" } +def getCurrentVersion() { + "DEVELOPMENT-SNAPSHOT" +} + +version = currentVersion + sourceCompatibility = 1.8 targetCompatibility = 1.8 @@ -10,15 +16,10 @@ ext.manifestCommonAttrbutes = manifest { attributes( "Built-By": System.getProperty("user.name"), "Implementation-Vendor": "NASA Ames Research Center", - "Implementation-Version": "1234" // FIXME + "Implementation-Version": version ) } -buildScan { - termsOfServiceUrl = 'https://gradle.com/terms-of-service' - termsOfServiceAgree = 'yes' -} - repositories { mavenCentral() } @@ -76,13 +77,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() @@ -131,7 +128,7 @@ task srcDist(type: Zip) { description = "Builds the source distribution." baseName = project.name - version = "git rev-parse --short HEAD".execute().text.trim() + version = project.version classifier = "src" extension = "zip" @@ -157,7 +154,7 @@ task dist(type: Zip) { description = "Builds binary distribution." baseName = project.name - version = "git rev-parse --short HEAD".execute().text.trim() + version = project.version extension = "zip" destinationDir = buildDir @@ -357,4 +354,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"