aboutsummaryrefslogtreecommitdiff
path: root/build.gradle
diff options
context:
space:
mode:
authorAndreas Fitzek <andreas.fitzek@iaik.tugraz.at>2014-02-05 09:20:54 +0100
committerAndreas Fitzek <andreas.fitzek@iaik.tugraz.at>2014-02-05 09:20:54 +0100
commit87c9269152f8c631123525b796cf07dc0cca7398 (patch)
tree041c36a99e746df8a802375a5f71b0f7081f6e51 /build.gradle
parent3f78cac3c1c5255b315a60c98cfb6853f1faa2fc (diff)
downloadpdf-as-4-87c9269152f8c631123525b796cf07dc0cca7398.tar.gz
pdf-as-4-87c9269152f8c631123525b796cf07dc0cca7398.tar.bz2
pdf-as-4-87c9269152f8c631123525b796cf07dc0cca7398.zip
Documentation + Documentation building
Diffstat (limited to 'build.gradle')
-rw-r--r--build.gradle34
1 files changed, 30 insertions, 4 deletions
diff --git a/build.gradle b/build.gradle
index e70b4abc..e8413256 100644
--- a/build.gradle
+++ b/build.gradle
@@ -2,15 +2,41 @@ subprojects {
apply plugin: 'java'
apply plugin: 'eclipse'
- repositories {
- mavenCentral()
- }
+ repositories { mavenCentral() }
dependencies { testCompile 'junit:junit:4.8.2' }
sourceCompatibility = 1.5
version = '4.0.0-SNAPSHOT'
+ pdfasversion = version
+ revision = getCheckedOutGitCommitHash()
+
+ jar { manifest.attributes provider: 'EGIZ', 'Specification-Version': getCheckedOutGitCommitHash(), 'Implementation-Version': version }
+}
+
+def getCheckedOutGitCommitHash() {
+ def gitFolder = "$projectDir/.git/"
+ def takeFromHash = 40
+ /*
+ * '.git/HEAD' contains either
+ * in case of detached head: the currently checked out commit hash
+ * otherwise: a reference to a file containing the current commit hash
+ */
+ def head = new File(gitFolder + "HEAD").text.split(":") // .git/HEAD
+ def isCommit = head.length == 1 // e5a7c79edabbf7dd39888442df081b1c9d8e88fd
+ // def isRef = head.length > 1 // ref: refs/heads/master
+
+ if(isCommit) return head[0].trim().take(takeFromHash) // e5a7c79edabb
+
+ def refHead = new File(gitFolder + head[1].trim()) // .git/refs/heads/master
+ refHead.text.trim().take takeFromHash
+}
- jar { manifest.attributes provider: 'EGIZ' }
+task docs(type: Javadoc) {
+ source subprojects.collect {project -> project.sourceSets.main.allJava }
+ classpath = files(subprojects.collect {project -> project.sourceSets.main.compileClasspath})
+ destinationDir = new File(projectDir, 'docs')
}
+
+