Project Files¶
A project file (.autoplay2c) holds your build settings: which project or Lua file to build, where
the results go, and every option on top of that. The application reads and writes them, and the
command line builds them:
A project file is JSON, in the same format the previous version of autoplay2c used. This means that a project file from the previous version works in this one, and the other way around (the previous version ignores the settings it doesn't know).
You'll rarely need to edit one by hand. Save it from the application, and keep it next to your project. Paths in it are relative to the project file's folder.
Example¶
{
"Paths": {
"AutoPlayFile": "MyProject.autoplay",
"OutputAutoPlayFile": "MyProject.a2c.autoplay",
"OutputModuleFile": "CD_Root\\AutoPlay\\Scripts\\core.dll",
"IsPlainLuaModule": false
},
"Names": { "OutputModuleName": "core" },
"ReplaceDataSegment": true,
"DataSegment": "data",
"Backend": "native",
"Outputs": ["lua"],
"ObjectSerializer": {
"SerializeObjects": true,
"GenerateTabOrder": true,
"ExcludeTypeMap": { "7": true },
"ExcludeNameMap": { "[Main]::[Logo]": true }
}
}
Settings¶
| Setting | Type | Description | Default |
|---|---|---|---|
Paths.AutoPlayFile |
string | The AutoPlay project, or the Lua file to build | Required |
Paths.IsPlainLuaModule |
boolean | true when AutoPlayFile is a Lua file |
false |
Paths.OutputModuleFile |
string | The module DLL | CD_Root\AutoPlay\Scripts\<module>.dll for a project, the Lua file with .dll otherwise |
Paths.OutputAutoPlayFile |
string | The rewritten project | The project with .a2c.autoplay |
Names.OutputModuleName |
string | The module name, the one require loads |
Made from the DLL's file name |
Target |
string | The target: ams8, ams9, suf9-x86, suf9-x64, suf10-x86 or suf10-x64 |
A project's own host; required for a Lua file |
ReplaceDataSegment |
boolean | Replace the data folder in strings | false |
DataSegment |
string | The data folder's new name | |
Backend |
string | native or c, see Backends |
native |
Outputs |
string list | Files to keep next to the DLL: lua, c, ir, asm |
None |
Diagnostics |
string | How much of the compilation log to report: warnings, missed, applied or all |
warnings |
Allow |
string list | Diagnostics not to report, by code or name, see Silencing | None |
GenerateIntermediateFiles |
boolean | The previous version's switch to keep the Lua and C source; used when Outputs is missing |
false |
ObjectSerializer |
object | Serialized objects, see below | Off |
VersionInformation |
object | Version information, see below | The default information |
Target, Backend, Outputs, Diagnostics and Allow are new in this version. Options you give
on the command line win over the settings in the file; --allow adds to Allow. Read more in Building.
Outputs¶
| Name | What it keeps | Notes |
|---|---|---|
lua |
The module's Lua source (<module>.intermediate.lua) |
Projects only. Run-time errors name lines in this file. |
c |
The module as C source | |
ir |
The compiler's intermediate code | For the curious |
asm |
The machine code, disassembled | For the curious |
ObjectSerializer¶
| Setting | Type | Description |
|---|---|---|
SerializeObjects |
boolean | Create the objects at run time |
GenerateTabOrder |
boolean | Emulate the tab order |
ExcludeTypeMap |
object | Kinds to keep in the project, by number: { "7": true } keeps every input |
ExcludeNameMap |
object | Objects to keep in the project: { "[Main]::[Logo]": true } |
The object kinds by number are 0 button, 1 label, 2 paragraph, 3 image, 4 flash, 5 video, 6 web, 7 input, 8 hotspot, 9 list box, 10 combo box, 11 progress, 12 tree, 13 radio button, 14 rich text, 15 check box, 16 slideshow, 17 grid, 18 PDF, 19 QuickTime, 20 xButton and 40 object plugin.
VersionInformation¶
Each field is an object with its value in State, the way the previous version wrote them. The
other keys in these objects (Input, CheckBox) belong to the previous version, and they're kept
as they are.
| Setting | Value in State |
|---|---|
ReplaceVersionInformation |
true to use the fields below |
ReplaceInternalNames |
true to use InternalName and OriginalFilename |
FileVersion, ProductVersion |
{ "d1": 1, "d2": 2, "d3": 0, "d4": 15 } |
CompanyName, ProductName, FileDescription, LegalCopyright, LegalTrademarks, PrivateBuild, SpecialBuild, Comments, InternalName, OriginalFilename |
Text |
"VersionInformation": {
"ReplaceVersionInformation": { "State": true },
"FileVersion": { "State": { "d1": 1, "d2": 2, "d3": 0, "d4": 15 } },
"CompanyName": { "State": "Imagine Programming" }
}
Technical details
- A project file is read as UTF-8, or as Windows-1252 when it isn't valid UTF-8 (the previous version wrote Windows-1252).
- Saving keeps the settings the application doesn't show, so nothing the previous version wrote is lost.
- When the application saves a project file that keeps the C or Lua source, it also sets
GenerateIntermediateFiles, so the previous version keeps them too. - Paths are saved with
\separators. On Linux and macOS they're read with/.