Skip to content

ianharrigan/haxe-maven-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

haxe-maven-plugin

Maven plugin to transpile haxe sources and output them for later consumption.

Often in complex projects it would be nice to insert Haxe. A perfect example of this is JavaScript. Using Haxe as a JavaScript replacement is a great way to write cleaner (type safe) code.

However, including these generated files into a project is at best ill advised and at worst not allowed (especially in corporate environments). A lot of corporate build systems use Maven for dependency resolution and automated builds. It is also very common that a build machine does not have Haxe installed.

This plugin address that by:

  • Downloading Node.js (used by lix)
  • Copying Haxe sources to an intermediate directory
  • Scaffolding a basic "lix" project
  • Installing "lix" locally
  • Building Haxe sources locally using "lix"
  • Copy the resulting output files

Basic usage (pom.xml):

  <build>
    <plugins>
      <plugin>
        <groupId>haxe.plugin</groupId>
        <artifactId>haxe-maven-plugin</artifactId>
        <version>1.0</version>
        <executions>
          <execution>
            <phase>compile</phase>
            <goals>
              <goal>transpile</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
            <!--
            <haxeVersion>latest</haxeVersion>
            <hxmlFile>build.hxml</hxmlFile>
            <mainClass>Main</mainClass>
            <outputDirectory>${project.basedir}/haxe-output</outputDirectory>
            -->
            <haxeTarget>cpp</haxeTarget>
            <classPaths>
                <classPath>src</classPath>
            </classPaths>
            <haxelibs>
                <haxelib>test</haxelib>
            </haxelibs>
            <compilerArgs>
                <compilerArg>--times</compilerArg>
            </compilerArgs>
            <compilerProps> <!-- -D abc -->
                <compilerProp>no-compilation</compilerProp>
            </compilerProps>
        </configuration>
      </plugin>
    </plugins>
  </build>

About

maven plugin for haxe transpilation

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages