Skip to content

Commit

Permalink
Merged fixed between Linux and Windows sides
Browse files Browse the repository at this point in the history
  • Loading branch information
hbitteur committed Jul 24, 2024
1 parent f5efabe commit 8f49c0c
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 28 deletions.
5 changes: 2 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,7 @@ allprojects {

// Run default configuration.
// Heap size (and other stuff) can be modified via a 'jvmLineArgs' on gradle command line
// Application arguments can be provided via a 'cmdLineArgs' on gradle command line
run {
tasks.run {
minHeapSize = '512m'
maxHeapSize = '1g'

Expand All @@ -120,7 +119,7 @@ repositories {
println "repositories. isFlatpak set"
maven { // Only the offline repository
name = 'Offline repository for flatpak'
url = '../flatpak/build/dependencies'
url = '../../dependencies' // TODO: check this!
}
} else {
mavenCentral()
Expand Down
69 changes: 44 additions & 25 deletions flatpak/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ rather than having to develop and maintain *ad hoc* procedures.

## Subprojects

Below is a simplified tree view, focused on the main source files.
Below is a simplified tree view, focused on the main files.
<pre>
.
├── app
Expand Down Expand Up @@ -50,14 +50,31 @@ Below is a simplified tree view, focused on the main source files.
│   ├── README.md // this file!
│   ├── build.gradle
│   ├── dev
│   │   └── org.audiveris.audiveris.template.yml
│   └── flathub // the new Git submodule
│      ├── add-tessdata-prefix.sed
│      ├── org.audiveris.audiveris.desktop
│      ├── org.audiveris.audiveris.metainfo.xml
│      ├── ... lang_sources.yml // generated by task genLanguages
│      ├── ... org.audiveris.audiveris.yml // generated by task genManifest
│      └── ... dependencies.json // generated by task genDependencies
│   │   └── org.audiveris.audiveris.template.yml // Template for flatpak-builder manifest
│   ├── res // Resources to be copied to flathub
│   │   ├── add-tessdata-prefix.sed
│   │   ├── org.audiveris.audiveris.desktop
│   │   └── org.audiveris.audiveris.metainfo.xml
│   ├── README.md // this file!
│   └── flathub // new Git submodule. To be populated as follows:
│   ├── dependencies.json // Dependencies manifest generated from app subproject
│   ├── dependencies // Offline dependencies
│      │ ├── ...
│   │   └── ... // Needed libraries
│   │
│   ├── lang_sources.yml // Languages manifest generated from app/dev/tessdata
│   ├── deu.traineddata
│   ├── eng.traineddata
│   ├── fra.traineddata
│   ├── ita.traineddata
│   │
│   ├── add-tessdata-prefix.sed
│   ├── org.audiveris.audiveris.desktop
│   ├── org.audiveris.audiveris.metainfo.xml
│   │
│   ├── org.audiveris.audiveris.yml // Global manifest for flatpak-builder
│   │
│   └── ... // Perhaps other build artifacts
├── gradle
│   └── wrapper
│   ├── gradle-wrapper.jar
Expand Down Expand Up @@ -97,31 +114,33 @@ We can find:

## Building flatpak

In this "work in progress", the generation of Flatpak components is trigged by the following command, entered from Audiveris root folder:
In this "work in progress", the generation of Flatpak components is trigged by the following command,
entered from the Audiveris root folder:
``` sh
./gradlew -q :app:buildFlatpak
./gradlew -q :flatpak:buildFlatpak
```

This means to launch the task ``buildFlatpak`` within the sub-project ``flatpak``.
Perhaps ``buildFlatpak`` should be better named ``build``, but for the time being this prevents any unwanted build.

This task, if needed, launches the following tasks:
1. The ``genLanguages`` task builds the flatpak/build/``lang_sources.yml`` file by browsing the app/dev/tessdata/``*.traineddata`` files.
2. The ``genManifest`` task builds the flatpak/build/``org.audiveris.audiveris.yml`` manifest by expanding
the template flatpak/dev/``org.audiveris.audiveris.template.yml`` file with the variables
read in gradle/wrapper/``wrapper.properties`` and ``gradle.properties``.
Nota: the application tag, for example ``5.4-alpha-1``, is today hard-coded in flatpak/``build.gradle`` file,
but might be better defined in ``gradle.properties``. To be investigated.
3. The ``genDependencies`` task makes sure that Audiveris Java classes (``:app:classes``) have been compiled
and then run the ``:app:flatpakGradleGenerator`` plugin to generate the app/build/``dependencies.json`` file.
4. Finally, the ``buildFlatpak`` Gradle task launches ``flatpak-builder`` as follows:
This task does two things:
1. First, the ``initFlathub`` task is run to populate the flatpak/flathub folder
1. The ``genLanguages`` task builds the flatpak/flathub/``lang_sources.yml`` file by browsing the app/dev/tessdata/``*.traineddata`` files.
2. The ``genManifest`` task builds the flatpak/flathub/``org.audiveris.audiveris.yml`` manifest by expanding
the template flatpak/dev/``org.audiveris.audiveris.template.yml`` file with the variables
read in gradle/wrapper/``wrapper.properties`` and ``gradle.properties``.
TODO: the application tag, for example ``5.4-alpha-2``, is today hard-coded in flatpak/``build.gradle`` file,
but might be better defined in ``gradle.properties``. To be investigated.
3. The ``genDependencies`` task makes sure that Audiveris Java classes (``:app:classes``) have been compiled
and then run the ``:app:flatpakGradleGenerator`` plugin to generate the app/build/``dependencies.json`` file
which is then copied to the flatpak/flathub folder.
4. Second, it launches ``flatpak-builder`` as follows:
``` sh
commandLine('flatpak-builder',
'--verbose',
'--state-dir=build/.flatpak-builder', // option to define the state-storing directory
'--verbose', // option to set verbosity level
'--force-clean', // option to empty the output directory
'build/output', // relative path to the output directory to write
'build/org.audiveris.audiveris.yml') // relative path to the manifest file to read
'build', // relative path to the output directory to write
'org.audiveris.audiveris.yml') // relative path to the manifest file to read
```


Expand Down

0 comments on commit 8f49c0c

Please sign in to comment.