Giter VIP home page Giter VIP logo

coffee-maven-plugin's Introduction

Coffeescript Maven Plugin

Changes from 1.1.x versions: CoffeeScript files are joined together by default by JoinSets. JoinSets now contain Maven FileSets instead of listing Requires Java5 or above Creates a minified version using the Closure Compiler

USAGE:

Add the main plugin elements: groupId, artifactId, and version

<plugin>
  <groupId>com.theoryinpractise</groupId>
  <artifactId>coffee-maven-plugin</artifactId>
  <version>1.4.0</version>
</plugin>

Add the execution goal

<executions>
  <execution>
    <id>coffee</id>
    <goals>
      <goal>coffee</goal>
    </goals>
  </execution>
</executions>

Configure the destination of the resultant js files

<coffeeOutputDirectory>${project.build.directory}/coffee</coffeeOutputDirectory>

Specify bare (see coffeescript compiler documentation)

<bare>false</bare>

It can be tough to debug compilation errors with the files joined together. If you would like to compile the Files individually true

Finally, add JoinSets. The id of the joinSet will be the name of the resultant javascript file.

<coffeeJoinSets>
  <joinSet>
    <id>main</id>
    <coffeeOutputDirectory>${project.build.directory}/other-directory</coffeeOutputDirectory>
    <fileSet>
    </fileSet>
  </joinSet>
</coffeeJoinSets>

The output directory for an individual joinsets can also be overridden by setting inside the element.

Optionally, specify a minified file location. It defaults to: ${project.build.directory}/coffee/${project.artifactId}-${project.version}.min.js

Finally, you can specify a directory of files to minify into one file,

or a fileset of files to minify into one file

</setOfFilesToMinify>

An Example Build Section:

<build>
  <plugins>
    <plugin>
      <groupId>com.theoryinpractise</groupId>
      <artifactId>coffee-maven-plugin</artifactId>
      <version>1.3.1</version>

      <configuration>
         <minifiedFile>${project.build.directory}/coffee/${project.artifactId}-${project.version}.min.js</minifiedFile>
         <setOfFilesToMinify>
         	<directory>${project.build.directory}/coffee</directory>
         	<includes>
         		<include>*.js</include>
         	</includes>
         	<excludes>
         		<exclude>alternate.js</exclude>
         	</excludes>
         </setOfFilesToMinify>

         <version>1.1.3</version>
         <coffeeOutputDirectory>${project.build.directory}/coffee</coffeeOutputDirectory>
         <compileIndividualFiles>true</compileIndividualFiles>
         <coffeeJoinSets>
            <joinSet>
                <id>main</id>
                <fileSet>
                	<directory>${basedir}/src/main/coffee</directory>
                	<includes>
                		<include>**/*.coffee</include>
                	</includes>
                	<excludes>
                		<exclude>**/jointest3.*</exclude>
                	</excludes>
                </fileSet>
            </joinSet>
            <joinSet>
                <id>alternate</id>
                <fileSet>
                	<directory>${basedir}/src/main/coffee</directory>
                	<includes>
                		<include>**/jointest3.*</include>
                	</includes>
                </fileSet>
            </joinSet>
         </coffeeJoinSets>
      </configuration>

      <executions>
        <execution>
          <id>coffee</id>
          <goals>
            <goal>coffee</goal>
            <goal>minify</goal>
          </goals>
        </execution>
      </executions>

    </plugin>
  </plugins>
</build>

coffee-maven-plugin's People

Contributors

talios avatar danieldbower avatar thrykol avatar jonbca avatar pdunnavant avatar wpraet avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.