Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Set up Java
uses: actions/setup-java@v5
with:
java-version: 11
java-version: 21
distribution: 'temurin'

- name: Setup Gradle
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/early-access.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Set up Java
uses: actions/setup-java@v5
with:
java-version: 11
java-version: 21
distribution: 'temurin'

- name: Setup Gradle
Expand Down
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ script:
jobs:
include:

- jdk: openjdk21

- jdk: openjdk17

- jdk: openjdk11
Expand Down
7 changes: 0 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
import java.time.format.DateTimeFormatter

plugins {
id "io.github.gradle-nexus.publish-plugin" version "$nexusPublishPluginVersion"
id 'com.github.ben-manes.versions' version "$versionsPluginVersion"
id 'org.ajoberstar.grgit' version "$grgitVersion"
id 'org.jreleaser' version "$jreleaserVersion" apply false
id "eclipse"
id "idea"
}

def buildTimeAndDate = grgit.head().dateTime

// common variables
ext {
isTravis = (System.getenv("TRAVIS") == "true")
Expand All @@ -23,8 +18,6 @@ ext {
sonarDefaultProjectKey = "org.jbake:jbake-base:jbake-core"
sonarURL = System.getenv("SONARHOST") ?: sonarDefaultURL
sonarProjectKey = System.getenv("SONARPROJECTKEY") ?: sonarDefaultProjectKey
buildDate = buildTimeAndDate.format(DateTimeFormatter.ofPattern('yyyy-MM-dd'))
buildTime = buildTimeAndDate.format(DateTimeFormatter.ofPattern('HH:mm:ss.SSSZ'))
isReleaseVersion = !version.endsWith("SNAPSHOT")
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import java.time.ZonedDateTime
import java.time.format.DateTimeFormatter

plugins {
id 'java'
id 'jacoco'
Expand All @@ -15,26 +18,22 @@ dependencies {
implementation "ch.qos.logback:logback-classic:$logbackVersion"
implementation "ch.qos.logback:logback-core:$logbackVersion"

testImplementation "org.junit-pioneer:junit-pioneer:$junitPioneer"
testImplementation "org.junit.jupiter:junit-jupiter-api:$junit5Version"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit5Version"
// compatibility for Junit 4 test
testCompileOnly "junit:junit:$junit4Version"
testRuntimeOnly "org.junit.vintage:junit-vintage-engine:$junit5Version"
testImplementation(platform("org.junit:junit-bom:$junit5Version"))
testImplementation('org.junit.jupiter:junit-jupiter')
testRuntimeOnly('org.junit.platform:junit-platform-launcher')

testImplementation "org.assertj:assertj-core:$assertjCoreVersion"
testImplementation "org.mockito:mockito-core:$mockitoVersion"
testImplementation "org.mockito:mockito-junit-jupiter:$mockitoVersion"
testImplementation "org.itsallcode:junit5-system-extensions:$junit5SystemExtVersion"
}

tasks.withType(JavaCompile) {
sourceCompatibility = 1.8
targetCompatibility = 1.8
tasks.withType(JavaCompile).configureEach {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}

//set jvm for all Test tasks (like test and smokeTest)
tasks.withType(Test) {
tasks.withType(Test).configureEach {

def args = ['-Xms512m', '-Xmx3g', '-Dorientdb.installCustomFormatter=false=false', '-Djna.nosys=true']

Expand All @@ -45,30 +44,73 @@ tasks.withType(Test) {
if (JavaVersion.current().java9Compatible) {
args << '-XX:MaxDirectMemorySize=2g'
}
jvmArgs args
jvmArgs = args
}

task javadocJar(type: Jar) {
tasks.register("javadocJar", Jar) {
archiveClassifier.set('javadoc')
from javadoc
}

task sourcesJar(type: Jar) {
archiveClassifier.set('sources')
tasks.register("sourcesJar", Jar) {

it.archiveClassifier.set('sources')
from sourceSets.main.allSource
}

tasks.withType(AbstractArchiveTask) {
tasks.withType(AbstractArchiveTask).configureEach {
preserveFileTimestamps = false
reproducibleFileOrder = true
}

tasks.register("commitBuildAndDate", Exec) {
group = "build"
description = "determine build date and time from last commit"

executable "git"
args "show", "-s", "--format=%cI", "HEAD"

standardOutput = new ByteArrayOutputStream()

ext.commitDate = {
def zonedDateTime = ZonedDateTime.parse(standardOutput.toString().trim())
return zonedDateTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss'['VV']'"))
}

ext.date = {
def zonedDateTime = ZonedDateTime.parse(standardOutput.toString().trim())
return zonedDateTime.format(DateTimeFormatter.ofPattern('yyyy-MM-dd'))
}

ext.time = {
def zonedDateTime = ZonedDateTime.parse(standardOutput.toString().trim())
return zonedDateTime.format(DateTimeFormatter.ofPattern('HH:mm:ss.SSSZ'))
}
}

tasks.register("commitHash", Exec) {
group = "build"
description = "determine build commit hash for last commit"

executable "git"
args "show", "-s", "--format=%h", "HEAD"

standardOutput = new ByteArrayOutputStream()

ext.abbreviated = {
return standardOutput.toString().trim()
}
}

processResources.dependsOn(tasks.commitBuildAndDate)
processResources.dependsOn(tasks.commitHash)

test {
useJUnitPlatform()

testLogging {
events "passed", "skipped", "failed"
exceptionFormat "full"
exceptionFormat = "full"
}

jacoco {
Expand All @@ -89,7 +131,7 @@ jacocoTestReport {

jacocoTestReport.dependsOn test

tasks.withType(Checkstyle) {
tasks.withType(Checkstyle).configureEach {
reports {
xml.required.set false
html.required.set true
Expand Down
69 changes: 31 additions & 38 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,55 +7,48 @@ issues = https://github.com/jbake-org/jbake/issues
vcs = https://github.com/jbake-org/jbake/

# runtime dependencies
asciidoctorjVersion = 2.5.7
asciidoctorjDiagramVersion = 2.2.1
asciidoctorjVersion = 3.0.1
asciidoctorjDiagramVersion = 3.0.1
args4jVersion = 2.33
commonsIoVersion = 2.11.0
commonsConfigurationVersion = 2.7
commonsBeanutilsVersion = 1.9.4
commonsLangVersion = 3.12.0
commonsVfs2Version = 2.9.0
freemarkerVersion = 2.3.31
flexmarkVersion = 0.62.2
groovyVersion = 3.0.9
jettyServerVersion = 9.4.44.v20210927
commonsIoVersion = 2.21.0
commonsConfigurationVersion = 2.12.0
commonsBeanutilsVersion = 1.11.0
commonsLangVersion = 3.19.0
commonsVfs2Version = 2.10.0
freemarkerVersion = 2.3.34
flexmarkVersion = 0.64.8
groovyVersion = 3.0.25
jettyServerVersion = 11.0.26
jsonSimpleVersion = 1.1.1
jade4jVersion = 1.3.2
jsoupVersion = 1.14.3
jgitVersion = 6.0.0.202111291000-r
logbackVersion = 1.2.10
jsoupVersion = 1.21.2
jgitVersion = 7.4.0.202509020913-r
logbackVersion = 1.5.21
orientDbVersion = 3.1.20
pebbleVersion = 3.1.5
slf4jVersion = 1.7.32
snakeYamlVersion = 1.30
thymeleafVersion = 3.0.14.RELEASE
picocli = 4.6.2
pebbleVersion = 3.2.4
slf4jVersion = 2.0.17
snakeYamlVersion = 2.5
thymeleafVersion = 3.1.3.RELEASE
picocli = 4.7.7


# testing dependencies
junit4Version = 4.13.2
junit5Version = 5.8.2
junit5SystemExtVersion = 1.2.0
junitPioneer = 1.5.0
assertjCoreVersion = 3.21.0
mockitoVersion = 4.2.0
junit5Version = 5.14.1
assertjCoreVersion = 3.27.6
mockitoVersion = 5.20.0

# build dependencies
jacocoVersion = 0.8.7
grgitVersion = 4.1.1
nexusPublishPluginVersion = 1.1.0
versionsPluginVersion = 0.40.0
optionalBaseVersion = 7.0.0
jreleaserVersion = 0.10.0
mavenPluginDevVersion = 0.3.1
jacocoVersion = 0.8.13
nexusPublishPluginVersion = 2.0.0
versionsPluginVersion = 0.53.0
optionalBaseVersion = 10.0.1
jreleaserVersion = 1.21.0
mavenPluginDevVersion = 1.0.3

# jbake-maven-plugin dependencies
mavenVersion = 3.8.4
mavenAnnotationsVersion = 3.6.2
sparkVersion = 2.9.3
mavenVersion = 3.9.11
mavenAnnotationsVersion = 3.15.2
sparkVersion = 2.9.4

org.gradle.caching=true
org.gradle.parallel=true
org.gradle.configureondemand = true
org.gradle.vfs.watch = true

33 changes: 15 additions & 18 deletions gradle/application.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
mainClassName = "org.jbake.launcher.Main"
applicationName = "jbake"

def examplesBase = "$project.buildDir/examples"
application {
mainClass = "org.jbake.launcher.Main"
applicationName = "jbake"
}

def exampleRepositories = [
"example_project_freemarker": "https://github.com/jbake-org/jbake-example-project-freemarker.git",
Expand All @@ -14,27 +14,24 @@ def exampleRepositories = [
//create clone and Zip Task for each repository
exampleRepositories.each { name, repository ->

task "clone_${name}Repository"() {
tasks.register("clone_${name}Repository", Exec) {
group = "distribution"
description "Clone jbake ${name} example project repository"

def repositoryName = "$examplesBase/$name"
description = "Clone jbake ${name} example project repository"
def repositoryName = "${project.layout.buildDirectory.asFile.get()}/examples/$name"

outputs.dir repositoryName
outputs.dir(repositoryName)

doLast {
grgit.clone(dir: repositoryName, uri: repository)
}
executable "git"
args "clone", "$repository", "$repositoryName"
}

task "${name}Zip"(type: Zip) {
group "distribution"
description "Zip $name repository"
tasks.register("${name}Zip", Zip) {
group = "distribution"
description = "Zip $name repository"

archiveBaseName = name
archiveFileName = "${archiveBaseName.get()}.zip"
archiveFileName = "${name}.zip"

from project.tasks.getByName("clone_${name}Repository").outputs
from project.tasks.named("clone_${name}Repository").get().outputs
exclude 'README.md'
exclude 'LICENSE'
exclude '.git'
Expand Down
26 changes: 12 additions & 14 deletions gradle/maven-publishing.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -69,19 +69,17 @@ publishing {

jar {
manifest {
attributes(
'Built-By': System.properties['user.name'],
'Created-By': "${System.properties['java.version']} (${System.properties['java.vendor']} ${System.properties['java.vm.version']})".toString(),
'Build-Date': buildDate,
'Build-Time': buildTime,
'Specification-Title': project.name,
'Specification-Version': project.version,
'Specification-Vendor': project.name,
'Implementation-Title': project.name,
'Implementation-Version': project.version,
'Implementation-Vendor': project.name
)
attributes.putIfAbsent('Built-By', System.properties['user.name'])
attributes.putIfAbsent('Created-By', "${System.properties['java.version']} (${System.properties['java.vendor']} ${System.properties['java.vm.version']})")
attributes.putIfAbsent('Specification-Title', project.name)
attributes.putIfAbsent('Specification-Version', project.version)
attributes.putIfAbsent('Specification-Vendor', project.name)
attributes.putIfAbsent('Implementation-Title', project.name)
attributes.putIfAbsent('Implementation-Version', project.version)
attributes.putIfAbsent('Implementation-Vendor', project.name)
}
doFirst {
manifest.attributes.putIfAbsent('Build-Date',commitBuildAndDate.date())
manifest.attributes.putIfAbsent('Build-Time',commitBuildAndDate.time())
}
}


Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 3 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.0-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading