Skip to content

Commit

Permalink
Start of nuget package.
Browse files Browse the repository at this point in the history
References #20.
  • Loading branch information
jspuij committed Nov 14, 2019
1 parent efc7729 commit 3bfda61
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 10 deletions.
6 changes: 6 additions & 0 deletions Cortex.Net.sln
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{79D4
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Cortex.Net.BlazorTodo", "samples\Cortex.Net.BlazorTodo\Cortex.Net.BlazorTodo.csproj", "{A9CA7C47-8A56-4BBC-B943-6BE37D1BAE3F}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{8F1E2084-FEBE-462B-8F92-9644FB7577AE}"
ProjectSection(SolutionItems) = preProject
build\build.props = build\build.props
build\Weaver.props = build\Weaver.props
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down
File renamed without changes.
5 changes: 5 additions & 0 deletions build/Weaver.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<WeaverFiles Include="$(MsBuildThisFileDirectory)..\weaver\$(MSBuildThisFileName).Fody.dll" />
</ItemGroup>
</Project>
24 changes: 17 additions & 7 deletions build/build.props
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
<Project>
<PropertyGroup>
<Description>IL-instrumentation based observables</Description>
<Authors>Jan-Willem Spuij</Authors>
<PackageLicenseUrl>https://github.com/jspuij/Cortex.Net/blob/master/LICENSE</PackageLicenseUrl>
<PackageProjectUrl>https://github.com/jspuij/Cortex.Net</PackageProjectUrl>
<DisableFody>true</DisableFody>
</PropertyGroup>
<PropertyGroup>
<PackageId Condition="'$(PackageId)' == ''">$(MSBuildProjectName)</PackageId>
<Description>Transparent Reactive State Management for .NET applications.</Description>
<Authors>Jan-Willem Spuij</Authors>
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
<PackageProjectUrl>https://github.com/jspuij/Cortex.Net</PackageProjectUrl>
<DisableFody>true</DisableFody>
<Version>0.1.0-preview</Version>
<NeutralLanguage>en-US</NeutralLanguage>
</PropertyGroup>

<ItemGroup>
<None Include="$(SolutionDir)LICENSE.txt">
<Pack>True</Pack>
<PackagePath></PackagePath>
</None>
</ItemGroup>
</Project>
1 change: 1 addition & 0 deletions src/Cortex.Net.Blazor/Cortex.Net.Blazor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
Expand Down
30 changes: 27 additions & 3 deletions src/Cortex.Net/Cortex.Net.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\build\build.props" />

<PropertyGroup>
<NoWarn>$(NoWarn);NU5100</NoWarn>
<TargetFramework>netstandard2.0</TargetFramework>
<NeutralLanguage>en</NeutralLanguage>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<WeaverDirPath Condition="'$(WeaverDirPath)' == ''">$(SolutionDir)src\$(PackageId).Fody\bin\$(Configuration)\</WeaverDirPath>
<WeaverPropsFile Condition="'$(WeaverPropsFile)' == ''">$(SolutionDir)build\Weaver.props</WeaverPropsFile>
<TargetsForTfmSpecificContentInPackage Condition="'$(SkipPackagingDefaultFiles)' != 'true'">$(TargetsForTfmSpecificContentInPackage);IncludeFodyFiles</TargetsForTfmSpecificContentInPackage>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
Expand All @@ -18,7 +23,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Fody" Version="6.0.5" PrivateAssets="None" />
<PackageReference Include="Fody" Version="[6.0.0>" PrivateAssets="None" />
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.7">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down Expand Up @@ -65,5 +70,24 @@
<ItemGroup>
<Service Include="{508349b6-6b84-4df5-91f0-309beebad82d}" />
</ItemGroup>
<Import Project="..\..\build\build.props"/>

<Target Name="IncludeFodyFiles">
<PropertyGroup>
<WeaverFile>$(WeaverDirPath)netstandard2.0\$(PackageId).Fody.dll</WeaverFile>
<XcfFile>$(WeaverDirPath)netstandard2.0\$(PackageId).Fody.xcf</XcfFile>
</PropertyGroup>

<Error Text="FodyPackaging: No weaver found at $(WeaverFile). $(ProjectName) should have a Project Dependency on $(PackageId), and $(PackageId) should target 'netstandard2.0'."
Condition="!Exists($(WeaverFile))" />

<ItemGroup>
<TfmSpecificPackageFile Include="$(XcfFile)"
PackagePath="weaver\$(PackageId).Fody.xcf"
Condition="Exists($(XcfFile))" />
<TfmSpecificPackageFile Include="$(WeaverFile)"
PackagePath="weaver\$(PackageId).Fody.dll" />
<TfmSpecificPackageFile Include="$(WeaverPropsFile)"
PackagePath="build\$(PackageId).props" />
</ItemGroup>
</Target>
</Project>

0 comments on commit 3bfda61

Please sign in to comment.