2017-07-09 01:19:07 -05:00
|
|
|
import {sync as glob} from 'glob';
|
2018-11-02 22:38:34 +01:00
|
|
|
import {task} from 'gulp';
|
2018-01-25 19:56:49 +01:00
|
|
|
import {buildConfig} from 'material2-build-tools';
|
2017-07-09 01:19:07 -05:00
|
|
|
import * as path from 'path';
|
2018-11-02 22:38:34 +01:00
|
|
|
import {generateExampleModule} from '../../example-module/generate-example-module';
|
2018-01-25 19:56:49 +01:00
|
|
|
|
2017-07-09 01:19:07 -05:00
|
|
|
const {packagesDir} = buildConfig;
|
|
|
|
|
|
|
|
|
|
/** Path to find the examples */
|
|
|
|
|
const examplesPath = path.join(packagesDir, 'material-examples');
|
|
|
|
|
|
|
|
|
|
/** Output path of the module that is being created */
|
|
|
|
|
const outputModuleFilename = path.join(examplesPath, 'example-module.ts');
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Creates the examples module and metadata
|
|
|
|
|
*/
|
|
|
|
|
task('build-examples-module', () => {
|
2018-11-02 22:38:34 +01:00
|
|
|
generateExampleModule(glob(path.join(examplesPath, '**/*.ts')), outputModuleFilename);
|
2017-07-09 01:19:07 -05:00
|
|
|
});
|