Skip to content
Merged
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
15 changes: 15 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ tasks.register("generateSeforimDb") {
dependsOn(":sefariasqlite:seedAllMetadata")
dependsOn(":generator-common:buildLineRefIndex")
dependsOn(":generator-common:buildLineDhIndex")
dependsOn(":sefariasqlite:synthesizeSeifimAltToc")
dependsOn(":packaging:writeReleaseInfo")
dependsOn(":packaging:downloadLexicalDb")
// Stamps schema_meta.db_version into the produced seforim.db so the
Expand All @@ -35,6 +36,7 @@ project(":generator-common").tasks.matching { it.name == "stampSchemaVersion" }.
mustRunAfter(":catalog:buildCatalog")
mustRunAfter(":sefariasqlite:seedGenerations")
mustRunAfter(":sefariasqlite:seedAllMetadata")
mustRunAfter(":sefariasqlite:synthesizeSeifimAltToc")
mustRunAfter(":generator-common:buildLineRefIndex")
mustRunAfter(":generator-common:buildLineDhIndex")
}
Expand All @@ -47,6 +49,7 @@ project(":generator-common").tasks.matching { it.name == "buildLineRefIndex" }.c
mustRunAfter(":sefariasqlite:renameCategories")
mustRunAfter(":sefariasqlite:seedGenerations")
mustRunAfter(":sefariasqlite:seedAllMetadata")
mustRunAfter(":sefariasqlite:synthesizeSeifimAltToc")
}

// line_dh is derived from line.content, so it must be rebuilt after every
Expand Down Expand Up @@ -96,10 +99,22 @@ project(":sefariasqlite").tasks.matching { it.name == "seedAllMetadata" }.config
mustRunAfter(":sefariasqlite:renameCategories")
mustRunAfter(":sefariasqlite:seedGenerations")
}
// synthesizeSeifimAltToc reads COMMENTARY links and the final main TOC, so it
// runs after every book- and link-writing stage. Ordered after the other
// post-process seeders so they write to seforim.db sequentially.
project(":sefariasqlite").tasks.matching { it.name == "synthesizeSeifimAltToc" }.configureEach {
mustRunAfter(":otzariasqlite:appendOtzaria")
mustRunAfter(":otzariasqlite:generateHavroutaLinks")
mustRunAfter(":sefariasqlite:renameCategories")
mustRunAfter(":sefariasqlite:seedGenerations")
mustRunAfter(":sefariasqlite:seedAllMetadata")
}
project(":catalog").tasks.matching { it.name == "buildCatalog" }.configureEach {
mustRunAfter(":otzariasqlite:generateHavroutaLinks")
mustRunAfter(":sefariasqlite:seedGenerations")
mustRunAfter(":sefariasqlite:seedAllMetadata")
mustRunAfter(":sefariasqlite:synthesizeSeifimAltToc")
mustRunAfter(":generator-common:buildLineDhIndex")
}
project(":packaging").tasks.matching { it.name == "writeReleaseInfo" }.configureEach {
mustRunAfter(":catalog:buildCatalog")
Expand Down
28 changes: 28 additions & 0 deletions generator/sefariasqlite/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,34 @@ tasks.register<JavaExec>("seedGenerations") {
jvmArgs = listOf("-Xmx512m")
}

// Seifim alt-TOC synthesis — runs after all book- and link-writing stages so
// the COMMENTARY links from the Shulchan Aruch are already present.
// Usage:
// ./gradlew :sefariasqlite:synthesizeSeifimAltToc
// ./gradlew :sefariasqlite:synthesizeSeifimAltToc -PseforimDb=/path/to/seforim.db
tasks.register<JavaExec>("synthesizeSeifimAltToc") {
group = "application"
description = "Synthesize a Seifim alt-TOC for nosei-kelim on the Shulchan Aruch from COMMENTARY links."

dependsOn("jvmJar")
mainClass.set("io.github.kdroidfilter.seforimlibrary.sefariasqlite.SynthesizeSeifimAltTocPostProcessKt")
classpath = files(tasks.named("jvmJar")) + configurations.getByName("jvmRuntimeClasspath")

if (project.hasProperty("seforimDb")) {
systemProperty("seforimDb", project.property("seforimDb") as String)
} else if (System.getenv("SEFORIM_DB") != null) {
systemProperty("seforimDb", System.getenv("SEFORIM_DB"))
} else {
val defaultDbPath = rootProject.layout.buildDirectory.file("seforim.db").get().asFile.absolutePath
systemProperty("seforimDb", defaultDbPath)
}
if (project.hasProperty("buildStatePath")) {
systemProperty("buildStatePath", project.property("buildStatePath") as String)
}

jvmArgs = listOf("-Xmx1g")
}

// Phase-2 LINKER importer: resolve ref-based artifacts (LinkerToOtzaria) into clickable links.
// Usage:
// ./gradlew :sefariasqlite:generateLinkerLinks -PseforimDb=/path/seforim.db \
Expand Down
Loading
Loading