{"size": 2714, "ext": "js", "max_stars_repo_path": "gulpfile.js", "max_stars_repo_name": "SovTech/React-Native-Version-Bump-Scripts", "max_stars_repo_stars_event_min_datetime": "2016-11-03T15:52:22.000Z", "max_stars_repo_stars_event_max_datetime": "2020-11-14T23:32:07.000Z", "max_issues_repo_path": "gulpfile.js", "max_issues_repo_name": "SovTech/React-Native-Version-Bump-Scripts", "max_issues_repo_issues_event_min_datetime": "2016-11-16T08:26:26.000Z", "max_issues_repo_issues_event_max_datetime": "2017-05-15T10:58:48.000Z", "max_forks_repo_path": "gulpfile.js", "max_forks_repo_name": "SovTech/React-Native-Version-Bump-Scripts", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 6, "max_issues_count": 2, "max_forks_count": null, "avg_line_length": 36.1866666667, "max_line_length": 157, "alphanum_fraction": 0.6436993368}
var gulp = require('gulp');
var bump = require('gulp-bump');
var exec = require('child_process').exec;

gulp.task('patch-bump', function () {
    gulp.src('./package.json')
        .pipe(bump())
        .pipe(gulp.dest('./'));
});

gulp.task('minor-bump', function () {
    gulp.src('./package.json')
        .pipe(bump({type: 'minor'}))
        .pipe(gulp.dest('./'));
});

gulp.task('major-bump', function () {
    gulp.src('./package.json')
        .pipe(bump({type: 'major'}))
        .pipe(gulp.dest('./'));
});

// Make sure the file is excutable before trying this or it won't work
gulp.task('patch-xcode-version-number-bump', function (cb) {
    exec('./xcode-patch-version-bump.sh', function (err, stdout, stderr) {
        console.log(stdout);
        console.log(stderr);
        cb(err);
    });
});

// Make sure the file is excutable before trying this or it won't work
gulp.task('minor-xcode-version-number-bump', function (cb) {
    exec('./xcode-minor-version-bump.sh', function (err, stdout, stderr) {
        console.log(stdout);
        console.log(stderr);
        cb(err);
    });
});

// Make sure the file is excutable before trying this or it won't work
gulp.task('major-xcode-version-number-bump', function (cb) {
    exec('./xcode-major-version-bump.sh', function (err, stdout, stderr) {
        console.log(stdout);
        console.log(stderr);
        cb(err);
    });
});

// Make sure the file is excutable before trying this or it won't work
gulp.task('bump-xcode-build-number', function (cb) {
    exec('./xcode-build-bump.sh', function (err, stdout, stderr) {
        console.log(stdout);
        console.log(stderr);
        cb(err);
    });
});

// Make sure the file is excutable before trying this or it won't work
// NB should not be run by itself or it will go a version ahead - designed to be run as part of bump-all-versions
gulp.task('sync-android-version-and-build-numbers', ['bump-xcode-build-number'], function (cb) {
    exec('./sync-android-version-build-numbers.sh', function (err, stdout, stderr) {
        console.log(stdout);
        console.log(stderr);
        cb(err);
    });
});

// Patches the package version number and bumps the ios and android build numbers but not version numbers
gulp.task('patch-all-versions', ['patch-bump', 'patch-xcode-version-number-bump', 'bump-xcode-build-number', 'sync-android-version-and-build-numbers']);

gulp.task('minor-bump-all-versions', ['minor-bump', 'minor-xcode-version-number-bump', 'bump-xcode-build-number', 'sync-android-version-and-build-numbers']);

gulp.task('major-bump-all-versions', ['major-bump', 'major-xcode-version-number-bump', 'bump-xcode-build-number', 'sync-android-version-and-build-numbers']);
