Add a task for building templates
This commit is contained in:
parent
68378b1e86
commit
6c72e6200f
|
@ -45,6 +45,16 @@ export class Settings
|
||||||
*/
|
*/
|
||||||
private stylePath = "css";
|
private stylePath = "css";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The path to the root of the template-source.
|
||||||
|
*/
|
||||||
|
private templateSource = "Templates";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The path to save the templates to.
|
||||||
|
*/
|
||||||
|
private templatePath = "templates";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The path to the test-directory.
|
* The path to the test-directory.
|
||||||
*/
|
*/
|
||||||
|
@ -172,6 +182,34 @@ export class Settings
|
||||||
return this.RootPath(this.stylePath, ...path);
|
return this.RootPath(this.stylePath, ...path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a path relative to the root of the template-source.
|
||||||
|
*
|
||||||
|
* @param path
|
||||||
|
* The path to join.
|
||||||
|
*
|
||||||
|
* @returns
|
||||||
|
* The joined path.
|
||||||
|
*/
|
||||||
|
public TemplateSource(...path: string[])
|
||||||
|
{
|
||||||
|
return this.SourceRoot(this.templateSource, ...path);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a path relative to the directory to save the templates to.
|
||||||
|
*
|
||||||
|
* @param path
|
||||||
|
* The path to join.
|
||||||
|
*
|
||||||
|
* @returns
|
||||||
|
* The joined path.
|
||||||
|
*/
|
||||||
|
public TemplatePath(...path: string[])
|
||||||
|
{
|
||||||
|
return this.RootPath(this.templatePath, ...path);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a path relative to the test-directory.
|
* Creates a path relative to the test-directory.
|
||||||
*
|
*
|
||||||
|
|
15
gulpfile.ts
15
gulpfile.ts
|
@ -157,7 +157,8 @@ export async function Build()
|
||||||
await Promise.all(
|
await Promise.all(
|
||||||
[
|
[
|
||||||
Library(),
|
Library(),
|
||||||
Theme()
|
Theme(),
|
||||||
|
Templates()
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -315,6 +316,18 @@ export async function Theme()
|
||||||
|
|
||||||
Theme.description = "Builds the theme.";
|
Theme.description = "Builds the theme.";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Builds the templates.
|
||||||
|
*/
|
||||||
|
export function Templates()
|
||||||
|
{
|
||||||
|
return gulp.src(
|
||||||
|
settings.TemplateSource("**")).pipe(
|
||||||
|
gulp.dest(settings.TemplatePath()));
|
||||||
|
}
|
||||||
|
|
||||||
|
Templates.description = "Builds the templates.";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stops a watch-task.
|
* Stops a watch-task.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in a new issue