Skip to content

Commit 1739704

Browse files
committed
Merge branch 'development'
2 parents f8b9172 + 31df91b commit 1739704

File tree

109 files changed

+3221
-1331
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+3221
-1331
lines changed

.github/workflows/flatpak.yml

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -46,39 +46,32 @@ jobs:
4646
flatpak:
4747
name: "Flatpak"
4848
needs: java-dependencies
49-
runs-on: ubuntu-latest
5049

5150
container:
52-
image: bilelmoussaoui/flatpak-github-actions:gnome-47
51+
image: ghcr.io/flathub-infra/flatpak-github-actions:gnome-48
5352
options: --privileged
5453

5554
strategy:
5655
matrix:
57-
arch: [x86_64, aarch64]
56+
variant:
57+
- arch: x86_64
58+
runner: ubuntu-24.04
59+
- arch: aarch64
60+
runner: ubuntu-24.04-arm
5861
fail-fast: false
62+
runs-on: ${{ matrix.variant.runner }}
5963

6064
steps:
6165
- name: download flathub content
6266
uses: actions/download-artifact@v4
6367
with:
6468
name: flathub-content
6569

66-
- name: Install docker
67-
if: ${{ matrix.arch != 'x86_64' }}
68-
run: |
69-
dnf -y install docker
70-
71-
- name: Set up QEMU
72-
if: ${{ matrix.arch != 'x86_64' }}
73-
uses: docker/setup-qemu-action@v2
74-
with:
75-
platforms: arm64
76-
7770
- name: Build flatpak ${{ github.sha }}
7871
uses: flatpak/flatpak-github-actions/flatpak-builder@v6
7972
with:
8073
build-bundle: true
8174
bundle: org.audiveris.audiveris.flatpak
8275
manifest-path: org.audiveris.audiveris.yml
8376
cache-key: audiveris-flatpak-${{ github.sha }}
84-
arch: ${{ matrix.arch }}
77+
arch: ${{ matrix.variant.arch }}

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,9 @@ as described in the handbook [sources section][sources].
6767

6868
There are two main branches in the Audiveris project:
6969
- the `master` branch is the GitHub default branch;
70-
we use it for releases, and only for them;
71-
To build from this branch, you will need a `jdk` for Java version **24** or higher.
70+
we use it for releases, and only for them.
7271
- the `development` branch is the one where all developments continuously take place;
73-
Periodically, when a release is to be made, we merge the development branch into the master branch;
74-
As of this writing, the source code on development branch requires a `jdk` for Java version **24**.
72+
Periodically, when a release is to be made, we merge the development branch into the master branch.
7573

7674
See details in the [Wiki article][workflow] dedicated to the chosen development workflow.
7775

app/build.gradle

Lines changed: 59 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ plugins {
2222
def app = project(':app')
2323

2424
// Central location for application version
25-
project.version = '5.7.1'
25+
project.version = '5.8.0'
2626
println "version: ${project.version}"
2727

2828
// Central location for the specific versions of tesseract dependencies
@@ -195,6 +195,12 @@ sourceSets {
195195
}
196196
}
197197

198+
test {
199+
// Test classes not meant for Junit
200+
exclude '**/org/audiveris/omr/jaxb/basic/**'
201+
exclude '**/org/audiveris/omr/jaxb/facade/**'
202+
}
203+
198204
//-------
199205
// Tasks
200206
//-------
@@ -270,54 +276,79 @@ jar {
270276
}
271277
}
272278

273-
// Retrieve the full hash for the latest commit from Git
279+
// Retrieve hash of the latest commit from Git
280+
// Output is in 'app.ext.commit' property
274281
tasks.register('getCommit', Exec) {
275-
description = "Retrieves full hash of git latest commit"
276-
outputs.file("build/commit.txt")
277-
commandLine = "git rev-parse HEAD".split(' ')
282+
description = "Retrieves hash of git latest commit"
283+
// NOTA: We exclude the folder '<root>/flatpak/flathub' from this commit retrieval
284+
commandLine = "git log -n1 --pretty=%H -- :^../flatpak/flathub".split(' ')
278285
standardOutput = new ByteArrayOutputStream()
279286

280287
doLast {
281288
def commit = standardOutput.toString().replaceAll('\n', '')
282-
println "commit: ${commit}"
289+
println "app. New commit: ${commit}"
283290
app.ext.commit = commit
284-
285-
def commitFile = file("build/commit.txt")
286-
commitFile.text = commit
287291
}
288292
}
289293

290-
// Retrieve the short hash for the latest commit from Git
291-
tasks.register('getCommitShort', Exec) {
292-
description = "Retrieves short hash of git latest commit"
293-
outputs.file("build/commitShort.txt")
294+
tasks.register('createBuildFolder') {
295+
description = "Make sure the 'build' folder exists"
296+
doLast {
297+
def dir = file('build')
298+
if (!dir.exists()) {
299+
dir.mkdirs()
300+
println "app. Directory created: ${dir}"
301+
} else {
302+
println "app. Directory already exists: ${dir}"
303+
}
304+
}
305+
}
294306

295-
commandLine = "git rev-parse --short HEAD".split(' ')
296-
standardOutput = new ByteArrayOutputStream()
307+
// Compare commit with the one used for the generation of ProgramId Java class
308+
tasks.register('checkCommit') {
309+
dependsOn 'getCommit'
310+
dependsOn 'createBuildFolder'
297311

298312
doLast {
299-
def commitShort = standardOutput.toString().replaceAll('\n', '')
300-
println "commitShort: ${commitShort}"
313+
def cache = file("build/commit.properties")
314+
315+
if (cache.exists()) {
316+
def props = new Properties()
317+
cache.withInputStream { props.load(it) }
318+
app.ext.oldCommit = props.getProperty('commit')
319+
println "app. Old commit: ${app.ext.oldCommit}"
320+
if (!app.ext.oldCommit.equals(app.ext.commit)) {
321+
app.ext.commitChanged = 'true'
322+
}
323+
} else {
324+
println "app. No old commit"
325+
app.ext.commitChanged = 'true'
326+
}
327+
328+
if (project.hasProperty('commitChanged')) {
329+
// Save the new value
330+
def properties = new Properties()
331+
properties.setProperty('commit', app.ext.commit)
332+
333+
cache.withOutputStream { out ->
334+
properties.store(out, ' Last commit value')
335+
}
301336

302-
def commitShortFile = file("build/commitShort.txt")
303-
commitShortFile.text = commitShort
337+
println "app. Properties written to disk: ${cache}"
338+
}
304339
}
305340
}
306341

307342
// Generate a 'ProgramId.java' source file, based on Git data
308343
tasks.register('generateProgramId') {
309344
group = "build"
310345
description = "Generates the ProgramId source"
311-
dependsOn 'getCommit'
312-
dependsOn 'getCommitShort'
313-
314-
inputs.file("build/commit.txt")
315-
inputs.file("build/commitShort.txt")
346+
dependsOn 'checkCommit'
347+
onlyIf { project.hasProperty('commitChanged') }
316348

317349
def outputDir = file("build/generated-src/org/audiveris/omr")
318350
def className = "ProgramId"
319351
def gSrc = new File(outputDir, "${className}.java")
320-
outputs.file(gSrc)
321352

322353
doLast {
323354
outputDir.exists() || outputDir.mkdirs()
@@ -326,7 +357,7 @@ tasks.register('generateProgramId') {
326357
gSrc.append(" * This code has been automatically generated by Gradle.\n */\n")
327358
gSrc.append("public abstract class $className {")
328359

329-
app.ext.programBuild = file('build/commitShort.txt').text.trim()
360+
app.ext.programBuild = app.ext.commit
330361
["company_name", "company_id", "program_name", "program_id", "program_version", "program_build", "tessdata_tag"].each { str ->
331362
def strParts = str.split("_")
332363
def propName = strParts[0] + strParts[1].capitalize()
@@ -335,6 +366,8 @@ tasks.register('generateProgramId') {
335366
}
336367

337368
gSrc.append("}\n")
369+
370+
println "app. Java class ProgramId generated"
338371
}
339372
}
340373
compileJava.dependsOn('generateProgramId')

app/res/basic-classifier.zip

12.2 KB
Binary file not shown.

app/src/main/java/org/audiveris/omr/classifier/Annotations.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,16 @@ public abstract class Annotations
3131
//~ Static fields/initializers -----------------------------------------------------------------
3232

3333
/** File name extension for whole book annotations: {@value}. */
34-
public static final String BOOK_ANNOTATIONS_EXTENSION = "-annotations.zip";
34+
public static final String BOOK_ANNOTATIONS_EXTENSION = ".annotations.zip";
3535

3636
/** File name extension for single sheet annotations: {@value}. */
37-
public static final String SHEET_ANNOTATIONS_EXTENSION = "-annotations.xml";
37+
public static final String SHEET_ANNOTATIONS_EXTENSION = ".annotations.xml";
3838

3939
/** File format for single sheet image: {@value}. */
4040
public static final String SHEET_IMAGE_FORMAT = "png";
4141

4242
/** File name extension for single sheet image: {@value}. */
43-
public static final String SHEET_IMAGE_EXTENSION = "-image." + SHEET_IMAGE_FORMAT;
43+
public static final String SHEET_IMAGE_EXTENSION = "." + SHEET_IMAGE_FORMAT;
4444

4545
//~ Constructors -------------------------------------------------------------------------------
4646

0 commit comments

Comments
 (0)