SamVerschueren / gulp-cordova

Documentation of gulp-cordova
40 stars 3 forks source link

Impossible to use android and ios plugin in the same process #10

Closed Bolik closed 8 years ago

Bolik commented 8 years ago

Hi, is it possible to use andoird and ios plugin in the same gulp pipe? It looks like the changes in process.env PWD produce incorrect behaviour. For example, gulp.src('dist') build incorrect relative path after calling android or ios plugin.

SamVerschueren commented 8 years ago

the android and plugin returns the apk files.

gulp.src('.cordova')
    .pipe(android())
    .pipe(gulp.dest('builds'));

will write the apk files in the builds directory. The iOS plugin does not do this but it should be refactored.

The best way of dealing with this I guess it writing multiple tasks.

gulp.task('create', () => {
    return gulp.src('dist')
        .pipe(create());
});

gulp.task('android', ['create'], () => {
    return gulp.src('.cordova')
        .pipe(android())
        .pipe(gulp.dest('apks'));
});

gulp.task('ios', ['create'], () => {
    return gulp.src('.cordova')
        .pipe(ios());
});

gulp.task('build', ['android', 'ios']);

I believe something like this should work.