Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
Dapper
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tsai
Dapper
Commits
e5cc3ccf
Commit
e5cc3ccf
authored
Apr 10, 2017
by
Samo Prelog
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
workaround for
https://github.com/NuGet/Home/issues/4853
parent
ae7a29a9
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
136 additions
and
40 deletions
+136
-40
.gitignore
.gitignore
+2
-1
Dapper.Contrib.csproj
Dapper.Contrib/Dapper.Contrib.csproj
+6
-2
Dapper.EntityFramework.StrongName.csproj
....EntityFramework/Dapper.EntityFramework.StrongName.csproj
+12
-4
Dapper.EntityFramework.csproj
Dapper.EntityFramework/Dapper.EntityFramework.csproj
+12
-4
Dapper.SqlBuilder.csproj
Dapper.SqlBuilder/Dapper.SqlBuilder.csproj
+6
-2
Dapper.Tests.Contrib.csproj
Dapper.Tests.Contrib/Dapper.Tests.Contrib.csproj
+1
-0
Dapper.Tests.Performance.csproj
Dapper.Tests.Performance/Dapper.Tests.Performance.csproj
+1
-0
Dapper.Tests.csproj
Dapper.Tests/Dapper.Tests.csproj
+1
-0
Dapper.StrongName.csproj
Dapper/Dapper.StrongName.csproj
+9
-3
Dapper.csproj
Dapper/Dapper.csproj
+9
-3
Directory.build.props
Directory.build.props
+62
-0
build.ps1
build.ps1
+15
-21
No files found.
.gitignore
View file @
e5cc3ccf
...
@@ -15,4 +15,5 @@ NuGet.exe
...
@@ -15,4 +15,5 @@ NuGet.exe
Test.DB.*
Test.DB.*
TestResults/
TestResults/
Dapper.Tests/*.sdf
Dapper.Tests/*.sdf
.dotnet/*
.dotnet/*
\ No newline at end of file
.vscode/*
\ No newline at end of file
Dapper.Contrib/Dapper.Contrib.csproj
View file @
e5cc3ccf
...
@@ -16,8 +16,12 @@
...
@@ -16,8 +16,12 @@
<ProjectReference Include="..\Dapper\Dapper.csproj" />
<ProjectReference Include="..\Dapper\Dapper.csproj" />
</ItemGroup>
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net40' OR '$(TargetFramework)' == 'net45' ">
<ItemGroup Condition=" '$(TargetFramework)' == 'net40' OR '$(TargetFramework)' == 'net45' ">
<Reference Include="System.Data" />
<Reference Include="System.Data">
<Reference Include="System.Data.Linq" />
<NuSpecFrameworkAssembly>true</NuSpecFrameworkAssembly>
</Reference>
<Reference Include="System.Data.Linq">
<NuSpecFrameworkAssembly>true</NuSpecFrameworkAssembly>
</Reference>
<Reference Include="System" />
<Reference Include="System" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>
</ItemGroup>
...
...
Dapper.EntityFramework/Dapper.EntityFramework.StrongName.csproj
View file @
e5cc3ccf
...
@@ -15,10 +15,18 @@
...
@@ -15,10 +15,18 @@
<ProjectReference Include="..\Dapper\Dapper.StrongName.csproj" />
<ProjectReference Include="..\Dapper\Dapper.StrongName.csproj" />
<PackageReference Include="EntityFramework" Version="6.1.3" />
<PackageReference Include="EntityFramework" Version="6.1.3" />
<PackageReference Include="Microsoft.SqlServer.Types" Version="11.0.2" />
<PackageReference Include="Microsoft.SqlServer.Types" Version="11.0.2" />
<Reference Include="System.Configuration" />
<Reference Include="System.Configuration">
<Reference Include="System.Data" />
<NuSpecFrameworkAssembly>true</NuSpecFrameworkAssembly>
<Reference Include="System.Data.Linq" />
</Reference>
<Reference Include="System.Xml" />
<Reference Include="System.Data">
<NuSpecFrameworkAssembly>true</NuSpecFrameworkAssembly>
</Reference>
<Reference Include="System.Data.Linq">
<NuSpecFrameworkAssembly>true</NuSpecFrameworkAssembly>
</Reference>
<Reference Include="System.Xml">
<NuSpecFrameworkAssembly>true</NuSpecFrameworkAssembly>
</Reference>
<Reference Include="System" />
<Reference Include="System" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>
</ItemGroup>
...
...
Dapper.EntityFramework/Dapper.EntityFramework.csproj
View file @
e5cc3ccf
...
@@ -12,10 +12,18 @@
...
@@ -12,10 +12,18 @@
<ProjectReference Include="..\Dapper\Dapper.csproj" />
<ProjectReference Include="..\Dapper\Dapper.csproj" />
<PackageReference Include="EntityFramework" Version="6.1.3" />
<PackageReference Include="EntityFramework" Version="6.1.3" />
<PackageReference Include="Microsoft.SqlServer.Types" Version="11.0.2" />
<PackageReference Include="Microsoft.SqlServer.Types" Version="11.0.2" />
<Reference Include="System.Configuration" />
<Reference Include="System.Configuration">
<Reference Include="System.Data" />
<NuSpecFrameworkAssembly>true</NuSpecFrameworkAssembly>
<Reference Include="System.Data.Linq" />
</Reference>
<Reference Include="System.Xml" />
<Reference Include="System.Data">
<NuSpecFrameworkAssembly>true</NuSpecFrameworkAssembly>
</Reference>
<Reference Include="System.Data.Linq">
<NuSpecFrameworkAssembly>true</NuSpecFrameworkAssembly>
</Reference>
<Reference Include="System.Xml">
<NuSpecFrameworkAssembly>true</NuSpecFrameworkAssembly>
</Reference>
<Reference Include="System" />
<Reference Include="System" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>
</ItemGroup>
...
...
Dapper.SqlBuilder/Dapper.SqlBuilder.csproj
View file @
e5cc3ccf
...
@@ -14,8 +14,12 @@
...
@@ -14,8 +14,12 @@
<ProjectReference Include="..\Dapper\Dapper.csproj" />
<ProjectReference Include="..\Dapper\Dapper.csproj" />
</ItemGroup>
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net40' OR '$(TargetFramework)' == 'net45' ">
<ItemGroup Condition=" '$(TargetFramework)' == 'net40' OR '$(TargetFramework)' == 'net45' ">
<Reference Include="System.Data" />
<Reference Include="System.Data">
<Reference Include="System.Data.Linq" />
<NuSpecFrameworkAssembly>true</NuSpecFrameworkAssembly>
</Reference>
<Reference Include="System.Data.Linq">
<NuSpecFrameworkAssembly>true</NuSpecFrameworkAssembly>
</Reference>
<Reference Include="System" />
<Reference Include="System" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>
</ItemGroup>
...
...
Dapper.Tests.Contrib/Dapper.Tests.Contrib.csproj
View file @
e5cc3ccf
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
<OutputType>Exe</OutputType>
<OutputType>Exe</OutputType>
<GenerateDocumentationFile>false</GenerateDocumentationFile>
<GenerateDocumentationFile>false</GenerateDocumentationFile>
<TargetFramework>netcoreapp1.0</TargetFramework>
<TargetFramework>netcoreapp1.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp1.0' ">
<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp1.0' ">
<DefineConstants>$(DefineConstants);COREFX;</DefineConstants>
<DefineConstants>$(DefineConstants);COREFX;</DefineConstants>
...
...
Dapper.Tests.Performance/Dapper.Tests.Performance.csproj
View file @
e5cc3ccf
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
<OutputType>Exe</OutputType>
<OutputType>Exe</OutputType>
<GenerateDocumentationFile>false</GenerateDocumentationFile>
<GenerateDocumentationFile>false</GenerateDocumentationFile>
<TargetFrameworks>net462</TargetFrameworks>
<TargetFrameworks>net462</TargetFrameworks>
<IsPackable>false</IsPackable>
</PropertyGroup>
</PropertyGroup>
<ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Dapper\Dapper.csproj" />
<ProjectReference Include="..\Dapper\Dapper.csproj" />
...
...
Dapper.Tests/Dapper.Tests.csproj
View file @
e5cc3ccf
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
<TargetFrameworks>net452;netcoreapp1.0</TargetFrameworks>
<TargetFrameworks>net452;netcoreapp1.0</TargetFrameworks>
<IsPackable>false</IsPackable>
</PropertyGroup>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'net452' ">
<PropertyGroup Condition=" '$(TargetFramework)' == 'net452' ">
...
...
Dapper/Dapper.StrongName.csproj
View file @
e5cc3ccf
...
@@ -10,9 +10,15 @@
...
@@ -10,9 +10,15 @@
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>
</PropertyGroup>
</PropertyGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net40' OR '$(TargetFramework)' == 'net45' OR '$(TargetFramework)' == 'net451' ">
<ItemGroup Condition=" '$(TargetFramework)' == 'net40' OR '$(TargetFramework)' == 'net45' OR '$(TargetFramework)' == 'net451' ">
<Reference Include="System.Data" />
<Reference Include="System.Data">
<Reference Include="System.Xml" />
<NuSpecFrameworkAssembly>true</NuSpecFrameworkAssembly>
<Reference Include="System.Xml.Linq" />
</Reference>
<Reference Include="System.Xml">
<NuSpecFrameworkAssembly>true</NuSpecFrameworkAssembly>
</Reference>
<Reference Include="System.Xml.Linq">
<NuSpecFrameworkAssembly>true</NuSpecFrameworkAssembly>
</Reference>
<Reference Include="System" />
<Reference Include="System" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>
</ItemGroup>
...
...
Dapper/Dapper.csproj
View file @
e5cc3ccf
...
@@ -8,9 +8,15 @@
...
@@ -8,9 +8,15 @@
<TargetFrameworks>net40;net45;net451;netstandard1.3</TargetFrameworks>
<TargetFrameworks>net40;net45;net451;netstandard1.3</TargetFrameworks>
</PropertyGroup>
</PropertyGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net40' OR '$(TargetFramework)' == 'net45' OR '$(TargetFramework)' == 'net451' ">
<ItemGroup Condition=" '$(TargetFramework)' == 'net40' OR '$(TargetFramework)' == 'net45' OR '$(TargetFramework)' == 'net451' ">
<Reference Include="System.Data" />
<Reference Include="System.Data">
<Reference Include="System.Xml" />
<NuSpecFrameworkAssembly>true</NuSpecFrameworkAssembly>
<Reference Include="System.Xml.Linq" />
</Reference>
<Reference Include="System.Xml">
<NuSpecFrameworkAssembly>true</NuSpecFrameworkAssembly>
</Reference>
<Reference Include="System.Xml.Linq">
<NuSpecFrameworkAssembly>true</NuSpecFrameworkAssembly>
</Reference>
<Reference Include="System" />
<Reference Include="System" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>
</ItemGroup>
...
...
Directory.build.props
View file @
e5cc3ccf
...
@@ -33,4 +33,66 @@
...
@@ -33,4 +33,66 @@
<DotNetCliToolReference Include="dotnet-sourcelink" Version="2.0.2" />
<DotNetCliToolReference Include="dotnet-sourcelink" Version="2.0.2" />
<DotNetCliToolReference Include="dotnet-sourcelink-git" Version="2.0.2" />
<DotNetCliToolReference Include="dotnet-sourcelink-git" Version="2.0.2" />
</ItemGroup>
</ItemGroup>
<!--
This is a temporary workaround for Nuget Issue #4853 - https://github.com/NuGet/Home/issues/4853#issuecomment-292719597
Ideally this belongs into Directory.build.targets, but that doesn't work either - https://github.com/Microsoft/msbuild/issues/1721
-->
<Target Name="_CleanNuSpec" DependsOnTargets="_GenerateProjectRestoreGraph">
<PropertyGroup>
<_NuSpecPrefix>$(RestoreOutputAbsolutePath)$(_RestoreProjectName).$(_RestoreProjectVersion)</_NuSpecPrefix>
<_NuSpec>$(_NuSpecPrefix).nuspec</_NuSpec>
<_NuSpecPatched>$(_NuSpecPrefix).patched.nuspec</_NuSpecPatched>
</PropertyGroup>
<Delete Files="$(_NuSpec)" Condition="Exists('$(_NuSpec)')" />
<Delete Files="$(_NuSpecPatched)" Condition="Exists('$(_NuSpecPatched)')" />
</Target>
<Target Name="_ExtractReferences">
<ItemGroup>
<_ExtractReferenceTarget Include="$(TargetFrameworks)" />
</ItemGroup>
<MSBuild Projects="$(MSBuildProjectFullPath)" Targets="ExtractReferencesPerTarget" Properties="TargetFramework=%(_ExtractReferenceTarget.Identity)">
<Output TaskParameter="TargetOutputs" ItemName="_Reference" />
</MSBuild>
</Target>
<Target Name="ExtractReferencesPerTarget" Outputs="@(_AssemblyReference)">
<ItemGroup>
<_AssemblyReference Include="@(Reference)" Condition="'%(Reference.NuSpecFrameworkAssembly)' == 'true'">
<NuSpecFrameworkAssembly>$(TargetFramework)</NuSpecFrameworkAssembly>
</_AssemblyReference>
</ItemGroup>
</Target>
<UsingTask TaskName="AddFrameworkAssemblies" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll" >
<ParameterGroup>
<NuSpecFile ParameterType="System.String" Required="true" />
<PatchedNuSpecFile ParameterType="System.String" Required="true" />
<References ParameterType="Microsoft.Build.Framework.ITaskItem[]" Required="true" />
</ParameterGroup>
<Task>
<Code Type="Fragment" Language="cs"><![CDATA[
var content = System.IO.File.ReadAllText(NuSpecFile);
var end = content.IndexOf("</metadata>");
var newContent = content.Substring(0, end);
newContent += "<frameworkAssemblies>\n";
foreach (var r in References)
{
var targetFrameworksStr = r.GetMetadata("NuSpecFrameworkAssembly");
foreach (var targetFramework in (targetFrameworksStr ?? "").Split(new char[] {',', ' ', ';'}, System.StringSplitOptions.RemoveEmptyEntries))
{
newContent += " <frameworkAssembly assemblyName=\"" + r.ItemSpec + "\" targetFramework=\"" + targetFramework + "\" />\n";
}
}
newContent += " </frameworkAssemblies>\n ";
newContent += content.Substring(end);
File.WriteAllText(PatchedNuSpecFile, newContent);
]]></Code>
</Task>
</UsingTask>
<Target Name="PackWithFrameworkAssemblies" DependsOnTargets="_CleanNuSpec;_ExtractReferences;Pack" Condition="'$(IsPackable)' == 'true'">
<Message Text="Repackaging -> '$(MSBuildProjectName)' from '$(_NuSpecPatched)'" Importance="high" Condition=" '@(_Reference)' != '' " />
<AddFrameworkAssemblies NuSpecFile="$(_NuSpec)" PatchedNuSpecFile="$(_NuSpecPatched)" References="@(_Reference)" Condition=" '@(_Reference)' != '' " />
<MSBuild Projects="$(MSBuildProjectFullPath)" Targets="Pack" Properties="NuspecFile=$(_NuSpecPatched)" Condition=" '@(_Reference)' != '' " />
</Target>
</Project>
</Project>
\ No newline at end of file
build.ps1
View file @
e5cc3ccf
param
(
param
(
[
parameter
(
Position
=
0
)][
string
]
$PreReleaseSuffix
=
''
[
parameter
(
Position
=
0
)][
string
]
$PreReleaseSuffix
=
''
,
[
switch
]
$SkipTests
=
$false
)
)
$packageOutputFolder
=
"
$PSScriptRoot
\.nupkgs"
$packageOutputFolder
=
"
$PSScriptRoot
\.nupkgs"
...
@@ -14,29 +15,22 @@ if ($LASTEXITCODE -ne 0)
...
@@ -14,29 +15,22 @@ if ($LASTEXITCODE -ne 0)
# Build all
# Build all
Write-Host
"Building..."
-ForegroundColor
"Green"
Write-Host
"Building..."
-ForegroundColor
"Green"
Get-ChildItem
"Dapper*.csproj"
-Recurse |
msbuild
"
$PSScriptRoot
\Dapper.sln"
/m /v:m /nologo /t:Build /p:Configuration
=
Debug
"/p:PackageVersionSuffix=
$PreReleaseSuffix
"
ForEach
-Object
{
if
(
$PreReleaseSuffix
)
{
& dotnet build
"
$_
"
--version-suffix
"
$PreReleaseSuffix
"
}
else
{
& dotnet build
"
$_
"
}
}
# Run tests
# Run tests
Write-Host
"Running Tests..."
-ForegroundColor
"Green"
if
(
$SkipTests
)
Get-ChildItem
"Dapper.Test*.csproj"
-Recurse |
{
ForEach
-Object
{
Write-Host
"Skipping Tests..."
-ForegroundColor
"Yellow"
& dotnet
test
"
$_
"
}
else
{
Write-Host
"Running Tests..."
-ForegroundColor
"Green"
Get-ChildItem
"Dapper.Test*.csproj"
-Recurse |
ForEach
-Object
{
& dotnet
test
"
$_
"
}
}
}
# Package all
# Package all
Write-Host
"Packaging..."
-ForegroundColor
"Green"
Write-Host
"Packaging..."
-ForegroundColor
"Green"
Get-ChildItem
"Dapper*.csproj"
-Recurse |
Where
-Object
{
$_
.Name -NotLike
"*.Tests*"
}
|
msbuild
"
$PSScriptRoot
\Dapper.sln"
/m /v:m /nologo
"/t:Build;PackWithFrameworkAssemblies"
/p:Configuration
=
Release
"/p:PackageOutputPath=
$packageOutputFolder
"
"/p:PackageVersionSuffix=
$PreReleaseSuffix
"
ForEach
-Object
{
\ No newline at end of file
if
(
$PreReleaseSuffix
)
{
& dotnet pack
"
$_
"
-c Release -o
"
$packageOutputFolder
"
--version-suffix
"
$PreReleaseSuffix
"
}
else
{
& dotnet pack
"
$_
"
-c Release -o
"
$packageOutputFolder
"
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment