Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

SDK Use- OUTLAW --> Sublime Text 3 ; Sharing common code problem
Started by IBMHursley1964 Aug 30 2019 11:50 AM

- - - - -
4 replies to this topic
outlaw sdk sublime text 3
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

IBMHursley1964

[GLOBAL: userInfoPane.html]
IBMHursley1964
  • Enthusiast

  • 33 posts
  • Corona SDK

I have just returned to do some App coding after about a year away not coding.

 

I used to use a really easy to use SDK called 'OUTLAW' by J Whye. That is not working or accessible any more (?).

 

So I have been looking through the forums at what people have been using.  I have settled on Sublime Text 3 (ST3) .

 

I have got ST3 running and editing and testing ok, fantistic.... until I try sharing common code files across different projects.

 

I cannot get the projects to work without actually copying the shared code into the same project folder.

This used to be straight forward and no problem on 'OUTLAW', but I am missing something but cannot see what might be stopping me share code across ST3.

 

I have tried adding folders to project and they get included and can be edited but when I run the Corona Simulator they fail with ...Module 'Utilities.xx' not found:   no field package.preload['Utilities.xx']

 

This is the Lua Corona line that fails... [Note it works fine if the utilities folder is within the main.lua folder as well , but not in a different folder when added to the project.]

 

local p= require "Utilities.xx" -- utilities for cross app use -
 

I have checked the project file and the Path command looks reasonable. Any suggestions of what might be the problem would be very much welcomed

Thanks

 

--------------

 

{
    "folders":
    [
        {
            "path": "/Users/MyNewMacbook/Documents/iPAD Apps/iPs NEW CODE/Trends/Main Files/Utilities"
        },
        {
            "path": "."
        }
    ]
}

 



[TOPIC: post.html]
#2

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,615 posts
  • Enterprise

I don't know what OUTLAW was doing, but Corona by itself, doesn't know how to look outside of its sandbox. This goes to the mobile heritage of Corona. The folder with main.lua is system.ResourceDirectory (and on Android, it's not even a directory, but a .zip file that Android extracts files from as needed) Therefore Corona can't follow any paths that go to a parent, grandparent or sibling folders because they won't exist on device.

 

The closest thing Corona has to this is our Plugin system, but to host your own plugins is a $499 upcharge or you have to submit it to the Marketplace and plan to maintain it. Plugins let you download modules (Lua, C++, Java, etc.) at build time.

 

The best thing to do, if you have a core set of Libraries, is to simply copy them to a new project when you start. Sublime Text isn't going to have a solution for this. But that said, Sublime Text has the ability to be extended and add a lot of features to it. I think it uses Python as its scripting language. But doing so is well beyond anyone at Corona to even think about.

 

Rob



[TOPIC: post.html]
#3

IBMHursley1964

[GLOBAL: userInfoPane.html]
IBMHursley1964
  • Enthusiast

  • 33 posts
  • Corona SDK

Thanks Rob,

I feel now I have been working in a totally different Paradgm for years and thought this was an accepted way of all SDk's. Obviuosly not.

 

I am not sure how Outlaw managed this, but can only guess it merged all folders into some form of intermedary temp file/folder and passed that onto the Corona for its sandbox... Just a guess based on your feedback of how Corona views the world.

 

It is simple to copy core libraries into a new project, but that becomes a code level mangement problem as you go from project a,b,c and so on and then find  a bug in the libraries at say project K . After fixing, the need to go back to all projects, remove and re-copy in the libraries and then recompile. Using common shared libraries in the past it was just a matter of automatic recomplie all projects.

I just felt that the ST3 path keyword would have done this; so now dont understand why st3 has the path keyword, but no matter I will conitinue copying in the common libraries and try to remember if in a project and change libraries I need to retrace steps on other projects to incorprate the updates. I feel I  have gone back 40 years in management of development level control...



[TOPIC: post.html]
#4

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,615 posts
  • Enterprise

I think the solution to this may be a much simpler approach. Use a source control system. I would recommend git and its counterpart GitHub. GitHub is free for individuals and you can keep the repositories private. Make a repo for your utilities library and store it on github. Then in your individual projects, you can clone the repo (using either command line based "git" commands or with the GitHub Desktop.

 

When you need to update the common core, you can update the repo on GitHub and then go into your project and from the command line do a "git pull" and it will update the local version in your project with the master on GitHub. Then if you want to update the master, edit it in it's own folder, do a "git commit -m "commit message, what changes you made" and a "git push -u" or something like that.

 

There may be git utilities that work in sublime that can automate some of this for you, or GitHub desktop will show you when you have repos that you're following that have changes that need pulled and you have a one button click to pull them.  Multiple clones on your computer may confuse GitHub Desktop so you might need to give them something so you know you have to pull the changes multiple times for different projects.

 

Source control like Git and Mercurial are designed to allow multiple developers to collaborate. in your case you're the multiple developers. If you fix something in your library for Game B you could push those changes back to the main repo then go to Game A and pull the changes.

 

It's probably something worth considering. 

 

Rob



[TOPIC: post.html]
#5

IBMHursley1964

[GLOBAL: userInfoPane.html]
IBMHursley1964
  • Enthusiast

  • 33 posts
  • Corona SDK

Thanks Rob,

I will have a look at Github . I had over looked that. I did try a bit of macOS Automator but that was getting too much for me.

 

Much appreciated for your time and suggestions.

 

Alec




[topic_controls]
[/topic_controls]

Also tagged with one or more of these keywords: outlaw, sdk, sublime text 3