@@ -10,7 +10,6 @@ import * as targz from 'tar.gz';
10
10
11
11
const isWindows = / ^ w i n / . test ( process . platform ) ;
12
12
const textFileExtensions = [ '.gitignore' , 'template_gitignore' , '.config' , '.cs' , '.cshtml' , '.csproj' , '.html' , '.js' , '.json' , '.jsx' , '.md' , '.nuspec' , '.ts' , '.tsx' ] ;
13
- const yeomanGeneratorSource = './src/yeoman' ;
14
13
const webToolsVSPackageGuid = '{0CD94836-1526-4E85-87D3-FB5274C5AFC9}' ;
15
14
16
15
const dotNetPackages = {
@@ -100,31 +99,6 @@ function getBuildNumber(): string {
100
99
return Math . floor ( ( new Date ( ) . valueOf ( ) - new Date ( 2017 , 0 , 1 ) . valueOf ( ) ) / ( 60 * 1000 ) ) + '-local' ;
101
100
}
102
101
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
-
128
102
function buildDotNetNewNuGetPackages ( outputDir : string ) {
129
103
const dotNetPackageIds = _ . values ( dotNetPackages ) ;
130
104
dotNetPackageIds . forEach ( packageId => {
@@ -275,12 +249,10 @@ function buildDotNetNewNuGetPackage(packageId: string) {
275
249
} ) ;
276
250
277
251
// Create the .nuspec file
278
- const yeomanPackageVersion = JSON . parse ( fs . readFileSync ( path . join ( yeomanGeneratorSource , 'package.json' ) , 'utf8' ) ) . version ;
279
252
const nuspecContentTemplate = fs . readFileSync ( `./src/dotnetnew/${ packageId } .nuspec` ) ;
280
253
writeFileEnsuringDirExists ( outputRoot ,
281
254
`${ packageId } .nuspec` ,
282
255
applyContentReplacements ( nuspecContentTemplate , [
283
- { from : / \{ y e o m a n v e r s i o n \} / g, to : yeomanPackageVersion } ,
284
256
{ from : / \{ b u i l d n u m b e r \} / g, to : getBuildNumber ( ) } ,
285
257
] )
286
258
) ;
@@ -313,16 +285,7 @@ function runPrepublishScripts(rootDir: string, scripts: string[]) {
313
285
314
286
const distDir = './dist' ;
315
287
const artifactsDir = path . join ( distDir , 'artifacts' ) ;
316
- const yeomanOutputRoot = path . join ( distDir , 'generator-aspnetcore-spa' ) ;
317
288
318
289
rimraf . sync ( distDir ) ;
319
290
mkdirp . sync ( artifactsDir ) ;
320
- buildYeomanNpmPackage ( yeomanOutputRoot ) ;
321
291
buildDotNetNewNuGetPackages ( 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