moving _internal resolve image into standalone engine

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, LCMark

Post Reply
monte
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1558
Joined: Fri Jan 13, 2012 1:47 am
Contact:

moving _internal resolve image into standalone engine

Post by monte » Sun Sep 22, 2013 10:44 pm

Hi

I'm working on a CLI for lcVCS which loads the library and I was perplexed for hours why the script wasn't loading until I remembered _internal resolve image isn't in the standalone engine. Doh! (slaps head). Is there any chance I could move the command? I guess it would be possible for me to build a custom GPL standalone engine but at this stage I'm not positive the CLI will be GPL (the plugin is GPL). I also would prefer not to need to maintain a fork...

It's not like it's lots of code because most of the work is done by resolveimage which is already in all engines however when I originally wanted to implement it I had to move it to the IDE engine.

The purpose of the CLI is to be installed as post checkout,merge and rewrite git hooks for import. Export driven by a separate plugin hooking into the saving of a stack. Also as it's hard to know what object a file refers to in git status so the CLI can work out the long name of the object given a file. It can also be used for custom actions in SourceTree... not sure about other git gui's.

Cheers

Monte
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

monte
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1558
Joined: Fri Jan 13, 2012 1:47 am
Contact:

Re: moving _internal resolve image into standalone engine

Post by monte » Mon Sep 23, 2013 8:36 am

Just in case @runrevmark agrees this is worthwhile doing I've made the changes and sent the pull request: https://github.com/runrev/livecode/pull/258

Hopefully I'm not talking to myself...
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

monte
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1558
Joined: Fri Jan 13, 2012 1:47 am
Contact:

Re: moving _internal resolve image into standalone engine

Post by monte » Mon Sep 30, 2013 3:37 am

FYI my passing thought about possibly having a CLI for lcVCS as a commercial component has gone. It's just not going to be worth the trouble for the market size. Hopefully people will recognise what I'm trying to do is worthwhile and I'll get some donations or extra mergExt sales or something as a result but I doubt it...

So the whole thing will remain GPL & free. That means two things:
- I could maintain a fork of the engine to use for the CLI but I don't want to do that
- If it were possible to build a standalone against the IDE engine that would work for me and would bring in another interesting idea I've had which is to integrate the standalone builder and it's dependencies into lcvcs as it's being built so that I can add a command to build a standalone from a project. Ideally such a command could then be used on Travis CI etc. Does anyone know if it's possible to build a standalone with the IDE engine or what I'd need to do to make that possible? Hmm.. I guess it would only be able to build GPL projects though.
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

monte
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1558
Joined: Fri Jan 13, 2012 1:47 am
Contact:

Re: moving _internal resolve image into standalone engine

Post by monte » Mon Sep 30, 2013 7:26 am

I think I'm talking to myself here which is a shame... anyway, it looks like the way to create a standalone from the IDE engine is to encode your stack into startupstack.cpp and then build. Not complicated but not ideal. I spent a few minutes creating a startupstack.cpp decoder because the original stack isn't provided anywhere that I can see.

Code: Select all

on mouseUp
   answer file ""
   if it is empty then exit mouseUp
   put line 3 to -3 of url("file:"&it) into tData
   repeat for each item tItem in tData
      put numToChar(tItem) after tOut
   end repeat
   go stack decompress(tOut)
end mouseUp
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

LCMark
Livecode Staff Member
Livecode Staff Member
Posts: 961
Joined: Thu Apr 11, 2013 11:27 am

Re: moving _internal resolve image into standalone engine

Post by LCMark » Mon Sep 30, 2013 9:38 am

@monte: No problem with this - in fact, since _internal resolve image was added I dimly recall finding an enhancement request for this functionality so lcVCS aside there are probably other use-cases.

In regards to the 'startupstack.cpp' - this file is generated from src/Environment.rev and contains the code that presents the licensing dialog and processes licensing. The Environment stack is encoded with the encode_environment script. When the IDE engine starts up, it unpacks the embedded stack, sends the startup message, opens it, waits until it closes, then sends the shutdown message to it. The result after the shutdown message is sent is the stack that the IDE engine then loads to start the IDE.

monte
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1558
Joined: Fri Jan 13, 2012 1:47 am
Contact:

Re: moving _internal resolve image into standalone engine

Post by monte » Mon Sep 30, 2013 11:00 am

Yay you're back ;-)

I might not need to worry about the IDE engine then if you will accept resolve image. Still would be nice to have a command line standalone builder. Could we add that to Environment.rev?

Cheers

Monte
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

Post Reply

Return to “Engine Contributors”