Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "LDT/User Area/Execution Environment file format"
Line 21: | Line 21: | ||
** <code>docs/</code> | ** <code>docs/</code> | ||
*** <code>index.html</code> | *** <code>index.html</code> | ||
− | ** <code>*. | + | ** <code>*.rockspec</code> |
<code>api.zip</code> is a regular ZIP archive containing Lua API files written with the [[Koneki/LDT/Technical_Discussions/Documentation_Language| right format]].<br> | <code>api.zip</code> is a regular ZIP archive containing Lua API files written with the [[Koneki/LDT/Technical_Discussions/Documentation_Language| right format]].<br> | ||
Line 30: | Line 30: | ||
<code>docs</code> is a ''folder'' containing <code>html</code> documentation files. <code>index.html</code> is the file opened by LDT when user ask for EE documentation. (see [[Koneki/LDT/User_Area/LuaDocumentor|LuaDocumentor]]) | <code>docs</code> is a ''folder'' containing <code>html</code> documentation files. <code>index.html</code> is the file opened by LDT when user ask for EE documentation. (see [[Koneki/LDT/User_Area/LuaDocumentor|LuaDocumentor]]) | ||
− | <code>*. | + | <code>*.rockspec</code> enable to specify information about an EE, it is strongly inspired by the [http://luarocks.org/en/Rockspec_format Rockspec format]. So far, following fields have been added to match LDT needs: |
*<code>api</code> | *<code>api</code> | ||
*<code>documentation</code> | *<code>documentation</code> |
Revision as of 20:23, 22 September 2012
Execution Environment
An Execution Environment, which may also be referred to as EE, is file containing information about the environment on which a lua application will be executed.
So, If you want enable some IDE features (autocompletion, code documentation, ...) for a given execution environment (Lua 5.1, Corona, mihini, Gideros, ...) you can create your own custom EE, there are just a few rules to follow the type of the file and its inner structure.
You could share your execution environment here.
Since 0.9M2: When a new Lua Project is created, a default main.lua is also created which is containing some code. As this code can be dependent of the Execution Environment associated with the project. It's now possible to add default main.lua in your Execution Environment. So when a project is created using an Execution Environment the created project is filled using the Execution Environment's main.lua file.
File format
An EE is simply a regular .zip file.
File structure
To be a valid EE, a ZIP file root must respect the following tree structure.
-
/
-
api.zip
-
docs/
-
index.html
-
-
*.rockspec
-
api.zip
is a regular ZIP archive containing Lua API files written with the right format.
You could generate these api files from your source code (lua and C) with LuaDocumentor command line tool.(perhaps one day LuaDocumentor will be able to generate the complete execution environment)
Note: All the globals variable your will defined in global.lua will be considered as preloaded global variables, this means they will be always available in LDT autocompletion.
docs
is a folder containing html
documentation files. index.html
is the file opened by LDT when user ask for EE documentation. (see LuaDocumentor)
*.rockspec
enable to specify information about an EE, it is strongly inspired by the Rockspec format. So far, following fields have been added to match LDT needs:
api
documentation
flags
template
main.lua
You may have noticed that api.file
is set to 'api.zip'
and documentation.dir
to 'docs'
. Do not change those values in the *.rockspec you write, it will have no effect.
As I am writing, all parameters are hard coded, except:
-
package
-
version
It is temporary, we will soon handle all *.rockspec settings. This why you must write valid *.rockspec to be compliant with up coming versions of LDT.
Since 0.9M2:
template
main.lua
If a new Lua Project is created using the Execution Environment, the created project will be filled using the given main.lua. As this file is opptional, if the main.lua file is not found in the Execution Environment, the project will be filled with a lua generic main.lua.
A sample of EE manifest
package = "lua"
version = "5.1"
flags = { ee = true }
description = {
summary = "Lua 5.1 Execution Environment",
detailed = [[ Lua 5.1 Execution Environment Support]],
licence = "MIT",
homepage= "http://www.lua.org/manual/5.1/manual.html"
}
api = {
file = "api.zip"
}
documentation ={
dir="docs"
}