Skip to content

Commit

Permalink
fix: svg files not being updated when running gradle asciidoctor
Browse files Browse the repository at this point in the history
  • Loading branch information
RyosukeDTomita committed Nov 14, 2024
1 parent 9d2404e commit c3d4783
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,30 @@ repositories {
mavenCentral()
}

clean {
delete fileTree('build/docs/html')
}
// NOTE: Gradleにはデフォルトでcleanタスクが存在し、build/を削除可能

// NOTE: asciidoctorタスクはplugin側で定義されているのでタスクの定義不要
asciidoctor {
baseDir file('src/docs/asciidoc')
outputDir file('build/docs/html')
}
// PlantUML用(直接 gradle asciidoctorjで実行しない)

// asciidoctorから呼び出され、図等を埋め込む
asciidoctorj {
modules {
diagram.use()
diagram.version '2.3.1'
}
attributes "source-highlighter" : "rouge"
}

// NOTE: `gradle asciidoctor`実行時に.svgファイルがあると更新されないため削除する
task cleanPlantUML(type: Delete) {
delete fileTree('build/docs/html/') {
include '**/*.svg'
}
}
asciidoctor.dependsOn cleanPlantUML

// `gradle`でコンパイルするためのエイリアス
defaultTasks 'asciidoctor'
defaultTasks 'asciidoctor'

0 comments on commit c3d4783

Please sign in to comment.