Skip to content

Commit 1d70d94

Browse files
committed
Move to csx build script, and publish snupkg
1 parent c98ef30 commit 1d70d94

File tree

8 files changed

+62
-33
lines changed

8 files changed

+62
-33
lines changed

.config/dotnet-tools.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"version": 1,
3+
"isRoot": true,
4+
"tools": {
5+
"dotnet-script": {
6+
"version": "0.53.0",
7+
"commands": [
8+
"dotnet-script"
9+
]
10+
}
11+
}
12+
}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ obj/
3232
#NuGet
3333
packages/
3434
*.nupkg
35+
*.snupkg
3536

3637
#Installer
3738
installer/Output

README.md

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -28,26 +28,7 @@ Installation
2828
------------
2929

3030
[Simple.Migrations is available on NuGet](https://www.nuget.org/packages/Simple.Migrations).
31-
32-
Either open the package console and type:
33-
34-
```
35-
PM> Install-Package Simple.Migrations
36-
```
37-
38-
Or right-click your project -> Manage NuGet Packages... -> Online -> search for Simple.Migrations in the top right.
39-
40-
I also publish symbols on [SymbolSource](http://www.symbolsource.org/Public), so you can use the NuGet package but still have access to the source when debugging.
41-
If you haven't yet set up Visual Studio to use SymbolSource, do that now:
42-
43-
1. Go to Tools -> Options -> Debugger -> General.
44-
2. Uncheck "Enable Just My Code (Managed only)".
45-
3. Uncheck "Enable .NET Framework source stepping". Yes, it is misleading, but if you don't, then Visual Studio will ignore your custom server order (see further on) and only use it's own servers.
46-
4. Check "Enable source server support".
47-
5. Uncheck "Require source files to exactly match the original version"
48-
6. Go to Tools -> Options -> Debugger -> Symbols.
49-
7. Select a folder for the local symbol/source cache. You may experience silent failures in getting symbols if it doesn't exist or is read-only for some reason.
50-
8. Add `http://srv.symbolsource.org/pdb/Public` under "Symbol file (.pdb) locations".
31+
See that page for installation instructions.
5132

5233

5334
Quick Start

build.csx

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/usr/bin/env dotnet-script
2+
3+
#r "nuget: SimpleTasks, 0.9.4"
4+
5+
using SimpleTasks;
6+
using static SimpleTasks.SimpleTask;
7+
8+
#nullable enable
9+
10+
string simpleMigrationsDir = "src/Simple.Migrations";
11+
12+
string testsDir = "src/Simple.Migrations.UnitTests";
13+
14+
string nugetDir = "NuGet";
15+
16+
CreateTask("build").Run((string versionOpt, string configurationOpt) =>
17+
{
18+
var flags = CommonFlags(versionOpt, configurationOpt);
19+
Command.Run("dotnet", $"build {flags} \"{simpleMigrationsDir}\"");
20+
});
21+
22+
CreateTask("package").DependsOn("build").Run((string version, string configurationOpt) =>
23+
{
24+
var flags = CommonFlags(version, configurationOpt) + $" --no-build --output=\"{nugetDir}\"";
25+
Command.Run("dotnet", $"pack {flags} \"{simpleMigrationsDir}\"");
26+
});
27+
28+
string CommonFlags(string? version, string? configuration) =>
29+
$"--configuration={configuration ?? "Release"} -p:VersionPrefix=\"{version ?? "0.0.0"}\"";
30+
31+
CreateTask("test").Run(() =>
32+
{
33+
Command.Run("dotnet", $"test \"{testsDir}\"");
34+
});
35+
36+
return InvokeTask(Args);

nuget.config

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/Simple.Migrations.IntegrationTests/Simple.Migrations.IntegrationTests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0-preview-20170106-08" />
1616
<PackageReference Include="System.Reflection.Extensions" Version="4.0.1" />
1717
<PackageReference Include="NUnit" Version="3.5.0" />
18-
<PackageReference Include="NUnit3TestAdapter" Version="4.0.0-ci-00457-pr-313" />
18+
<PackageReference Include="NUnit3TestAdapter" Version="3.17.0" />
1919

2020
<PackageReference Include="Microsoft.Data.Sqlite" Version="1.0.1" />
2121
<PackageReference Include="System.Data.SqlClient" Version="4.1.0" />

src/Simple.Migrations.UnitTests/Simple.Migrations.UnitTests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
1616
<PackageReference Include="Moq" Version="4.7.8" />
1717
<PackageReference Include="NUnit" Version="3.6.1" />
18-
<PackageReference Include="NUnit3TestAdapter" Version="4.0.0-ci-00457-pr-313" />
18+
<PackageReference Include="NUnit3TestAdapter" Version="3.17.0" />
1919
</ItemGroup>
2020
<ItemGroup Condition=" '$(TargetFramework)' == 'net451' ">
2121
<Reference Include="System" />

src/Simple.Migrations/Simple.Migrations.csproj

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,16 @@
1616
<RepositoryUrl>https://github.com/canton7/Simple.Migrations</RepositoryUrl>
1717
<Description>Simple but flexible migrations library</Description>
1818
<Authors>Antony Male</Authors>
19+
20+
<!-- Just embed all sources in the PDB: snupkg files don't support bare .cs files, and SourceLink is annoying -->
21+
<IncludeSymbols>true</IncludeSymbols>
22+
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
23+
<EmbedAllSources>true</EmbedAllSources>
24+
<DebugType>portable</DebugType>
25+
</PropertyGroup>
26+
27+
<PropertyGroup Condition=" '$(TargetFramework)' == 'net45' ">
28+
<DebugType>full</DebugType>
1929
</PropertyGroup>
2030

2131
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.2' OR '$(TargetFramework)' == 'netstandard1.3' ">

0 commit comments

Comments
 (0)