My Codea Libraries

loopspace

2014-06-13

Creative Commons License

Contents

  1. Home

  2. 1. Introduction

  3. 2. Instructions

1 Introduction

With the advent of the Codea Community project, code sharing in Codea got a whole lot easier. However, my larger projects use a slightly complicated system of libraries that works outside of Codea's dependency mechanism and so it doesn't work automatically with Codea Community. These are the instructions on how to get one of these projects working.

2 Instructions

The first thing to do is work out whether or not the particular project uses my libraries. This will be the case if early in the setup function there is a line:



cmodule "<projectname>"

where <projectname> is the name of the project. If this is the case, then it uses one or more of my libraries.

The libraries are all available on Codea Community. I have divided them into distinct projects for ease of maintenance. The libraries are:

The other project that is needed is toadkick's cmodule library. This handles loading tabs from various projects without needing to add them as a dependency, and ensures that modules don't mess with the global table. I use this as it means that when I load a library, I only need to load the actual modules that I use. I've loaded this to Codea Community to make it possible to download.

It doesn't matter what you call these projects, but you'll need to remember what you called them. Then in one of my projects that uses this system, you need to do the following:

  1. Change the <projectname> in the line

    
    
    cmodule "<projectname>"
    

    to the name that you saved this project to.

  2. Change the list of projects in the line

    
    
    cmodule.path("<library>", "<library>", ...)
    

    to whatever you named the libraries too. It's only necessary to list the corresponding projects, but there is no harm in listing the whole lot.

  3. Add the cmodule project as a dependency (whatever you called it).