generated from isaqb-org/advanced-template
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
33 changed files
with
865 additions
and
385 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
name: Comment on Pull Request | ||
|
||
on: | ||
workflow_run: | ||
types: [completed] | ||
workflows: [CI – Pull Requests] | ||
|
||
jobs: | ||
call_workflow_build: | ||
uses: isaqb-org/github-workflows/.github/workflows/update_pr_with_comment.yml@main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,104 +1,44 @@ | ||
import org.asciidoctor.gradle.jvm.AsciidoctorTask | ||
import java.text.SimpleDateFormat | ||
|
||
plugins { | ||
id "org.asciidoctor.jvm.base" version "3.3.2" | ||
id "org.asciidoctor.jvm.convert" version "3.3.2" | ||
id "org.asciidoctor.jvm.pdf" version "3.3.2" | ||
id "java" | ||
id "application" | ||
} | ||
|
||
def group = "org.isaqb" | ||
def releaseVersion = System.getenv("RELEASE_VERSION") | ||
def localVersion = "LocalBuild" | ||
project.version = releaseVersion == null ? localVersion : releaseVersion | ||
def curriculumFileName = "curriculum-flex" | ||
def versionDate = new SimpleDateFormat("yyyyMMdd").format(new Date()) | ||
def languages = ["DE", "EN"] | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
asciidoctorj { | ||
version = '2.5.3' | ||
dependencies { | ||
implementation("org.asciidoctor:asciidoctorj:2.5.10") | ||
implementation("org.asciidoctor:asciidoctorj-pdf:2.3.9") | ||
} | ||
|
||
ext { | ||
today = new Date() | ||
versionDate = new SimpleDateFormat("yyyyMMdd").format(today) | ||
|
||
releaseVersion = System.getenv("RELEASE_VERSION") | ||
localVersion = "LocalBuild" | ||
project.version = releaseVersion == null ? localVersion : releaseVersion; | ||
|
||
curriculumFileName = "curriculum-flex" | ||
addSuffixToCurriculum = { suffix -> | ||
for (extension in ["html", "pdf"]) { | ||
File source = new File("${buildDir}/${curriculumFileName}.${extension}") | ||
File target = new File("${buildDir}/${curriculumFileName}${suffix}.${extension}") | ||
|
||
source.renameTo(target) | ||
} | ||
} | ||
application { | ||
mainClass.set("org.isaqb.asciidoc.Main") | ||
applicationDefaultJvmArgs = [ | ||
"""-DprojectVersion=${project.version}""", | ||
"""-DcurriculumFileName=${curriculumFileName}""", | ||
"""-DversionDate=${versionDate}""", | ||
"""-Dlanguages=${languages.join(',')}""", | ||
"""--add-opens""", """java.base/sun.nio.ch=ALL-UNNAMED""", | ||
"""--add-opens""", """java.base/java.io=ALL-UNNAMED"""] | ||
} | ||
|
||
apply from: 'scripts/includeLearningObjectives.gradle' | ||
|
||
|
||
|
||
class RenderCurriculumTask extends AsciidoctorTask { | ||
@Inject | ||
RenderCurriculumTask(WorkerExecutor we, String curriculumFileName, String versionDate, String language) { | ||
super(we) | ||
|
||
forkOptions { | ||
jvmArgs "--add-opens", "java.base/sun.nio.ch=ALL-UNNAMED", "--add-opens", "java.base/java.io=ALL-UNNAMED" | ||
} | ||
|
||
|
||
sourceDir = new File("./docs/") | ||
baseDir = new File ("./docs/") | ||
sources { | ||
include "index.adoc" | ||
include "${curriculumFileName}.adoc" | ||
} | ||
outputDir = new File("./build/") | ||
outputOptions { | ||
separateOutputDirs = false | ||
backends 'pdf', 'html5' | ||
} | ||
|
||
def fileVersion = project.version.trim() + "-" + language | ||
|
||
attributes = [ | ||
'icons' : 'font', | ||
'version-label' : '', | ||
'revnumber' : fileVersion, | ||
'revdate' : versionDate, | ||
'document-version' : fileVersion + "-" + versionDate, | ||
'currentDate' : versionDate, | ||
'language' : language, | ||
'curriculumFileName': curriculumFileName, | ||
'debug_adoc' : false, | ||
'pdf-stylesdir' : '../pdf-theme/themes', | ||
'pdf-fontsdir' : '../pdf-theme/fonts', | ||
'pdf-style' : 'isaqb', | ||
'stylesheet' : '../html-theme/adoc-github.css', | ||
'stylesheet-dir' : '../html-theme' | ||
] | ||
} | ||
} | ||
|
||
task buildDocs { | ||
group 'Documentation' | ||
description 'Grouping task for generating all languages in several formats' | ||
dependsOn "includeLearningObjectives", "renderDE", "renderEN" | ||
} | ||
|
||
task renderDE(type: RenderCurriculumTask, | ||
constructorArgs: [curriculumFileName, versionDate, "DE"]) { | ||
doLast { | ||
addSuffixToCurriculum("-de") | ||
} | ||
} | ||
|
||
task renderEN(type: RenderCurriculumTask, | ||
constructorArgs: [curriculumFileName, versionDate, "EN"]) { | ||
doLast { | ||
addSuffixToCurriculum("-en") | ||
} | ||
tasks.register('buildDocs') { | ||
description = 'Grouping task for generating all languages in several formats' | ||
group = 'documentation' | ||
dependsOn "includeLearningObjectives", "run" | ||
} | ||
|
||
apply from: 'scripts/includeLearningObjectives.gradle' | ||
|
||
defaultTasks "buildDocs" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.