@@ -59,6 +59,7 @@ public ProjectProperty(string name, string value, string configuration, string p
5959
6060 string name ;
6161 string defaultPlatform ;
62+ string relativePath ;
6263
6364 /// <summary>
6465 /// The language of the project.
@@ -92,6 +93,9 @@ public ProjectDescriptor(XmlElement element, IReadOnlyFileSystem fileSystem)
9293 } else {
9394 name = "${ProjectName}" ;
9495 }
96+ if ( element . HasAttribute ( "directory" ) ) {
97+ relativePath = element . GetAttribute ( "directory" ) ;
98+ }
9599 languageName = element . GetAttribute ( "language" ) ;
96100 if ( string . IsNullOrEmpty ( languageName ) ) {
97101 ProjectTemplateImpl . WarnAttributeMissing ( element , "language" ) ;
@@ -301,7 +305,7 @@ public bool CreateProject(ProjectTemplateResult templateResults, string defaultL
301305 return false ;
302306 }
303307
304- DirectoryName projectBasePath = projectCreateOptions . ProjectBasePath ;
308+ DirectoryName projectBasePath = GetProjectBasePath ( projectCreateOptions ) ;
305309 string newProjectName = StringParser . Parse ( name , new StringTagPair ( "ProjectName" , projectCreateOptions . ProjectName ) ) ;
306310 Directory . CreateDirectory ( projectBasePath ) ;
307311 FileName projectLocation = projectBasePath . CombineFile ( newProjectName + descriptor . ProjectFileExtension ) ;
@@ -546,6 +550,15 @@ public bool CreateProject(ProjectTemplateResult templateResults, string defaultL
546550 }
547551 }
548552
553+ DirectoryName GetProjectBasePath ( ProjectTemplateOptions projectCreateOptions )
554+ {
555+ if ( String . IsNullOrEmpty ( relativePath ) ) {
556+ return projectCreateOptions . ProjectBasePath ;
557+ }
558+ string relativeBasePath = StringParser . Parse ( relativePath , new StringTagPair ( "ProjectName" , projectCreateOptions . ProjectName ) ) ;
559+ return projectCreateOptions . ProjectBasePath . CombineDirectory ( relativeBasePath ) ;
560+ }
561+
549562 void RunPreCreateActions ( ProjectCreateInformation projectCreateInformation )
550563 {
551564 foreach ( var action in preCreateActions ) {
0 commit comments