Skip to content

Commit 8fcca18

Browse files
committed
[Nuget] Added netstandard support and pdb symbols
1 parent a7e1061 commit 8fcca18

14 files changed

+67
-15
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,8 @@ publish/
195195
# in these scripts will be unencrypted
196196
PublishScripts/
197197

198-
# NuGet Packages
198+
# NuGet
199+
nugets/
199200
*.nupkg
200201
# NuGet Symbol Packages
201202
*.snupkg

.vscode/extensions.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@
66
"recommendations": [
77
"emmanuelbeziat.vscode-great-icons",
88
"editorconfig.editorconfig",
9-
"formulahendry.dotnet-test-explorer",
9+
"hjdarnel.dotnet-test-explorer",
1010
"fernandoescolar.vscode-solution-explorer",
1111
"ms-dotnettools.csharp",
1212
"ionide.ionide-paket",
13+
"eridem.vscode-nupkg"
1314
],
1415
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
1516
"unwantedRecommendations": [

.vscode/launch.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"name": ".NET Core Launch (console)",
99
"type": "coreclr",
1010
"request": "launch",
11-
"preLaunchTask": "build",
11+
"preLaunchTask": "build tests",
1212
// If you have changed target frameworks, make sure to update the program path.
1313
"program": "${workspaceFolder}/ComponentBase.Tests/bin/Debug/netcoreapp3.1/ComponentBase.Tests.dll",
1414
"args": [],
@@ -24,4 +24,4 @@
2424
"processId": "${command:pickProcess}"
2525
}
2626
]
27-
}
27+
}

.vscode/settings.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2-
"dotnet-test-explorer.enableTelemetry": false,
3-
"dotnet-test-explorer.testProjectPath": "./ComponentBase.Tests"
2+
"dotnet-test-explorer.testProjectPath": "./ComponentBase.Tests",
3+
"dotnet-test-explorer.enableTelemetry": false
4+
45
}

.vscode/tasks.json

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,19 @@
22
"version": "2.0.0",
33
"tasks": [
44
{
5-
"label": "build",
5+
"label": "build",
6+
"command": "dotnet",
7+
"type": "process",
8+
"args": [
9+
"build",
10+
"${workspaceFolder}/ComponentBase/ComponentBase.csproj",
11+
"/property:GenerateFullPaths=true",
12+
"/consoleloggerparameters:NoSummary"
13+
],
14+
"problemMatcher": "$msCompile"
15+
},
16+
{
17+
"label": "build tests",
618
"command": "dotnet",
719
"type": "process",
820
"args": [
@@ -39,4 +51,4 @@
3951
"problemMatcher": "$msCompile"
4052
}
4153
]
42-
}
54+
}

ComponentBase.Tests/ComponentBase.Tests.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,8 @@
44
<TargetFramework>netcoreapp3.1</TargetFramework>
55
<IsPackable>false</IsPackable>
66
</PropertyGroup>
7+
<ItemGroup>
8+
<ProjectReference Include="..\ComponentBase\ComponentBase.csproj" />
9+
</ItemGroup>
710
<Import Project="..\.paket\Paket.Restore.targets" />
811
</Project>

ComponentBase.Tests/MyComponentTests.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ public void Setup()
1212
[Test]
1313
public void Test1()
1414
{
15-
Assert.Pass();
15+
var obj = new MyComponent();
16+
Assert.AreEqual(obj.Method(), "This is a method");
1617
}
1718
}
18-
}
19+
}

ComponentBase.Tests/paket.references

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ group Test
22
nunit
33
NUnit3TestAdapter
44
Microsoft.NET.Test.Sdk
5+
NUnit.ConsoleRunner

ComponentBase/ComponentBase.csproj

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,25 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project Sdk="Microsoft.NET.Sdk">
33
<PropertyGroup>
4-
<TargetFramework>netcoreapp3.1</TargetFramework>
4+
<Title>Component Base</Title>
5+
<TargetFrameworks>netstandard2.0;netcoreapp3.1</TargetFrameworks>
6+
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
7+
<Version>0.0.1</Version>
8+
<PackageLicenseExpression>MIT</PackageLicenseExpression>
9+
<Description>This is a base scaffold for paket/nuget packages</Description>
10+
<Authors>Felipe Ferreira</Authors>
11+
<Company>O-Pitblast</Company>
12+
<PackageTags>component, component-scaffold, nuget-component, dotnet-package</PackageTags>
13+
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
14+
<SignAssembly>false</SignAssembly>
15+
<!--Symbols for debug the .dll of this package-->
16+
<EmbedUntrackedSources>true</EmbedUntrackedSources>
17+
<IncludeSymbols>true</IncludeSymbols>
18+
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
19+
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
20+
</PropertyGroup>
21+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
22+
<DocumentationFile></DocumentationFile>
523
</PropertyGroup>
624
<Import Project="..\.paket\Paket.Restore.targets" />
7-
</Project>
25+
</Project>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
type project

0 commit comments

Comments
 (0)