Skip to content
This repository was archived by the owner on Apr 28, 2018. It is now read-only.

Updates build to .NET Core *.csproj #181

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,6 @@
"taskName": "clean",
"suppressTaskName": true,
"args": [
"del",
"/Q",
"/S",
".\\src\\*project.lock.json",
"&&",
"rmdir",
"/Q",
"/S",
Expand Down
101 changes: 48 additions & 53 deletions Docker.PowerShell.sln
Original file line number Diff line number Diff line change
@@ -1,53 +1,48 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Docker.PowerShell", "src\Docker.PowerShell\Docker.PowerShell.xproj", "{AD2C487D-EC48-4B97-A977-4C2B52E097BF}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{CDFD41E7-FB95-44DD-866D-2461321EAEFE}"
ProjectSection(SolutionItems) = preProject
global.json = global.json
EndProjectSection
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Docker.DotNet", "src\Docker.DotNet\Docker.DotNet\Docker.DotNet.xproj", "{A9C3E587-DDEC-494B-96E2-BFB4FC34EC74}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{FD49E869-E8F2-4E40-837D-E0329F087D4A}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Docker.DotNet.X509", "src\Docker.DotNet\Docker.DotNet.X509\Docker.DotNet.X509.xproj", "{3EB8C108-EAD7-4A58-AACF-33D9149F4708}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Tar", "src\Tar\Tar.xproj", "{FAC0B799-8BF2-4FCE-8867-D717867403A1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{AD2C487D-EC48-4B97-A977-4C2B52E097BF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AD2C487D-EC48-4B97-A977-4C2B52E097BF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AD2C487D-EC48-4B97-A977-4C2B52E097BF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AD2C487D-EC48-4B97-A977-4C2B52E097BF}.Release|Any CPU.Build.0 = Release|Any CPU
{A9C3E587-DDEC-494B-96E2-BFB4FC34EC74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A9C3E587-DDEC-494B-96E2-BFB4FC34EC74}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A9C3E587-DDEC-494B-96E2-BFB4FC34EC74}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A9C3E587-DDEC-494B-96E2-BFB4FC34EC74}.Release|Any CPU.Build.0 = Release|Any CPU
{3EB8C108-EAD7-4A58-AACF-33D9149F4708}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3EB8C108-EAD7-4A58-AACF-33D9149F4708}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3EB8C108-EAD7-4A58-AACF-33D9149F4708}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3EB8C108-EAD7-4A58-AACF-33D9149F4708}.Release|Any CPU.Build.0 = Release|Any CPU
{FAC0B799-8BF2-4FCE-8867-D717867403A1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FAC0B799-8BF2-4FCE-8867-D717867403A1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FAC0B799-8BF2-4FCE-8867-D717867403A1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FAC0B799-8BF2-4FCE-8867-D717867403A1}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{AD2C487D-EC48-4B97-A977-4C2B52E097BF} = {FD49E869-E8F2-4E40-837D-E0329F087D4A}
{A9C3E587-DDEC-494B-96E2-BFB4FC34EC74} = {FD49E869-E8F2-4E40-837D-E0329F087D4A}
{3EB8C108-EAD7-4A58-AACF-33D9149F4708} = {FD49E869-E8F2-4E40-837D-E0329F087D4A}
{FAC0B799-8BF2-4FCE-8867-D717867403A1} = {FD49E869-E8F2-4E40-837D-E0329F087D4A}
EndGlobalSection
EndGlobal

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26228.9
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{FD49E869-E8F2-4E40-837D-E0329F087D4A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tar", "src\Tar\Tar.csproj", "{A062EE19-A06C-4393-89CE-C1695270DB26}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Docker.PowerShell", "src\Docker.PowerShell\Docker.PowerShell.csproj", "{DEC530F9-0B30-46A2-8872-49BEDCB0FE55}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Docker.DotNet", "src\Docker.DotNet\Docker.DotNet\Docker.DotNet.csproj", "{79A7BA50-A595-458E-9A9C-51F8638B5F46}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Docker.DotNet.X509", "src\Docker.DotNet\Docker.DotNet.X509\Docker.DotNet.X509.csproj", "{32364E3C-9EA5-40D6-85DC-DAA6B754846E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{A062EE19-A06C-4393-89CE-C1695270DB26}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A062EE19-A06C-4393-89CE-C1695270DB26}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A062EE19-A06C-4393-89CE-C1695270DB26}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A062EE19-A06C-4393-89CE-C1695270DB26}.Release|Any CPU.Build.0 = Release|Any CPU
{DEC530F9-0B30-46A2-8872-49BEDCB0FE55}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DEC530F9-0B30-46A2-8872-49BEDCB0FE55}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DEC530F9-0B30-46A2-8872-49BEDCB0FE55}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DEC530F9-0B30-46A2-8872-49BEDCB0FE55}.Release|Any CPU.Build.0 = Release|Any CPU
{79A7BA50-A595-458E-9A9C-51F8638B5F46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{79A7BA50-A595-458E-9A9C-51F8638B5F46}.Debug|Any CPU.Build.0 = Debug|Any CPU
{79A7BA50-A595-458E-9A9C-51F8638B5F46}.Release|Any CPU.ActiveCfg = Release|Any CPU
{79A7BA50-A595-458E-9A9C-51F8638B5F46}.Release|Any CPU.Build.0 = Release|Any CPU
{32364E3C-9EA5-40D6-85DC-DAA6B754846E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{32364E3C-9EA5-40D6-85DC-DAA6B754846E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{32364E3C-9EA5-40D6-85DC-DAA6B754846E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{32364E3C-9EA5-40D6-85DC-DAA6B754846E}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{A062EE19-A06C-4393-89CE-C1695270DB26} = {FD49E869-E8F2-4E40-837D-E0329F087D4A}
{DEC530F9-0B30-46A2-8872-49BEDCB0FE55} = {FD49E869-E8F2-4E40-837D-E0329F087D4A}
{79A7BA50-A595-458E-9A9C-51F8638B5F46} = {FD49E869-E8F2-4E40-837D-E0329F087D4A}
{32364E3C-9EA5-40D6-85DC-DAA6B754846E} = {FD49E869-E8F2-4E40-837D-E0329F087D4A}
EndGlobalSection
EndGlobal
1 change: 1 addition & 0 deletions Nuget.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
<configuration>
<packageSources>
<add key="ps-feed" value="https://powershell.myget.org/F/powershell-core/api/v3/index.json" />
<add key="dotnet-core" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" />
</packageSources>
</configuration>
27 changes: 16 additions & 11 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ pull_requests:
image: WMF 5
init:
- ps: Install-PackageProvider NuGet -Force
- ps: (new-object net.webclient).DownloadFile('https://dotnetcli.blob.core.windows.net/dotnet/Sdk/rel-1.0.0/dotnet-dev-win-x64.latest.exe', "c:/dotnet-install.exe")
- cmd: c:\dotnet-install.exe /install /quiet
- ps: (new-object net.webclient).DownloadFile('https://raw.githubusercontent.com/dotnet/cli/master/scripts/obtain/dotnet-install.ps1', "C:/dotnet-install.ps1")
- ps: C:/dotnet-install.ps1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is working in our project, but we have this code as well:
https://github.com/PowerShell/PowerShell/blob/master/build.psm1#L2088

install:
- ps: Install-Module platyPS -Force -RequiredVersion 0.7.0
- cmd: git submodule update --init --recursive
Expand All @@ -19,17 +19,22 @@ build_script:
- ps: |
$env:PATH = "c:\program files\dotnet;$env:PATH"

$projectFile = "src\Docker.PowerShell\project.json"
$project = Get-Content $projectFile -Raw | ConvertFrom-Json
$version = $project.version
$projectFile = "src\Docker.PowerShell\Docker.PowerShell.csproj"
$projectRawContents = Get-Content $projectFile -Raw
$versionNodes = $projectRawContents | Select-Xml -XPath "/Project/PropertyGroup/Version"
if ($versionNodes.Count -ne 1) {
throw "Invalid number of version nodes found in csproj."
}

$version = $versionNodes.Node.InnerXml

# Tags do not get build versions.
if ($env:APPVEYOR_REPO_TAG -ne "true") {
$version += ".$($env:APPVEYOR_BUILD_VERSION.split("-")[0])"

# Update the project.json version to include the build number.
$project.version = $version
ConvertTo-Json $project -Depth 100 | Out-File -Encoding UTF8 $projectFile
# Update the .csproj version to include the build number.
$newProjectContents = $projectRawContents -replace "<Version>.+</Version>", "<Version>$version</Version>"
$newProjectContents | Out-File -Encoding UTF8 $projectFile
}

# Replace module manifest version.
Expand All @@ -38,8 +43,8 @@ build_script:

Get-Content $projectFile
Get-Content $manifest
- ps: dotnet restore
- ps: dotnet build src/Docker.PowerShell/project.json
- ps: dotnet restore src/Docker.PowerShell/Docker.PowerShell.csproj
- ps: dotnet build src/Docker.PowerShell/Docker.PowerShell.csproj
- ps: dotnet publish -f net46 -o $pwd\bin\Docker\clr -c Release $pwd\src\Docker.PowerShell
- ps: dotnet publish -f netstandard1.6 -o $pwd\bin\Docker\coreclr -c Release $pwd\src\Docker.PowerShell
- ps: nuget install Newtonsoft.Json -Version 9.0.1 -OutputDirectory $pwd\bin
Expand All @@ -57,7 +62,7 @@ test_script:
throw "Module failed to load: no commands found."
}
- ps: git checkout -- src/Docker.PowerShell/Docker.psd1
- ps: git checkout -- src/Docker.PowerShell/project.json
- ps: git checkout -- src/Docker.PowerShell/Docker.PowerShell.csproj
- ps: git config core.autocrlf true
- ps: New-MarkdownHelp -Module Docker -OutputFolder src\Docker.PowerShell\Help -ErrorAction SilentlyContinue
- ps: Update-MarkdownHelp -Path src\Docker.PowerShell\Help
Expand Down
9 changes: 0 additions & 9 deletions global.json

This file was deleted.

2 changes: 1 addition & 1 deletion src/Docker.DotNet
39 changes: 39 additions & 0 deletions src/Docker.PowerShell/Docker.PowerShell.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<IsPackable>true</IsPackable>
<PackageId>Docker.PowerShell</PackageId>
<Description>Docker.PowerShell is a module that allows you to interact with the Docker Remote API via a PowerShell like syntax.</Description>
<Version>0.1.0</Version>
<TargetFrameworks>net46;netstandard1.6</TargetFrameworks>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<AssemblyName>Docker.PowerShell</AssemblyName>
<PackageLicenseUrl>https://github.com/Microsoft/Docker-PowerShell/blob/master/LICENSE</PackageLicenseUrl>
<Copyright>Copyright Microsoft 2015</Copyright>
<PackageTags>Docker Container C# .NET PowerShell</PackageTags>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/Microsoft/Docker-PowerShell</RepositoryUrl>
<NetStandardImplicitPackageVersion Condition=" '$(TargetFramework)' == 'netstandard1.6' ">1.6.1</NetStandardImplicitPackageVersion>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Docker.DotNet\Docker.DotNet.X509\Docker.DotNet.X509.csproj" Version="2.124.3" />
<ProjectReference Include="..\Docker.DotNet\Docker.DotNet\Docker.DotNet.csproj" Version="2.124.3" />
<ProjectReference Include="..\Tar\Tar.csproj" Version="0.1.0-*" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.6' ">
<PackageReference Include="Microsoft.PowerShell.SDK" Version="6.0.0-alpha17" Type="platform" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net46' ">
<PackageReference Include="Microsoft.PowerShell.5.ReferenceAssemblies" Version="1.0.0" Type="build" />
</ItemGroup>
<ItemGroup>
<None Update="Docker.Format.ps1xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Docker.psd1">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Docker.psm1">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>
19 changes: 0 additions & 19 deletions src/Docker.PowerShell/Docker.PowerShell.xproj

This file was deleted.

37 changes: 0 additions & 37 deletions src/Docker.PowerShell/project.json

This file was deleted.

19 changes: 19 additions & 0 deletions src/Tar/Tar.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net46;netstandard1.3;netstandard1.6</TargetFrameworks>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<AssemblyName>Tar</AssemblyName>
<Copyright>Copyright Microsoft 2015</Copyright>
<RepositoryType>git</RepositoryType>
<NetStandardImplicitPackageVersion Condition=" '$(TargetFramework)' == 'netstandard1.6' ">1.6.1</NetStandardImplicitPackageVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(version)' != ''">
<VersionPrefix>$(version)</VersionPrefix>
</PropertyGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.6' ">
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.3' ">
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net46' ">
</ItemGroup>
</Project>
19 changes: 0 additions & 19 deletions src/Tar/Tar.xproj

This file was deleted.

16 changes: 0 additions & 16 deletions src/Tar/project.json

This file was deleted.