code icon indicating copy to clipboard operation
code copied to clipboard

Allow development builds and stable builds to be installed simultaneously

Open colinkiama opened this issue 1 year ago • 4 comments
trafficstars

Problem

When working on elementary Code in elementary Code, you currently need to restart the app whenever you build to see the latest changes.

For people who primarily use elementary Code as their code editor, you lose time restarting the app whenever you would like to preview your changes. Some changes may break the app and will result you in having to use another editor application or revert your changes to get the elementary Code working again.

Proposal

Set the development option in meson to true by default and use a different ID, icon and name to differentiate between stable builds and development builds.

Prior Art (Optional)

GNOME apps for example:

colinkiama avatar Mar 31 '24 20:03 colinkiama

I hard-coded a different app id in the Files Gtk4 branch but this sound more elegant.

jeremypw avatar Apr 01 '24 17:04 jeremypw

My suggestion for implementing this is for the main executable to be just a thin wrapper that launches the default build. For example: $>code could launch /bin/code which in turn would launch /bin/code-bin/code-rel while $>code --use=dev would launch /bin/code --use=dev which in turn would launch /bin/code-bin/code-dev. Any time you create a release you just make a copy of code-dev as code-rel. No complications as a result.

Edit: For distinguishing between code-rel and code-dev during runtime you could just load /proc/self/cmdline I think it was.

awsdert avatar Apr 17 '24 08:04 awsdert

You can run a different uninstalled branch of Code by editing meson-options.txt and changing the option development to default to true. If you have the installed (master) version of code already running then launching the rebuilt version of Code from the build directory should open another window . If you enter Multitasking View (<Super>Down) and hover of the Code windows you will see they have different app ids.

To be able to install two version you would have to temporarily change the meson project name so that the executables etc are distinct. However you could end up with lots of versions that would be a pain to uninstall. You could try changing the install directory too I guess. Not sure how much of this could (or should) be automatic.

Be aware that uninstalled versions of Code would use the master versions of any plugins so this method would not be suitable if you were developing a plugin.

jeremypw avatar Oct 09 '24 16:10 jeremypw