NetLinx Compile

netlinx-compile

A wrapper utility for the AMX NetLinx compiler.

This library provides an executable, netlinx-compile, that wraps the nlrc.exe NetLinx compiler provided by AMX. It is designed for easier command line access, as well as for integration with third-party tools with source code build support, like text editors and IDE's. Also provided in this library is a Ruby API for invoking the NetLinx compiler.

Upgrade Notice

AMX has broken NetLinx compilier functionality between NLRC.exe v1.0 (distributed with NetLinx Studio v3.x) and NLRC.exe v2.1 (distributed with NetLinx Studio 4). NLRC.exe v2.x was distributed with NetLinx Studio 4 versions less than 4.1.1204, and has major problems. It is recommended to avoid NLRC.exe v2.x. NLRC.exe v3.x started being distributed in NetLinx Studio v4.1.1204 and appears to have fixed the problems when compiling include and Duet files. Due to the major changes in the NetLinx compiler, it may be necessary to use version 1.x of netlinx-compile when working with projects created with NetLinx Studio v3.x or earlier.

  • Version 1.x of netlinx-compile targets NLRC.exe v1.x.

  • NLRC.exe v2.x is considered broken and is unsupported by netlinx-compile.

  • Version 3.x of netlinx-compile targets NLRC.exe v3.x.

AMX NetLinx Compiler Bug List

Installation

netlinx-compile is available as a Ruby gem.

  1. Install Ruby 2.0 or higher (For Windows use RubyInstaller and make sure ruby/bin is in your system path.)

  2. Open the command line and type:

gem install netlinx-compile
    gem install netlinx-workspace (optional: for NetLinx Studio workspace support)

NOTE: The NetLinx compiler executable provided by AMX, nlrc.exe, must be installed on your computer for this utility to work. It is included in the NetLinx Studio installation by default.

If you receive the following error when running gem install: Unable to download data from https://rubygems.org/ - SSL_connect returned=1

Follow this guide: Workaround RubyGems’ SSL errors on Ruby for Windows (RubyInstaller)

Issues, Bugs, Feature Requests

Any bugs and feature requests should be reported on the GitHub issue tracker:

github.com/amclain/netlinx-compile/issues

Pull requests are preferred via GitHub.

Use

Sublime Text Editor

NetLinx Compile can be integrated into Sublime Text with the Sublime Text AMX NetLinx Plugin. This allows NetLinx source code and workspaces to be compiled with the editor's built-in build commands.

Command Line

NetLinx Compile provides friendlier command line access than the traditional NetLinx compiler provided by AMX. For starters, files can now be entered by relative path (my_file.axs) as well as absolute path (c:\path\to\my_file.axs). A more advanced feature, workspace compiling, can invoke the NetLinx compiler on a workspace file, as well as intelligently seek out a workspace for a given source code file.

Compile a source code file.

netlinx-compile -s my_source_code.axs

Compile a workspace (with NetLinx Workspace installed).

netlinx-compile -s my_workspace.apw

Find the workspace that contains my_source_code.axs and compile it.

netlinx-compile -w -s my_source_code.axs

Print all of the option flags and their descriptions.

netlinx-compile -h

Ruby Developer API

A Ruby API is provided for developers looking to integrate the NetLinx Compile library into thier own tools. NetLinx Compile Developer Documentation

NetLinx Compile supports the ability to invoke the compiler on third-party files, like when creating new types of workspaces. To add NetLinx Compile support to your Ruby gem, create a handler for your file extension under the namespace NetLinx::Compile::Extension, place the .rb file under lib/netlinx/compile/extension in your gem, and add a dependency or development dependency in your gemspec to the netlinx-compile gem. NetLinx Compile will now automatically use your gem to compile the file extension it specifies. This is implemented in NetLinx::Compile::Extension::AXS, as well as in the NetLinx Workspace gem.