@@ -10,7 +10,6 @@ import * as targz from 'tar.gz';
1010
1111const isWindows = / ^ w i n / . test ( process . platform ) ;
1212const textFileExtensions = [ '.gitignore' , 'template_gitignore' , '.config' , '.cs' , '.cshtml' , '.csproj' , '.html' , '.js' , '.json' , '.jsx' , '.md' , '.nuspec' , '.ts' , '.tsx' ] ;
13- const yeomanGeneratorSource = './src/yeoman' ;
1413const webToolsVSPackageGuid = '{0CD94836-1526-4E85-87D3-FB5274C5AFC9}' ;
1514
1615const dotNetPackages = {
@@ -100,31 +99,6 @@ function getBuildNumber(): string {
10099 return Math . floor ( ( new Date ( ) . valueOf ( ) - new Date ( 2017 , 0 , 1 ) . valueOf ( ) ) / ( 60 * 1000 ) ) + '-local' ;
101100}
102101
103- function buildYeomanNpmPackage ( outputRoot : string ) {
104- const outputTemplatesRoot = path . join ( outputRoot , 'app/templates' ) ;
105- rimraf . sync ( outputTemplatesRoot ) ;
106-
107- // Copy template files
108- const filenameReplacements = [
109- { from : / .* \. c s p r o j $ / , to : 'tokenreplace-namePascalCase.csproj' }
110- ] ;
111- const contentReplacements = [
112- // Currently, there are none
113- ] ;
114- _ . forEach ( templates , ( templateConfig , templateName ) => {
115- const outputDir = path . join ( outputTemplatesRoot , templateName ) ;
116- writeTemplate ( templateConfig . dir , outputDir , contentReplacements , filenameReplacements ) ;
117- } ) ;
118-
119- // Also copy the generator files (that's the compiled .js files, plus all other non-.ts files)
120- const tempRoot = './tmp' ;
121- copyRecursive ( path . join ( tempRoot , 'yeoman' ) , outputRoot , '**/*.js' ) ;
122- copyRecursive ( yeomanGeneratorSource , outputRoot , '**/!(*.ts)' ) ;
123-
124- // Clean up
125- rimraf . sync ( tempRoot ) ;
126- }
127-
128102function buildDotNetNewNuGetPackages ( outputDir : string ) {
129103 const dotNetPackageIds = _ . values ( dotNetPackages ) ;
130104 dotNetPackageIds . forEach ( packageId => {
@@ -275,12 +249,10 @@ function buildDotNetNewNuGetPackage(packageId: string) {
275249 } ) ;
276250
277251 // Create the .nuspec file
278- const yeomanPackageVersion = JSON . parse ( fs . readFileSync ( path . join ( yeomanGeneratorSource , 'package.json' ) , 'utf8' ) ) . version ;
279252 const nuspecContentTemplate = fs . readFileSync ( `./src/dotnetnew/${ packageId } .nuspec` ) ;
280253 writeFileEnsuringDirExists ( outputRoot ,
281254 `${ packageId } .nuspec` ,
282255 applyContentReplacements ( nuspecContentTemplate , [
283- { from : / \{ y e o m a n v e r s i o n \} / g, to : yeomanPackageVersion } ,
284256 { from : / \{ b u i l d n u m b e r \} / g, to : getBuildNumber ( ) } ,
285257 ] )
286258 ) ;
@@ -313,16 +285,7 @@ function runPrepublishScripts(rootDir: string, scripts: string[]) {
313285
314286const distDir = './dist' ;
315287const artifactsDir = path . join ( distDir , 'artifacts' ) ;
316- const yeomanOutputRoot = path . join ( distDir , 'generator-aspnetcore-spa' ) ;
317288
318289rimraf . sync ( distDir ) ;
319290mkdirp . sync ( artifactsDir ) ;
320- buildYeomanNpmPackage ( yeomanOutputRoot ) ;
321291buildDotNetNewNuGetPackages ( artifactsDir ) ;
322-
323- // Finally, create a .tar.gz file containing the built generator-aspnetcore-spa.
324- // The CI system can treat this as the final built artifact.
325- // Note that the targz APIs only come in async flavor.
326- targz ( ) . compress ( yeomanOutputRoot , path . join ( artifactsDir , 'generator-aspnetcore-spa.tar.gz' ) , err => {
327- if ( err ) { throw err ; }
328- } ) ;
0 commit comments