{"size": 1306, "ext": "js", "max_stars_repo_path": "gulpfile.js", "max_stars_repo_name": "takumif/riichi-mahjong", "max_stars_repo_stars_event_min_datetime": "2017-04-14T11:55:58.000Z", "max_stars_repo_stars_event_max_datetime": "2017-04-14T11:55:58.000Z", "max_issues_repo_path": "gulpfile.js", "max_issues_repo_name": "takumif/riichi-mahjong", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "gulpfile.js", "max_forks_repo_name": "takumif/riichi-mahjong", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 25.6078431373, "max_line_length": 77, "alphanum_fraction": 0.4977029096}
/// <reference path="typings/index.d.ts" />

var gulp = require("gulp");
var ts = require("gulp-typescript");
var typedoc = require("gulp-typedoc");
var jasmine = require("gulp-jasmine");
var merge = require("merge2");

gulp.task("build", function () {
    var tsProject = ts.createProject("tsconfig.json", { declaration: true });
    var tsResult = tsProject
        .src()
        .pipe(ts(tsProject));
    merge([
        tsResult.dts.pipe(gulp.dest("dist")),
        tsResult.js.pipe(gulp.dest("dist"))
    ]);
});

gulp.task("typedoc", function() {
    gulp
        .src(["src/**/*.ts"])
        .pipe(typedoc({
            module: "commonjs",
            target: "es5",
            out: "docs/",
            name: "Riichi Mahjong"
        }));
});

gulp.task("test", function() {
    setTimeout(() => {
        gulp
            .src([
                "test/test-hand.js",
                "test/test-meld.js",
                "test/test-parser.js",
                "test/test-scorer.js",
                "test/test-tile.js",
                "test/test-yaku.js"
            ])
            .pipe(jasmine());
    }, 100);
});

gulp.task("watch", function() {
    gulp.watch("src/**/*.ts", ["build", "typedoc"]);
})

gulp.task("default", ["build", "test"]);
gulp.task("all", ["build", "typedoc", "test"]);