diff --git a/build.gradle b/build.gradle index 0f1ef22d..84a16467 100644 --- a/build.gradle +++ b/build.gradle @@ -6,6 +6,7 @@ plugins { id "org.sonarqube" version "3.1.1" apply false id 'com.github.ben-manes.versions' version '0.38.0' id "nebula.optional-base" version "5.0.3" apply false + id 'org.ajoberstar.grgit' version "$grgitVersion" id "io.github.gradle-nexus.publish-plugin" version "1.0.0" id "com.github.breadmoirai.github-release" version "2.2.12" } @@ -57,6 +58,10 @@ allprojects { toolVersion = jacocoVersion } + tasks.withType(AbstractArchiveTask) { + preserveFileTimestamps = false + reproducibleFileOrder = true + } } /** @@ -91,6 +96,10 @@ subprojects { events "passed", "skipped", "failed" exceptionFormat "full" } + + jacoco { + excludes = ["**/*OrientSqlTokenManager*"] + } } dependencies { diff --git a/gradle.properties b/gradle.properties index da534c9a..302ab6bc 100644 --- a/gradle.properties +++ b/gradle.properties @@ -37,7 +37,7 @@ mockitoVersion = 3.8.0 # build dependencies jacocoVersion = 0.8.6 -grgitVersion = 1.6.0 +grgitVersion = 4.1.0 org.gradle.caching=true org.gradle.parallel=true diff --git a/gradle/application.gradle b/gradle/application.gradle index ed28737e..522ecd86 100644 --- a/gradle/application.gradle +++ b/gradle/application.gradle @@ -1,22 +1,8 @@ -import org.ajoberstar.grgit.Grgit - -import java.text.SimpleDateFormat - -buildscript { - repositories { - jcenter() - } - dependencies { - classpath "org.ajoberstar:grgit:$grgitVersion" - } -} - apply plugin: 'application' mainClassName = "org.jbake.launcher.Main" applicationName = "jbake" - def examplesBase = "$project.buildDir/examples" def exampleRepositories = [ @@ -27,16 +13,6 @@ def exampleRepositories = [ "example_project_jade" : "git://github.com/jbake-org/jbake-example-project-jade.git" ] -processResources { - from("src/main/resources"){ - include 'default.properties' - expand jbakeVersion: project.version, - timestamp: new SimpleDateFormat("yyyy-MM-dd HH:mm:ssa").format( new Date() ) - } -} - - - //create clone and Zip Task for each repository exampleRepositories.each { name, repository -> @@ -49,7 +25,7 @@ exampleRepositories.each { name, repository -> outputs.dir repositoryName doLast { - Grgit.clone(dir: repositoryName, uri: repository) + grgit.clone(dir: repositoryName, uri: repository) } } diff --git a/gradle/maven-publishing.gradle b/gradle/maven-publishing.gradle index a1a518be..e82810c8 100644 --- a/gradle/maven-publishing.gradle +++ b/gradle/maven-publishing.gradle @@ -1,11 +1,11 @@ -import java.text.SimpleDateFormat +import java.time.format.DateTimeFormatter apply plugin: 'maven-publish' -Date buildTimeAndDate = new Date() +def buildTimeAndDate = grgit.head().dateTime ext { - buildDate = new SimpleDateFormat('yyyy-MM-dd').format(buildTimeAndDate) - buildTime = new SimpleDateFormat('HH:mm:ss.SSSZ').format(buildTimeAndDate) + buildDate = buildTimeAndDate.format(DateTimeFormatter.ofPattern('yyyy-MM-dd')) + buildTime = buildTimeAndDate.format(DateTimeFormatter.ofPattern('HH:mm:ss.SSSZ')) isReleaseVersion = !version.endsWith("SNAPSHOT") } diff --git a/jbake-core/build.gradle b/jbake-core/build.gradle index d7f886ee..740541c5 100644 --- a/jbake-core/build.gradle +++ b/jbake-core/build.gradle @@ -1,4 +1,5 @@ import java.text.SimpleDateFormat +import java.time.format.DateTimeFormatter apply from: "$rootDir/gradle/sonarqube.gradle" apply plugin: 'java-library' @@ -36,7 +37,6 @@ processResources { from("src/main/resources") { include 'default.properties' expand jbakeVersion: project.version, - timestamp: new SimpleDateFormat("yyyy-MM-dd HH:mm:ssa").format(new Date()) + timestamp: grgit.head().dateTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss'['VV']'")) } } - diff --git a/jbake-dist/build.gradle b/jbake-dist/build.gradle index c9f29e79..a29c4127 100644 --- a/jbake-dist/build.gradle +++ b/jbake-dist/build.gradle @@ -50,3 +50,5 @@ smokeTest { } check.dependsOn smokeTest + +jar.enabled=false