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 { task } from 'gulp';
|
||||||
import { accessSync } from 'fs';
|
import { accessSync } from 'fs';
|
||||||
import { join } from 'path';
|
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 cwd = join(PROJECT_ROOT, '../ionic-core');
|
||||||
const args = [
|
const args = [
|
||||||
'run',
|
'run',
|
||||||
'build.angular',
|
'build.angular'
|
||||||
SRC_ROOT,
|
|
||||||
DIST_BUILD_ROOT,
|
|
||||||
skipBuildingCore ? 'skip-core' : 'do-not-skip-core'
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
if (isDevAndWatch) {
|
||||||
|
args.push('--', 'dev', 'watch');
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
accessSync(cwd);
|
accessSync(cwd);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@ -35,6 +37,10 @@ function buildAngularBinding(skipBuildingCore: boolean, done: Function) {
|
|||||||
|
|
||||||
ls.stdout.on('data', (data) => {
|
ls.stdout.on('data', (data) => {
|
||||||
console.log(data.toString().trim());
|
console.log(data.toString().trim());
|
||||||
|
if (!hasRunDone && data.toString().trim().indexOf('compile, done') > -1) {
|
||||||
|
hasRunDone = true;
|
||||||
|
done();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
ls.stderr.on('data', (data) => {
|
ls.stderr.on('data', (data) => {
|
||||||
|
@ -23,8 +23,8 @@ task('e2e.watch', ['e2e.prepare', 'core.watch'], (done: Function) => {
|
|||||||
function serveTest(folderInfo: any) {
|
function serveTest(folderInfo: any) {
|
||||||
const testOrDemoName = folderInfo.componentName + '/' + folderInfo.componentTest;
|
const testOrDemoName = folderInfo.componentName + '/' + folderInfo.componentTest;
|
||||||
const ionicAngularDir = join(PROJECT_ROOT, 'src');
|
const ionicAngularDir = join(PROJECT_ROOT, 'src');
|
||||||
const coreCompilerFilePath = join(PROJECT_ROOT, 'dist', 'ionic-angular', 'compiler');
|
const coreCompilerFilePath = join(PROJECT_ROOT, '..', 'ionic-core', 'dist', 'compiler');
|
||||||
const coreDir = join(PROJECT_ROOT, 'dist', 'ionic-angular');
|
const coreDir = join(PROJECT_ROOT, '..', 'ionic-core', 'dist', 'compiled-ionic-angular');
|
||||||
const srcTestRoot = join(PROJECT_ROOT, 'src', 'components', folderInfo.componentName, 'test', folderInfo.componentTest);
|
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 distTestRoot = join(PROJECT_ROOT, 'dist', 'e2e', 'components', folderInfo.componentName, 'test', folderInfo.componentTest);
|
||||||
const includeGlob = [ join(ionicAngularDir, '**', '*.ts')];
|
const includeGlob = [ join(ionicAngularDir, '**', '*.ts')];
|
||||||
|
Reference in New Issue
Block a user