Skip to content

Commit

Permalink
Languages files directly copied to flathub
Browse files Browse the repository at this point in the history
  • Loading branch information
hbitteur committed Jun 17, 2024
1 parent 00361a4 commit e485c92
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
17 changes: 11 additions & 6 deletions flatpak/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,25 @@ task genLanguages {
description("Generate languages sources")

doLast {
///flathubDir.exists() || flathubDir.mkdirs()
println "Copying language sources to $flathubDir"
copy {
from("appdir/dev/tessdata")
include '*.traineddata'
into(flathubDir)
}

def langFile = new File(flathubDir, "lang_sources.yml")
println "Generating language sources into ${langFile}"
println "Generating language sources as ${langFile}"

project.delete(
fileTree(langFile)
)

fileTree("$appDir/dev/tessdata").include('*.traineddata').each { f ->
def relPath = relativePath(f).replace("\\","/")
def fname = f.getName()
def sha1 = calcSha1(f) // perhaps not needed
langFile.append(" - type: file\n")
langFile.append(" path: ../${relPath}\n")
langFile.append(" sha1: ${sha1}\n\n") // perhaps not needed
langFile.append(" path: ${fname}\n\n")
}
}
}
Expand Down Expand Up @@ -143,7 +148,7 @@ task buildFlatpak (type: Exec) {

// All outputs are located under the 'build' directory for an easier cleanup
commandLine('flatpak-builder',
// '--verbose',
'--verbose',
// '--state-dir=build/.flatpak-builder', // option to define the state-storing directory
'--force-clean', // option to empty the output directory
'build', // relative path to the output directory to write
Expand Down
2 changes: 1 addition & 1 deletion flatpak/flathub

0 comments on commit e485c92

Please sign in to comment.