mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 12:29:55 +08:00
chore(scripts): update build
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
import { SRC_ROOT, DIST_BUILD_ROOT, PROJECT_ROOT } from '../constants';
|
||||
import { PROJECT_ROOT } from '../constants';
|
||||
import { task } from 'gulp';
|
||||
import { accessSync } from 'fs';
|
||||
import { join } from 'path';
|
||||
@ -13,16 +13,18 @@ task('core.watch', (done) => {
|
||||
});
|
||||
|
||||
|
||||
function buildAngularBinding(skipBuildingCore: boolean, done: Function) {
|
||||
function buildAngularBinding(isDevAndWatch: boolean, done: Function) {
|
||||
let hasRunDone = false;
|
||||
const cwd = join(PROJECT_ROOT, '../ionic-core');
|
||||
const args = [
|
||||
'run',
|
||||
'build.angular',
|
||||
SRC_ROOT,
|
||||
DIST_BUILD_ROOT,
|
||||
skipBuildingCore ? 'skip-core' : 'do-not-skip-core'
|
||||
'build.angular'
|
||||
];
|
||||
|
||||
if (isDevAndWatch) {
|
||||
args.push('--', 'dev', 'watch');
|
||||
}
|
||||
|
||||
try {
|
||||
accessSync(cwd);
|
||||
} catch (e) {
|
||||
@ -35,6 +37,10 @@ function buildAngularBinding(skipBuildingCore: boolean, done: Function) {
|
||||
|
||||
ls.stdout.on('data', (data) => {
|
||||
console.log(data.toString().trim());
|
||||
if (!hasRunDone && data.toString().trim().indexOf('compile, done') > -1) {
|
||||
hasRunDone = true;
|
||||
done();
|
||||
}
|
||||
});
|
||||
|
||||
ls.stderr.on('data', (data) => {
|
||||
|
@ -23,8 +23,8 @@ task('e2e.watch', ['e2e.prepare', 'core.watch'], (done: Function) => {
|
||||
function serveTest(folderInfo: any) {
|
||||
const testOrDemoName = folderInfo.componentName + '/' + folderInfo.componentTest;
|
||||
const ionicAngularDir = join(PROJECT_ROOT, 'src');
|
||||
const coreCompilerFilePath = join(PROJECT_ROOT, 'dist', 'ionic-angular', 'compiler');
|
||||
const coreDir = join(PROJECT_ROOT, 'dist', 'ionic-angular');
|
||||
const coreCompilerFilePath = join(PROJECT_ROOT, '..', 'ionic-core', 'dist', 'compiler');
|
||||
const coreDir = join(PROJECT_ROOT, '..', 'ionic-core', 'dist', 'compiled-ionic-angular');
|
||||
const srcTestRoot = join(PROJECT_ROOT, 'src', 'components', folderInfo.componentName, 'test', folderInfo.componentTest);
|
||||
const distTestRoot = join(PROJECT_ROOT, 'dist', 'e2e', 'components', folderInfo.componentName, 'test', folderInfo.componentTest);
|
||||
const includeGlob = [ join(ionicAngularDir, '**', '*.ts')];
|
||||
|
Reference in New Issue
Block a user