From 8f49c0c5457bf5fd36ca99d90cc7aa2a8676e07a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Bitteur?= Date: Wed, 24 Jul 2024 17:34:36 +0200 Subject: [PATCH] Merged fixed between Linux and Windows sides --- app/build.gradle | 5 ++-- flatpak/README.md | 69 ++++++++++++++++++++++++++++++----------------- 2 files changed, 46 insertions(+), 28 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index bfd21f168..8807f0b6f 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -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' @@ -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() diff --git a/flatpak/README.md b/flatpak/README.md index 1acb49526..9e67097e5 100644 --- a/flatpak/README.md +++ b/flatpak/README.md @@ -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.
 .
 ├── app
@@ -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
@@ -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
 ```