-
-
Notifications
You must be signed in to change notification settings - Fork 319
Lua Dev Environment
Clone the WeakAuras repository anywhere, using your favorite Git Repository app with the URL https://github.com/WeakAuras/WeakAuras2.git
, or use this command in your favorite CLI:
git clone https://github.com/WeakAuras/WeakAuras2.git
Note: we don't recommend cloning the repository anywhere in the World of Warcraft folder directly. See below for directions on how to load your dev environment in World of Warcraft.
WeakAuras source code (with one exception) does not have any external libraries checked directly into the repository. Thus you will need to get these libraries and drop them into ./WeakAuras/Libs/
manually. The simplest way to do this is to download a packaged release (e.g. from one of these links), and copy the libraries from there into your repository.
In order to load your working copy of WeakAuras in WoW, you will need to have the addon "installed" just like if you install any addon in WoW. Fortunately this is fairly simple to set up by creating directory symbolic links in Interface/Addons/ which points to each of the addons in this repository. You will need to create 4 such symlinks for WeakAuras for Retail WoW, and 2 for WeakAuras Classic:
- WeakAuras
- WeakAurasOptions
- WeakAurasTemplates (Retail only)
- WeakAurasModelPaths (Retail only)
Windows:
> mklink /d "path\to\World of Warcraft\_retail_\Interface\Addons\WeakAuras" "path\to\repository\WeakAuras"
symbolic link created for WeakAuras <<===>> path\to\repositoy\WeakAuras
This step is optional, and is helpful only if you intend on developing for both WeakAuras Retail and WeakAuras Classic. Since we do not ship the same code for these versions of WeakAuras, the setup is slightly different. Happily, git has a feature which was developed for just this kind of scenario, git-worktree:
# in your WeakAuras repository:
git worktree add ../WeakAuras-classic
This will create a new worktree which is attached to the same repository. You can now set this worktree up for Classic development, while still having your original worktree set up for Retail development. Git operations such as push, pull, add, rm, commit all work exactly as you'd normally expect, with the one exception that git switch
may sometimes fail if the branch you are switching to is already checked out on a different worktree. git switch --ignore-other-worktrees
may be used to override this.
There are of course several good editors out there for Lua development, but we suggest using Atom or Visual Studio Code since they have tons of good plugins available for Lua/WoW dev.
Luacheck, which also serves as a static analyzer, is the Lua Linter to use and WeakAuras comes with a .luacheckrc
config file that tells it what to look for and it will point out any mistakes you may make.
You can download a statically linked binary with all deps included from here and put it somewhere on your PATH
.
- Base Linter
- Plugins:
- Base Linter: Not needed.
- Plugins:
- For Luacheck: Not needed, comes with vscode-lua.
- Home
- API Documentation
- Getting Involved
- Setting up a Lua Dev Environment
- Deprecations
- Useful Snippets
- Aura Types
- Trigger Types
- Triggers and Untriggers
- Aura Activation
- Dynamic Information
- Text Replacements