Skip to content

Commit b485565

Browse files
committed
Add nuget pack
1 parent 154b9b2 commit b485565

File tree

3 files changed

+66
-32
lines changed

3 files changed

+66
-32
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
build/*
2+
pack/*

SqlDataComparison.nuspec

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<?xml version="1.0"?>
2+
<package>
3+
<metadata minClientVersion="3.3.0">
4+
<id>MightyOrm.SqlDataComparison</id>
5+
<version>0.0.0</version>
6+
<authors>Mike Beaton</authors>
7+
<owners>Mike Beaton</owners>
8+
<requireLicenseAcceptance>false</requireLicenseAcceptance>
9+
<description>Pure SQL data comparison and reconciliation utility for SQL Server
10+
11+
Example usage:
12+
13+
* EXEC sp_CompareData 'MyTable', 'RemoteDb..TheirTable'
14+
* EXEC sp_ExportAll 'MyTable', 'RemoteDb..TheirTable'
15+
* EXEC sp_ExportDeleted 'MyTable', 'RemoteDb..TheirTable'
16+
* EXEC sp_ExportDeleted 'MyTable', 'RemoteDb..TheirTable', @ids = '43-44'
17+
18+
Supports:
19+
20+
* Column name remapping
21+
* Columns filter
22+
* Automatic primary key based or manual join columns spec
23+
* And more...
24+
</description>
25+
<tags>SQL Server;SQL;compare data;data comparison</tags>
26+
<copyright>Copyright (c) 2020 Mike Beaton</copyright>
27+
<projectUrl>https://github.com/MightyOrm/SqlDataComparison</projectUrl>
28+
<licenseUrl>https://github.com/MightyOrm/SqlDataComparison/blob/master/LICENSE</licenseUrl>
29+
<contentFiles>
30+
<!-- new style projects -->
31+
<files include="**/SqlDataComparison/*.*" buildAction="None" />
32+
</contentFiles>
33+
</metadata>
34+
<files>
35+
<!-- new style projects -->
36+
<file src="build\Install.sql" target="contentFiles\any\any\SqlDataComparison" />
37+
<file src="build\InstallMaster.sql" target="contentFiles\any\any\SqlDataComparison" />
38+
<file src="build\CleanMaster.sql" target="contentFiles\any\any\SqlDataComparison" />
39+
<file src="build\README.txt" target="contentFiles\any\any\SqlDataComparison" />
40+
41+
<!-- old style projects -->
42+
<file src="build\Install.sql" target="content\SqlDataComparison" />
43+
<file src="build\InstallMaster.sql" target="content\SqlDataComparison" />
44+
<file src="build\CleanMaster.sql" target="content\SqlDataComparison" />
45+
<file src="build\README.txt" target="content\SqlDataComparison" />
46+
</files>
47+
</package>

SqlDataComparison.proj

Lines changed: 18 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
22

33
<PropertyGroup>
4-
<AssemblyName>SqlDataComparison</AssemblyName>
4+
<PackageId>MightyOrm.SqlDataComparison</PackageId>
5+
<Version>1.0.1</Version>
56
<OutputPath>build\</OutputPath>
67
<OutputInstall>Install.sql</OutputInstall>
78
<OutputInstallMaster>InstallMaster.sql</OutputInstallMaster>
@@ -11,33 +12,14 @@
1112
<OutputUninstallTestDbs>tests\UninstallTestDbs.sql</OutputUninstallTestDbs>
1213
<SourcePath>src\</SourcePath>
1314
<TestsPath>tests\</TestsPath>
15+
<ContentRoot>contentFiles\any\any\</ContentRoot>
16+
<ContentFolder>SqlDataComparison</ContentFolder>
17+
<PackageOutputPath>pack</PackageOutputPath>
18+
<PackageProjectUrl>https://github.com/MightyOrm/SqlDataComparison</PackageProjectUrl>
1419
<LicenseFile>publish.license.template</LicenseFile>
1520
<LicenseReplaceString>[[LICENSE]]</LicenseReplaceString>
1621
</PropertyGroup>
1722

18-
<PropertyGroup>
19-
<PackageId>Mighty.SqlDataComparison</PackageId>
20-
<Version>1.0.0-alpha3</Version>
21-
<Authors>Mike Beaton</Authors>
22-
<PackageTags>SQL Server;SQL;compare data;data comparison</PackageTags>
23-
<Description>Pure SQL data comparison and reconciliation utility:
24-
25-
* `sp_comparedata 'MyTable', 'RemoteDb..MyTable'`
26-
* `sp_exportall 'MyTable', 'RemoteDb..MyTable'`
27-
* etc.
28-
29-
With support for:
30-
31-
* Column name remapping
32-
* Columns filter
33-
* Automatic (primary key based) or manual join columns spec
34-
</Description>
35-
<Copyright>Copyright (c) 2020 Mike Beaton</Copyright>
36-
<PackageProjectUrl>https://github.com/MightyOrm/SqlDataComparison</PackageProjectUrl>
37-
<PackageLicenseUrl>https://github.com/MightyOrm/SqlDataComparison/blob/master/LICENSE</PackageLicenseUrl>
38-
<PackageOutputPath>pack</PackageOutputPath>
39-
</PropertyGroup>
40-
4123
<Target Name="ReadLicense">
4224
<ItemGroup>
4325
<LicenseFileContents Include="%0d%0a$([System.IO.File]::ReadAllText($(SourcePath)$(LicenseFile)).Replace([[PackageId]],$(PackageId)).Replace([[Version]],$(Version)).Replace([[PackageProjectUrl]],$(PackageProjectUrl)))%0d%0a"/>
@@ -52,7 +34,7 @@ With support for:
5234
</ItemGroup>
5335

5436
<!-- Concatenate files https://stackoverflow.com/a/29557615/795690 -->
55-
<Target Name="CreateInstall" Inputs="@(InstallFiles)" Outputs="$(OutputPath)$(OutputInstall)">
37+
<Target Name="CreateInstall" Inputs="SqlDataComparison.proj;$(SourcePath)$(LicenseFile);@(InstallFiles)" Outputs="$(OutputPath)$(OutputInstall)">
5638
<ItemGroup>
5739
<InstallFileContents Include="PRINT N'%(InstallFiles.Identity)...'%0d%0aGO%0d%0a$([System.IO.File]::ReadAllText(%(InstallFiles.Identity)).Replace($(LicenseReplaceString),$(License)))"/>
5840
</ItemGroup>
@@ -69,7 +51,7 @@ With support for:
6951
<InstallMasterFiles Include="$(SourcePath)master\use\UseMaster.sql;$(SourcePath)master\clean\*.sql;$(SourcePath)master\*.sql"/>
7052
</ItemGroup>
7153

72-
<Target Name="CreateInstallMaster" Inputs="@(InstallMasterFiles)" Outputs="$(OutputPath)$(OutputInstallMaster)">
54+
<Target Name="CreateInstallMaster" Inputs="SqlDataComparison.proj;$(SourcePath)$(LicenseFile);@(InstallMasterFiles)" Outputs="$(OutputPath)$(OutputInstallMaster)">
7355
<ItemGroup>
7456
<InstallMasterFileContents Include="PRINT N'%(InstallMasterFiles.Identity)...'%0d%0aGO%0d%0a$([System.IO.File]::ReadAllText(%(InstallMasterFiles.Identity)).Replace($(LicenseReplaceString),$(License)))"/>
7557
</ItemGroup>
@@ -86,7 +68,7 @@ With support for:
8668
<CleanMasterFiles Include="$(SourcePath)master\use\UseMaster.sql;$(SourcePath)master\clean\*.sql"/>
8769
</ItemGroup>
8870

89-
<Target Name="CreateCleanMaster" Inputs="@(CleanMasterFiles)" Outputs="$(OutputPath)$(OutputCleanMaster)">
71+
<Target Name="CreateCleanMaster" Inputs="SqlDataComparison.proj;$(SourcePath)$(LicenseFile);@(CleanMasterFiles)" Outputs="$(OutputPath)$(OutputCleanMaster)">
9072
<ItemGroup>
9173
<CleanMasterFileContents Include="PRINT N'%(CleanMasterFiles.Identity)...'%0d%0aGO%0d%0a$([System.IO.File]::ReadAllText(%(CleanMasterFiles.Identity)))"/>
9274
</ItemGroup>
@@ -103,7 +85,7 @@ With support for:
10385
<InstallTSQLtFiles Include="$(TestsPath)tsqlt\SetClrEnabled.sql;\OpenSource\tSQLt_V1.0.5873.27393\tSQLt.class.sql;"/>
10486
</ItemGroup>
10587

106-
<Target Name="CreateInstallTSQLt" Inputs="@(InstallTSQLtFiles)" Outputs="$(OutputPath)$(OutputInstallTSQLt)">
88+
<Target Name="CreateInstallTSQLt" Inputs="SqlDataComparison.proj;$(SourcePath)$(LicenseFile);@(InstallTSQLtFiles)" Outputs="$(OutputPath)$(OutputInstallTSQLt)">
10789
<ItemGroup>
10890
<InstallTSQLtFileContents Include="PRINT N'%(InstallTSQLtFiles.Identity)...'%0d%0aGO%0d%0a$([System.IO.File]::ReadAllText(%(InstallTSQLtFiles.Identity)).Replace($(LicenseReplaceString),$(License)))"/>
10991
</ItemGroup>
@@ -120,7 +102,7 @@ With support for:
120102
<InstallTestsFiles Include="$(TestsPath)test-dbs\DropTestDatabases.sql;$(TestsPath)test-dbs\CreateTestDatabases.sql;$(TestsPath)test-dbs\RecreateTestTables.sql;$(TestsPath)*.sql"/>
121103
</ItemGroup>
122104

123-
<Target Name="CreateInstallTests" Inputs="@(InstallTestsFiles)" Outputs="$(OutputPath)$(OutputInstallTests)">
105+
<Target Name="CreateInstallTests" Inputs="SqlDataComparison.proj;$(SourcePath)$(LicenseFile);@(InstallTestsFiles)" Outputs="$(OutputPath)$(OutputInstallTests)">
124106
<ItemGroup>
125107
<InstallTestsFileContents Include="PRINT N'%(InstallTestsFiles.Identity)...'%0d%0aGO%0d%0a$([System.IO.File]::ReadAllText(%(InstallTestsFiles.Identity)).Replace($(LicenseReplaceString),$(License)))"/>
126108
</ItemGroup>
@@ -137,7 +119,7 @@ With support for:
137119
<UninstallTestDbsFiles Include="$(TestsPath)test-dbs\DropTestDatabases.sql;"/>
138120
</ItemGroup>
139121

140-
<Target Name="CreateUninstallTestDbs" Inputs="@(UninstallTestDbsFiles)" Outputs="$(OutputPath)$(OutputUninstallTestDbs)">
122+
<Target Name="CreateUninstallTestDbs" Inputs="SqlDataComparison.proj;$(SourcePath)$(LicenseFile);@(UninstallTestDbsFiles)" Outputs="$(OutputPath)$(OutputUninstallTestDbs)">
141123
<ItemGroup>
142124
<UninstallTestDbsFileContents Include="PRINT N'%(UninstallTestDbsFiles.Identity)...'%0d%0aGO%0d%0a$([System.IO.File]::ReadAllText(%(UninstallTestDbsFiles.Identity)).Replace($(LicenseReplaceString),$(License)))"/>
143125
</ItemGroup>
@@ -150,7 +132,7 @@ With support for:
150132
<Message Text="Created $(OutputPath)$(OutputUninstallTestDbs)"/>
151133
</Target>
152134

153-
<Target Name="AddReadme" Inputs="$(SourcePath)static\README.txt" Outputs="$(OutputPath)README.txt">
135+
<Target Name="AddReadme" Inputs="SqlDataComparison.proj;$(SourcePath)$(LicenseFile);$(SourcePath)static\README.txt" Outputs="$(OutputPath)README.txt">
154136
<ItemGroup>
155137
<ReadmeContents Include="$([System.IO.File]::ReadAllText($(SourcePath)static\README.txt).Replace($(LicenseReplaceString),$(License)))"/>
156138
</ItemGroup>
@@ -161,7 +143,11 @@ With support for:
161143
</Target>
162144

163145
<!-- Main build target -->
164-
<Target Name="Build" DependsOnTargets="ReadLicense;CreateInstall;CreateInstallMaster;CreateCleanMaster;CreateInstallTSQLt;CreateInstallTests;CreateUninstallTestDbs;AddReadme;" />
146+
<Target Name="Build" DependsOnTargets="ReadLicense;CreateInstall;CreateInstallMaster;CreateCleanMaster;CreateInstallTSQLt;CreateInstallTests;CreateUninstallTestDbs;AddReadme;" />
147+
148+
<Target Name="Pack" DependsOnTargets="Build" Inputs="$(OutputPath)$(OutputUninstallTestDbs)" Outputs="$(PackageOutputPath)\$(PackageId).$(Version).nupkg">
149+
<Exec Command="nuget pack -Version $(Version) -OutputDirectory $(PackageOutputPath)" />
150+
</Target>
165151

166152
<Target Name="Clean">
167153
<RemoveDir Directories="$(OutputPath)" Condition="Exists('$(OutputPath)')" />

0 commit comments

Comments
 (0)