Skip to content
This repository has been archived by the owner on Dec 3, 2019. It is now read-only.

Add an example of the state of the art on how to create a package from template dir #14

Open
enricosada opened this issue Jun 15, 2017 · 1 comment

Comments

@enricosada
Copy link

enricosada commented Jun 15, 2017

Is possibile to create package the template in lot of ways (nuget, nuspec, csproj, prj)

The best one i know atm is doing just with a .proj (any extension is ok), like https://github.com/fable-compiler/Fable/blob/master/src/templates/simple/Fable.Template.proj

so like Fable.Template.proj (note the .proj extension, neutral, not csproj, so doesnt mess with compiler targets)

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>

    <!-- fill some nuget package props (optional) -->
    <Description>Simple Fable App</Description>
    <Authors>Alfonso Garcia-Caro</Authors>
    <!-- fill nuget package version (optional) -->
    <Version>0.2.1</Version>

    <!-- this is a package -->
    <PackageType>Template</PackageType>

    <!-- cruft need to avoid building and making dotnet sdk happy -->
    <PackProjectInputFile>$(MSBuildProjectFullPath)</PackProjectInputFile>
    <NoBuild>true</NoBuild>
    <IncludeBuildOutput>false</IncludeBuildOutput>
    <TargetFramework>netstandard1.0</TargetFramework>
    <DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>

  </PropertyGroup>
  <PropertyGroup>
    <!-- simple way to exclude things (optional but nice) -->
    <ExcludeFromPackage>
        Content/node_modules/**/*;
        Content/packages/**/*;
        Content/public/bundle.js*;
        Content/bin/**/*;
        Content/obj/**/*;
    </ExcludeFromPackage>
</PropertyGroup>
  <ItemGroup>
    <Content Include="Content/**/*" Exclude="$(ExcludeFromPackage)" >
        <PackagePath>Content\</PackagePath>
    </Content>
  </ItemGroup>
</Project>
@enricosada
Copy link
Author

add with dotnet/templating#954 the issue to add a donet new template

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant