I am creating a multi-project template, that has a few optional projects and solution folders. I have been through quite a few different documentations and code in github to achieve this, but with very little success. I really appreciate if someone could give me some clarity on some of these questions?
Using the above VSTemplate I attempted to create a multi project template,using the ProjectCollection tage, when I run the dotnet run command, the template gets executed but the project does not get created.
<ProjectTemplateLink ProjectName="$safeprojectname$.Forms.Plugin.Abstractions">
Forms.Plugin.Abstractions\Forms.Plugin.Abstractions.vstemplate
</ProjectTemplateLink>
<ProjectTemplateLink ProjectName="$safeprojectname$.Forms.Plugin.iOS">
Forms.Plugin.iOS\Forms.Plugin.iOS.vstemplate
</ProjectTemplateLink>
<ProjectTemplateLink ProjectName="$safeprojectname$.Forms.Plugin.iOSUnified">
Forms.Plugin.iOSUnified\Forms.Plugin.iOSUnified.vstemplate
</ProjectTemplateLink>
<ProjectTemplateLink ProjectName="$safeprojectname$.Forms.Plugin.Android">
Forms.Plugin.Android\Forms.Plugin.Android.vstemplate
</ProjectTemplateLink>
<ProjectTemplateLink ProjectName="$safeprojectname$.Forms.Plugin.WindowsPhone">
Forms.Plugin.WindowsPhone\Forms.Plugin.WindowsPhone.vstemplate
</ProjectTemplateLink>
</ProjectCollection>```
Can we create a multi-project template using template.json file?
Would appreciate if anyone can help me get started.
I have managed to get the multi-project template working by making the changes in the template.json file
this is the final template.json file looks like
This is my updated template.json file
{
"author": "Libin Joseph",
"classifications": ["Xamarin", "Sample"],
"name": "Sample Enterprise Template",
"tags": {
"language": "C#"
},
"identity": "libin.sampletemplate",
"shortName": "sampletemplate",
"sourceName": "SampleTemplate",
"guids": [
"{41F47D3C-C9E4-45D1-A289-3BDC31E44C19}",
"{980FBE34-066B-4E87-AFC9-C3205844D980}",
"{FD448FB5-B24B-4CD2-8E3C-2500CF0E4601}",
"{D8FC665A-7739-4ADE-85E9-C69AA107EEE6}",
"{92D25D7D-F637-4634-B939-BB38DE53B606}",
"{5D52EDF7-47B8-48D2-83B6-104B18568CE4}",
"{12E171B1-0F36-401A-A171-614F1A1C83E9}",
"{7A4597AE-2C39-4197-94C9-F5B6B45B2106}"
],
"primaryOutputs": [{
"path": "SampleTemplate\\SampleTemplate.Android\\SampleTemplate.Android.csproj"
},
{
"path": "SampleTemplate\\SampleTemplate.iOS\\SampleTemplate.iOS.csproj"
},
{
"path": "SampleTemplate\\SampleTemplate\\SampleTemplate.csproj"
},
{
"path": "SampleTemplate.UnitTest\\SampleTemplate.UnitTest.csproj"
},
{
"path": "SampleTemplate.UITest\\SampleTemplate.UITest.csproj"
},
{
"path": "SampleTemplate.Core\\SampleTemplate.Core.csproj"
}
],
"exclude": ["**/[Bb]in/**", "**/[Oo]bj/**", ".template.config/**/*", "**/*.lock.json"]
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With