Unzipped Plugins - still possible?

The speed difference between .xojo_plugin as zip or folder is very small here.
If you save 10% on startup, you can be happy.

The bigger thing would be to rearrange the packages to get faster pre-compilation.

[quote=475432:@Christian Schmitz]If you save 10% on startup, you can be happy.
[/quote]
I save more like 65% on Linux and macOS here with the full MBS, Einhugur, and my personal plugins. From over 2 minutes to less than 25 seconds.

You are correct in your steps outline, but I would urge you to use the script as it is in my last version post above.

I’ve been working on a plugins manager very slowly for more than a year. Recently it’s really started to take shape. I have been working with plugin authors like Björn and Christian to do some really cool things. Of course, it will unzip the plugins into place :slight_smile:

It’s still in alpha stages, so it’s not quite ready to share. A public beta will be available soon, but if you’re on the verge of writing your own scripts and really need something better feel free to shoot me a private message.

What I would like to see is for the IDE to smiply perform the unpack on the first run that includes any new zipped plugins. Disk space is not longer the problem that it was back in REALbasic days.

feedback://showreport?report_id=59190

It would have to unpack to a user writeable place (ie/ application support) as not all users will be able to unpack them right next to the IDE in the plugins dir

Hmm… I knew about that but, actually, I wouldn’t have thought of that right now. Thanks for the reminder.

I’ll use it, later (once I set it up on my main computer).
Currently, I’m trying to set this up on a MacBook Pro. It didn’t work in my earlier tests. No plugin got loaded.

I finally found the problem. All “.xojo_plugin” folders must be enclosed inside a “main” folder. That’s rather counter-intuitive, as “.xojo_plugin” files are directly located in the “Plugins” folder, while “.xojo_plugin” folders must be contained as subfolders.

Anyway, I tried with the working setup: with “zip formatted” files, Xojo took 9 minutes to load. With “.xojo_plugin” folders, only 8 minutes were necessary.
I’m now wondering what I’ll do with that free minute…

Right, it may concern some users (my guess is most plugins users would be the ones having installed the IDE). Xojo could fairly well define an alternate “Plugins” folder for each user.

[quote=475467:@Arnaud Nicolet]Here’s a path to one dylib file contained in my setup:
/Applications/Xojo 2019 Release 3.1/Plugins/MBS Xojo VLC Plugin.xojo_plugin/Build Resources/Mac Cocoa/MBS_VLC_VLC_Plugin_20159.dylib
Does that path look correct?[/quote]
I think the path should be like the following:

/Applications/Xojo 2019 Release 3.1/Plugins/MBS Xojo VLC Plugin.xojo_plugin/MBS Xojo VLC Plugin/Build Resources/Mac Cocoa/MBS_VLC_VLC_Plugin_20159.dylib

You’re missing a parent folder to “Build Resources”. I think someone mentioned in this thread (or another?) that the standard macOS “Archive” utility will sometimes skip a parent folder if it is the same name as the archive, or something like that.

I hope that helps.

Thank you.
I compared Christian’s screenshot and figured the same thing (thus, I edited the message you quoted).

Still thinking counter intuitive that files are directly in the “Plugins” folder while folders are in a sub folder, albeit all having the same “extension”.

[quote=475488:@Arnaud Nicolet]Still thinking counter intuitive that files are directly in the “Plugins” folder while folders are in a sub folder, albeit all having the same “extension”.

[/quote]
The actual layout is the top level Zip file containing the actual plugin content folder. So Xojo is treating the .xojo_plugin like a folder more than a file.

Yes, seen like that, it becomes logical.
But, when you convert plugin files to folders, you have to remember to add an extra sub folder that you may not expect during this particular task.
Thanks.

Mac Carbon Mach-O ?

No, that’s not relevant here.

Taken from Xojo 2019r3.

Care to explain ?

[quote=476436:@Emile Schwarz]Taken from Xojo 2019r3.

Care to explain?[/quote]
What was taken from Xojo 2019r3?
I can’t explain if I don’t know what you’re talking about, sorry.

A folder called Mac Carbon Mach-O in the Plugin folders.

and you wrote:

That is why I opened a plugin (the last from the vue as list)… to know what unexpected folder it was ! :wink:

[quote=476438:@Emile Schwarz]A folder called Mac Carbon Mach-O in the Plugin folders.

That is why I opened a plugin (the last from the vue as list)… to know what unexpected folder it was! ;)[/quote]
Well, no. I was talking about the folder right inside the “Plugins” folder, which enclose all the items of the bundle, not a folder inside the bundle. You may read this thread to read what this discussion is about (I just realise “thread” and “read” end the same; would it be a suffix? ?).

Here’s version 2 of the script, which handles Finder Aliases and makes a backup of plugins in a “Plugins_Backup” folder. It’s also using a hard-coded pathname so you can save it as a .command file and just double-click it in the FInder to run.


#!/bin/bash

# UnzipXojoPluginsV2.command
# A script to uncompress plugin archives to have Xojo load them faster.
# see https://forum.xojo.com/57793-unzipped-plugins-still-possible/2019/1
# by Michael Diehr 
# Thanks to Jim Mckay and others for creating the original script.

# be sure to chmod +x this script file


# Changes from earlier versions:
# - Now properly handles Finder Aliases (the kind you get with command-option drag)
#   this is useful if you like to keep your Plugins elsewhere
#
# - Is non-destructive - plugins (real or alias) are always moved to 
#   the Plugins_Backup/ folder
#
# - can be double-clicked: if you save this as a .command file (and chmod +x it)
#   then you can simply double-click it in the finder to run it


# set the path to your Xojo app here:
ROOT="/Applications/Xojo/Plugins/"

cd "$ROOT"


# a backup folder where we move originals, so this script is non-destructive
backups="../Plugins_Backup"
mkdir -p "${backups}"

for f in *.xojo_plugin
do
  if [[ ! -d "${f}" ]]
  then
    echo "Processing ${f}"

	# if the xojo_plugin file is a Finder alias to a file elsewhere on disk
	# handle it differently
	fTruePath=`osascript <<EOD
	set toPath to ""
	tell application "Finder"
		set toPath to (POSIX file "$ROOT/${f}") as alias
		set theKind to kind of toPath
		if theKind is "Alias" then
			set toPath to ((original item of toPath) as alias)
			return posix path of (toPath)
		end if
	end tell
	return ""
	EOD`


	if [ "${fTruePath}" ] 
	then
		echo "ALIAS: ${fTruePath}"
		# for an alias, we have to move the original alias file to get it out of the way
		mv "${f}" "${backups}/${f}"
		mkdir "${f}"  # create the _xojo_plugin folder
		# unzip directly from the original file (not the alias) to here
		yes | unzip -d "${f}" "${fTruePath}"
	else
		# this is not an alias file, handle it right here
		echo "FILE: ${f}"
		mv "${f}" "${backups}/${f}"
		mkdir "${f}"  # create the _xojo_plugin folder
		# unzip directly from the file in the backup folder to here
		yes | unzip -d "${f}" "${backups}/${f}"
	fi

  fi
  
  echo ""
  
done

Forum for Xojo Programming Language and IDE. Copyright © 2021 Xojo, Inc.