Skip to content
This repository has been archived by the owner on Jul 7, 2024. It is now read-only.

Dependencies

SquidDev edited this page Jan 5, 2015 · 6 revisions

A basic dependency tree looks like this:

local sources = Dependencies(CurrentDirectory)
sources:Main "Thing.lua"
	:Depends "Another"
sources:File "Another.lua"
	:Name "Another"

Dependency functions:

  • Main: sources:Main(path) Defines a 'core' file, one which is executed at the end of the combined file
  • File: sources:File(path) Defines a 'extension' file, which is executed in a sandbox.
  • Export: sources:Export(shouldExport) Set to true to use globals to store the files instead.
  • Combine: sources:Combine(outputFile) Combine the dependencies into one file.
  • Depends: sources:Depends(path or alias) Add a dependency to the main file
  • Prerequisite: sources:Prerequisite(path or alias) Add a prerequisite to the main file.

Options

Each file can use several options:

  • Depends: :Depends(path or alias) This file depends on another file
  • Prerequisite: :Prerequisite(path or alias) Append a dependency to the beginning of the list.
  • Name: :Name(name) The variable this file should be assigned to, this automatically sets the alias to.
  • Alias: :Alias(name) A name that can be used to refer to this file, cannot be used in conjunction with Name
  • Export: :Export(shouldExport) Slightly broken, used to define if the file should be exported from the resulting file or not.
  • NoWrap: :NoWrap(noWrap) Set to true to prevent the file being wrapped with _W(...) or do...end.
Clone this wiki locally