node package manager

gulp-ice-builder

Ice Builder for Gulp

Gulp plug-in to automate the compilation of Slice files to JavaScript.

Install

$ npm install gulp-ice-builder --save-dev

gulp-ice-builder calls the slice2js compiler. You can install the latest slice2js with:

$ npm install slice2js --save-dev

Usage

var iceBuilder = require('gulp-ice-builder');
 
// Output directory 
var genDir = 'generated';
 
gulp.task('compile', function() {
    gulp.src('slice/*.ice')
        .pipe(iceBuilder.compile({dest:genDir}))
        .pipe(gulp.dest(genDir));
});

Options

args Array

The list of arguments passed to the slice2js compiler.

iceBuilder.compile({args: ["-Isrc/slice", "-DDEBUG"]})

For a full list of arguments you can pass to the slice2js compiler refer to slice2js.

dest String

The destination directory for your generated .js files.

iceBuilder.compile({dest: "js/generated"})

When this option is set, dependencies will be compunted and saved in .depend subdir, this avoid unnecessary recompilation of your Slice files. This directory must be the same as the directory used with gulp.dest().

exe String

The path to the slice2js executable.

iceBuilder.compile({exe: "/opt/zeroc-ice/bin/slice2js"})

If not set, the builder will search first for the npm package slice2js, and then for slice2js in your PATH.