Creating LiveCode applications that play well with git

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: Klaus, FourthWorld, heatherlaine, robinmiller, kevinmiller

Post Reply
trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 955
Joined: Sat Apr 08, 2006 3:06 pm
Location: Overland Park, Kansas
Contact:

Creating LiveCode applications that play well with git

Post by trevordevore » Sun Feb 05, 2017 5:08 am

For the last few months I've been developing an application framework for LiveCode applications that works well with version control software such as git. The framework encourages the use of as many text files as possible. Scripts are stored in script only stacks and all configuration is done with yaml files. Stacks used for UI are stored as binary so there is still some work to do in that area. I've also starting using Sublime Text as my editor of choice when working with LiveCode.

My ultimate goal is for the LiveCode community to have a viable option for creating applications managed with version control software, which can be worked on in teams, but that don't lose the "live" aspect of developing in LiveCode.

I've created a screencast where I show what I've been doing in case anyone is interested.

https://www.youtube.com/watch?v=e1p_FTRi1-Q

Here is the GitHub repository url the Levure framework:

https://github.com/trevordevore/levure
Trevor DeVore
ScreenSteps - http://www.screensteps.com

Levure Application Framework: https://github.com/trevordevore/levure
LiveCode Resources for Developers: http://livecode.bluemangolearning.com

dave.kilroy
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 858
Joined: Wed Jun 24, 2009 1:17 pm
Location: Plymouth, UK
Contact:

Re: Creating LiveCode applications that play well with git

Post by dave.kilroy » Sun Feb 05, 2017 4:36 pm

THIS . IS . REALLY . GREAT

Even better than Trevor's other thread http://forums.livecode.com/viewtopic.php?f=9&t=28784
"...this is not the code you are looking for..."

trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 955
Joined: Sat Apr 08, 2006 3:06 pm
Location: Overland Park, Kansas
Contact:

Re: Creating LiveCode applications that play well with git

Post by trevordevore » Sun Feb 05, 2017 10:44 pm

Glad you like it Dave.
Trevor DeVore
ScreenSteps - http://www.screensteps.com

Levure Application Framework: https://github.com/trevordevore/levure
LiveCode Resources for Developers: http://livecode.bluemangolearning.com

Simon Knight
Posts: 470
Joined: Wed Nov 04, 2009 11:41 am
Location: Gunthorpe, North Lincs, UK

Re: Creating LiveCode applications that play well with git

Post by Simon Knight » Wed Feb 08, 2017 9:23 am

Trevor,

A big THANKYOU for all your efforts in making and posting your videos. I have not yet used any version control tools and the only external editor I tried was tRev way back when,which had its problems. So I have set aside a few days to try Sublime text with your additions/plugins and then I might dare to look at this GIT thinghy.

I have managed to get the Livecode syntax colouring to work in sublimetext3 (copied your sublimetext folder down loaded from GIT into the app support folder: preferences->Browse packages) but have been unable to get the red dot errors to display. I gather from the video that "explicit variables" have to be turned on, but I do not know where this switch is in Sublimetext3 - can you shed some light?

Please keep making videos : I still frequently refer back to your GLX training video and talks given at RunRev09.

best wishes
Simon K
best wishes
Skids

Simon Knight
Posts: 470
Joined: Wed Nov 04, 2009 11:41 am
Location: Gunthorpe, North Lincs, UK

Re: Creating LiveCode applications that play well with git

Post by Simon Knight » Wed Feb 08, 2017 9:49 am

Re my question about syntax checking. I have listened hard to the video and now understand that you refer to a "linter" file rather than the odd sounding "Livecode winter" that I originally heard (Doh!).

I have googled linter and sublimetext3 and am now installing yet more gooodies from Trevor's Git repository. Am I correct in thinking that the LC IDE has to be running for it to work?

best wishes

Simon
(reset status to: novice)
best wishes
Skids

trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 955
Joined: Sat Apr 08, 2006 3:06 pm
Location: Overland Park, Kansas
Contact:

Re: Creating LiveCode applications that play well with git

Post by trevordevore » Wed Feb 08, 2017 2:12 pm

Hi Simon,

The github page for the linter (I think I prefer LiveCode winter, however) is here:

https://github.com/trevordevore/sublime ... vecodelint

You will find instructions for LiveCode server executable installation on the page. The server executable performs the syntax check so you don't have to have the IDE running. I borrowed the code for doing this from the Atom package. I don't know who wrote it originally. I would guess Monte or Peter.

One thing to note is that the instructions on the github page refer to using Package Control to install the linter. It isn't available in Package Control yet so you have to download and install the files from github. I've submitted the linter to the Sublime Linter folks but they haven't approved any new linters this year. Here is the issue I opened: https://github.com/SublimeLinter/Sublim ... issues/531. You can see that there are a number of other issues open regarding new linters.
Trevor DeVore
ScreenSteps - http://www.screensteps.com

Levure Application Framework: https://github.com/trevordevore/levure
LiveCode Resources for Developers: http://livecode.bluemangolearning.com

Simon Knight
Posts: 470
Joined: Wed Nov 04, 2009 11:41 am
Location: Gunthorpe, North Lincs, UK

Re: Creating LiveCode applications that play well with git

Post by Simon Knight » Wed Feb 08, 2017 5:25 pm

Hi Trevor,

Thanks for your reply. I believe that I now have the linter up and running and I can see why all the note recommend using the package installer.

For reference I had three problems with the install which are not all that clear in the various readme files:

1. Updating the user prefs. Be careful with where any brace characters are placed and expect to add one above the new entries followed by a comma e.g. }, . Thankfully the prefs are checked on save and an unhelpful error message is posted if there is an error. Beware that the last item in a group does not have a closing comma. Lastly note that when the file does finally save and you reopen it to check that there is a good chance that the section you have just typed has been moved.

2. The livecode community server has to be stored in usr/local/bin; I initially tried storing an alias but that did not work.

3. Following some experimentation I saved the folder "sublimelinter-contrib-livecodelint-master" inside Users/yourName/Library/Application Support/Sublime Text 3 / Packages it did not work when I tried ..... Sublime Text 3 / Installed Packages possibly because I had unzipped it.

Note that SublimeText 3 has a console that displays useful information if the linter is run with debug switched on.

good luck
Simon
best wishes
Skids

trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 955
Joined: Sat Apr 08, 2006 3:06 pm
Location: Overland Park, Kansas
Contact:

Re: Creating LiveCode applications that play well with git

Post by trevordevore » Wed Feb 08, 2017 6:11 pm

Thanks for the tips Simon! Hopefully the Sublime Linter folks will work through all of the contributions soon so the process will be smoother.
Trevor DeVore
ScreenSteps - http://www.screensteps.com

Levure Application Framework: https://github.com/trevordevore/levure
LiveCode Resources for Developers: http://livecode.bluemangolearning.com

Simon Knight
Posts: 470
Joined: Wed Nov 04, 2009 11:41 am
Location: Gunthorpe, North Lincs, UK

Re: Creating LiveCode applications that play well with git

Post by Simon Knight » Wed Feb 08, 2017 6:50 pm

Hi Trevor,

I have probably made "a schoolboy error" but I am unable to get the sample app in the levure download to work iaw the instructions. The button has no code and I can't see anywhere else where the mouse up is being actioned. Nothing happens when it is pressed.

Also an error is posted when I open the stack myApp. The preopen card throws an error as it can't find the library function.

Code: Select all

on preOpenCard
  set the text of field "Message" to "Hello Word" && the system date && the system time \
        & cr & myCustomLibraryFunction()
end preOpenCard


Any thoughts?

Simon K
best wishes
Skids

trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 955
Joined: Sat Apr 08, 2006 3:06 pm
Location: Overland Park, Kansas
Contact:

Re: Creating LiveCode applications that play well with git

Post by trevordevore » Wed Feb 08, 2017 8:03 pm

Simon Knight wrote:I have probably made "a schoolboy error" but I am unable to get the sample app in the levure download to work iaw the instructions. The button has no code and I can't see anywhere else where the mouse up is being actioned. Nothing happens when it is pressed.
Are you using LC 8 or higher? If not then do that. I just tested in 8.1.3 rc-1 and the sample app still works. All logic is in the "levureFramework" stack that is assigned as the behavior to the standalone.livecode stack. If the Run tool is selected then clicking on the button should load the app.
Simon Knight wrote:Also an error is posted when I open the stack myApp. The preopen card throws an error as it can't find the library function.

Code: Select all

on preOpenCard
  set the text of field "Message" to "Hello Word" && the system date && the system time \
        & cr & myCustomLibraryFunction()
end preOpenCard
That code will only work in the IDE if the app is loaded by clicking the button in the standalone.livecode stack. The library function is loaded by the Levure framework.

Let me know if any of the above helps you get up and running.
Trevor DeVore
ScreenSteps - http://www.screensteps.com

Levure Application Framework: https://github.com/trevordevore/levure
LiveCode Resources for Developers: http://livecode.bluemangolearning.com

Simon Knight
Posts: 470
Joined: Wed Nov 04, 2009 11:41 am
Location: Gunthorpe, North Lincs, UK

Re: Creating LiveCode applications that play well with git

Post by Simon Knight » Wed Feb 08, 2017 8:34 pm

How odd, I have tried both LC 9 and 8.1.3 RC1. I am using the arrow in the top left of the tools pallet which the hover text calls the Browse Tool.
I down loaded the zip file from GIT a second time and un packed it and tried again with the same results. I have taken some screen shots of the Levure folder and the livecode stack. I should add that I have a suspicion that there is a problem with my computer and LC as odd things occur from time to time especially when the stack structure gets complicated. Messages seem to get lost but I have never been able to reliably reproduce the problem for a bug report. I have put my Levure download in dropbox available on this link should you wish to confirm that it is correct : https://www.dropbox.com/s/ltmycow5tn5da ... 9.zip?dl=0

best wishes

Simon K
Attachments
Levure.clarify.zip
(145.7 KiB) Downloaded 60 times
best wishes
Skids

Simon Knight
Posts: 470
Joined: Wed Nov 04, 2009 11:41 am
Location: Gunthorpe, North Lincs, UK

Re: Creating LiveCode applications that play well with git

Post by Simon Knight » Wed Feb 08, 2017 9:12 pm

Hi again,

I have checked that the stack behavior is set and that the button code does not run when I follow these instructions:
# Try Out Sample Application

1. Open the `sample_app/standalone.livecode` stack in LiveCode 8+. The `framework/levureFramework.livecodescript` stack is a behavior of this stack.
2. Switch to the browser tool and click on the `Run Application` button.
3. The `MyApp` stack should open up and display some information in a field.
Next I load the framework, confirmed by viewing in the project browser and try the button - nothing happens but the edit script option does take me to the code of the framework.

Next I reset the stack behavior and the button starts to work.

Next I save the updated stack, quit and reload the stack standalone.livecode and the button is not working and this time the edit script button is greyed out and I am confused.

best wishes

Simon K
best wishes
Skids

trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 955
Joined: Sat Apr 08, 2006 3:06 pm
Location: Overland Park, Kansas
Contact:

Re: Creating LiveCode applications that play well with git

Post by trevordevore » Wed Feb 08, 2017 9:47 pm

I found the problem! The stackFiles property of the sample stack is set to the behavior file on my computer. That is why it always works for me :-)

Download the ZIP again. I just pushed a fix.
Trevor DeVore
ScreenSteps - http://www.screensteps.com

Levure Application Framework: https://github.com/trevordevore/levure
LiveCode Resources for Developers: http://livecode.bluemangolearning.com

Simon Knight
Posts: 470
Joined: Wed Nov 04, 2009 11:41 am
Location: Gunthorpe, North Lincs, UK

Re: Creating LiveCode applications that play well with git

Post by Simon Knight » Wed Feb 08, 2017 10:18 pm

Hi Trevor,

Yes the updated version works fine. Please would you expand on the error and the fix. Was the error caused by a hard coded name ? If so how is it entered given that the behavior field just displays the stack name and not its path.

Simon
best wishes
Skids

trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 955
Joined: Sat Apr 08, 2006 3:06 pm
Location: Overland Park, Kansas
Contact:

Re: Creating LiveCode applications that play well with git

Post by trevordevore » Wed Feb 08, 2017 10:22 pm

It was the stackfiles property. The behavior references the "levureFramework" stack. The stackfiles property of a stack tells the engine where it can find stacks that are being referenced using a short name. The stackfiles pane is the second pane from the left in the PI for a stack. The left column is the name of the stack in memory. The right pane is the file path where the stack file is located. The right column had a full path to the levureFramework.livecodescript stack on my computer. It was supposed to have a relative path.
Trevor DeVore
ScreenSteps - http://www.screensteps.com

Levure Application Framework: https://github.com/trevordevore/levure
LiveCode Resources for Developers: http://livecode.bluemangolearning.com

Post Reply

Return to “Talking LiveCode”