JAL-4421 Add DS_Store customisation to gradle. Add backgroundImage alias dump to...
authorBen Soares <b.soares@dundee.ac.uk>
Fri, 31 May 2024 23:45:58 +0000 (00:45 +0100)
committerBen Soares <b.soares@dundee.ac.uk>
Fri, 31 May 2024 23:45:58 +0000 (00:45 +0100)
build.gradle
gradle.properties
utils/channels/test-release/channel_gradle.properties
utils/channels/test-release/images/jalview_test-release_dmg_DS_Store.json [new file with mode: 0644]
utils/macos_dmg/jalview_customise_dsstore.py [moved from utils/macos_dmg/jalview_custom_dsstore.py with 97% similarity]

index 2396e7d..044242c 100644 (file)
@@ -235,6 +235,7 @@ ext {
   jvlChannelName = CHANNEL.toLowerCase()
   install4jSuffix = CHANNEL.substring(0, 1).toUpperCase() + CHANNEL.substring(1).toLowerCase(); // BUILD -> Build
   install4jDMGDSStore = "${install4j_images_dir}/${install4j_dmg_ds_store}"
+  install4jDMGDSStoreJSON = "${install4j_images_dir}/${install4j_dmg_ds_store_json}"
   install4jDMGBackgroundImageDir = "${install4j_images_dir}"
   install4jDMGBackgroundImageBuildDir = "build/imagemagick/install4j"
   install4jDMGBackgroundImageFile = "${install4j_dmg_background}"
@@ -2834,14 +2835,22 @@ task install4jDMGBackgroundImageProcess {
   }
 }
 
-task install4jDMGDS_Store {
-  //install4jDMGDS_Store
-  //install4jDMGFixedDSStore
+
+python {
+  pip 'ds_store:1.3.1'
+}
+
+task install4jCustomiseDS_Store(type: PythonTask) {
+  inputs.file(install4jDMGDSStore)
+  inputs.file(install4jDMGDSStoreJSON)
+  outputs.file(install4jDMGFixedDSStore)
+  command = [ jalview_customise_ds_store, '--input', install4jDMGDSStore, '--output', install4jDMGFixedDSStore, '--volumename', install4jmacOSArchiveName, '--background', install4j_dmg_background_filename, '--config', install4jDMGDSStoreJSON ]
 }
 
+
 task install4jDMGProcesses {
   dependsOn install4jDMGBackgroundImageProcess
-  dependsOn install4jDMGDS_Store
+  dependsOn install4jCustomiseDS_Store
 }
 
 task installerFiles(type: com.install4j.gradle.Install4jTask) {
@@ -2889,7 +2898,7 @@ task installerFiles(type: com.install4j.gradle.Install4jTask) {
     'BUNDLE_ID': install4jBundleId,
     'INTERNAL_ID': install4jInternalId,
     'WINDOWS_APPLICATION_ID': install4jWinApplicationId,
-    'MACOS_DMG_DS_STORE': install4jDMGDSStore,
+    'MACOS_DMG_DS_STORE': install4jDMGFixedDSStore,
     'MACOS_DMG_BG_IMAGE': "${install4jDMGBackgroundImageBuildDir}/${install4jDMGBackgroundImageFile}",
     'MACOS_DMG_BG_FILENAME': install4j_dmg_background_filename,
     'WRAPPER_LINK': getdownWrapperLink,
index 0c05033..5906efd 100644 (file)
@@ -154,6 +154,9 @@ install4j_dmg_background = jalview_dmg_background-NON-RELEASE.png
 install4j_dmg_background_filename = background.png
 install4j_dmg_ds_store = jalview_dmg_DS_Store
 install4j_dmg_ds_store_json = jalview_dmg_DS_Store.json
+jalview_customise_ds_store = utils/macos_dmg/jalview_customise_dsstore.py
+
+
 getdown_wrapper_script_dir = bin
 getdown_bash_wrapper_script = jalview.sh
 getdown_powershell_wrapper_script = jalview.ps1
index 1775200..5b12b8d 100644 (file)
@@ -19,6 +19,7 @@ install4j_png_icon_file = jalview_test-release_logo.png
 install4j_background = jalview_logo_background_fade-640x480.png
 install4j_dmg_background = jalview_test-release_dmg_background-72dpi.png
 install4j_dmg_ds_store = jalview_test-release_dmg_DS_Store
+install4j_dmg_ds_store_json = jalview_test-release_dmg_DS_Store.json
 
 getdown_background_image_text_font = utils/fonts/Roboto.ttf
 getdown_background_image_text_colour = #b4b4b4
diff --git a/utils/channels/test-release/images/jalview_test-release_dmg_DS_Store.json b/utils/channels/test-release/images/jalview_test-release_dmg_DS_Store.json
new file mode 100644 (file)
index 0000000..b584fda
--- /dev/null
@@ -0,0 +1,39 @@
+{
+  "files": [
+    {
+      "name": "Jalview Test.app",
+      "xpos": 132,
+      "ypos": 124
+    },
+    {
+      "name": " ",
+      "xpos": 332,
+      "ypos": 124
+    }
+  ],
+  "_comment": "bwsp and icvp are not being used yet",
+  "bwsp": {
+    "ShowStatusBar": false,
+    "SidebarWidthTenElevenOrLater": 160,
+    "ShowToolbar": false,
+    "ShowTabView": false,
+    "ContainerShowSidebar": false,
+    "WindowBounds": "{{355, 432}, {504, 324}}",
+    "ShowSidebar": false,
+    "ShowPathbar": false
+  },
+  "icvp": {
+    "backgroundColorBlue": 1.0,
+    "backgroundColorGreen": 1.0,
+    "backgroundColorRed": 1.0,
+    "labelOnBottom": true,
+    "gridSpacing": 100,
+    "textSize": 12.0,
+    "backgroundType": 2,
+    "gridOffsetX": 0.0,
+    "gridOffsetY": 0.0,
+    "showItemInfo": false,
+    "viewOptionsVersion": 1,
+    "arrangeBy": "none"
+  }
+}
similarity index 97%
rename from utils/macos_dmg/jalview_custom_dsstore.py
rename to utils/macos_dmg/jalview_customise_dsstore.py
index dc5d2e7..8434b69 100755 (executable)
@@ -24,6 +24,14 @@ parser.add_argument("-f", "--filenames", help="List of comma-separated filenames
 
 args = parser.parse_args()
 
+def myprint(string):
+  if (not args.quiet):
+    print(string)
+
+def mypprint(string):
+  if (not args.quiet):
+    pprint(string)
+
 if (args.dump and not args.input):
   exit("When --dump used, an --input must be given")
 
@@ -36,6 +44,10 @@ if (args.dump):
       except:
         myprint(f"No info for d['.']['{key}']")
 
+    alias = mac_alias.Alias.from_bytes( d['.']['icvp']['backgroundImageAlias'] )
+    myprint("backgroundImageAlias=")
+    mypprint(alias)
+
     for data in d:
       try:
         data = str(data)
@@ -70,13 +82,6 @@ config = json.load(configfile)
 inputds = DSStore.open(args.input)
 outputds = DSStore.open(args.output, 'w+')
 
-def myprint(string):
-  if (not args.quiet):
-    print(string)
-
-def mypprint(string):
-  if (not args.quiet):
-    pprint(string)
 
 bwsp = {}