Skip to content

Commit

Permalink
Convert projects to .NET Standard/Core
Browse files Browse the repository at this point in the history
  • Loading branch information
rohitramu committed Jul 19, 2018
1 parent 5b2dd71 commit 0eaa187
Show file tree
Hide file tree
Showing 70 changed files with 1,105 additions and 599 deletions.
15 changes: 9 additions & 6 deletions PowerShellGraphSDKGenerator.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,27 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27428.2015
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GraphODataPowerShellSDKWriter", "src\GraphODataPowerShellWriter\GraphODataPowerShellSDKWriter.csproj", "{3B8C0953-5E14-4D77-98F3-411CA0A3CE78}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PowerShellGraphSDK", "src\PowerShellGraphSDK\PowerShellGraphSDK.csproj", "{831E21CA-9580-4B96-A239-2F85190B5E6C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PowerShellGraphSDK", "src\PowerShellGraphSDK\PowerShellGraphSDK.csproj", "{9D827326-2642-428E-8D87-1D0E7990CF7A}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GraphODataPowerShellSDKWriter", "src\GraphODataPowerShellWriter\GraphODataPowerShellSDKWriter.csproj", "{3B8C0953-5E14-4D77-98F3-411CA0A3CE78}"
ProjectSection(ProjectDependencies) = postProject
{831E21CA-9580-4B96-A239-2F85190B5E6C} = {831E21CA-9580-4B96-A239-2F85190B5E6C}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{831E21CA-9580-4B96-A239-2F85190B5E6C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{831E21CA-9580-4B96-A239-2F85190B5E6C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{831E21CA-9580-4B96-A239-2F85190B5E6C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{831E21CA-9580-4B96-A239-2F85190B5E6C}.Release|Any CPU.Build.0 = Release|Any CPU
{3B8C0953-5E14-4D77-98F3-411CA0A3CE78}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3B8C0953-5E14-4D77-98F3-411CA0A3CE78}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3B8C0953-5E14-4D77-98F3-411CA0A3CE78}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3B8C0953-5E14-4D77-98F3-411CA0A3CE78}.Release|Any CPU.Build.0 = Release|Any CPU
{9D827326-2642-428E-8D87-1D0E7990CF7A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9D827326-2642-428E-8D87-1D0E7990CF7A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9D827326-2642-428E-8D87-1D0E7990CF7A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9D827326-2642-428E-8D87-1D0E7990CF7A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
17 changes: 11 additions & 6 deletions Scripts/build.ps1 → Scripts/build-full.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
param (
[string]$BuildTargets = 'Rebuild',
[string]$BuildTargets = 'Restore;Rebuild',
[string]$WorkingDirectory = "$(Get-Location)",
[string]$OutputPath = "$WorkingDirectory\bin\$($env:buildConfiguration)",
[string]$OutputPath,
[string]$MSBuildExe32 = '%ProgramFiles(x86)%\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe',
[string]$MSBuildExe64 = '%ProgramFiles%\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe',
[string]$Verbosity = 'minimal',
Expand All @@ -10,7 +10,6 @@ param (
)

# Expand environment variables
$BuildTargets = ([System.Environment]::ExpandEnvironmentVariables($BuildTargets))
$WorkingDirectory = ([System.Environment]::ExpandEnvironmentVariables($WorkingDirectory))
$OutputPath = ([System.Environment]::ExpandEnvironmentVariables($OutputPath))
$MSBuildExe32 = ([System.Environment]::ExpandEnvironmentVariables($MSBuildExe32))
Expand Down Expand Up @@ -49,19 +48,23 @@ if (-Not (Test-Path $msBuildExe)) {
# Compile the MSBuild arguments
$MSBuildArguments = @(
"/p:Configuration=$($env:buildConfiguration)",
"/p:OutputPath=`"$OutputPath`"",
"/t:$BuildTargets",
"/p:UseSharedCompilation=false",
"/nr:false",
"/v:$Verbosity",
"/ignore:.sln"
)

# Set the output path if required
if (-Not [string]::IsNullOrWhiteSpace($OutputPath))
{
$MSBuildArguments += "/p:OutputPath=`"$OutputPath`""
}

# Set the assembly name if required
if (-Not [string]::IsNullOrWhiteSpace($AssemblyName))
{
$MSBuildArguments += "/p:AssemblyName=$AssemblyName"
$MSBuildArguments += "/p:RootNamespace=$AssemblyName"
}

# Select the default graph schema if one was not provided
Expand All @@ -83,11 +86,13 @@ if ($GraphSchema)
# Run MSBuild in the given working directory
Push-Location $WorkingDirectory
try {
$command = "`"$msBuildExe`" $MSBuildArguments"
Write-Host $command -f DarkCyan
& $msBuildExe $MSBuildArguments
if (-Not $?)
{
throw "MSBuild exited with error code '$LastExitCode'"
}
} finally {
Pop-Location
}
}
50 changes: 50 additions & 0 deletions Scripts/build-portable.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
param (
[string]$WorkingDirectory = "$(Get-Location)",
[string]$OutputPath,
[string]$Verbosity = 'minimal',
[string]$AssemblyName
)

# Expand environment variables
$WorkingDirectory = ([System.Environment]::ExpandEnvironmentVariables($WorkingDirectory))
$OutputPath = ([System.Environment]::ExpandEnvironmentVariables($OutputPath))

# Make sure the dotnet command is installed
$dotnetCliVersion = Invoke-Expression 'dotnet --version'

# If dotnet is not installed, attempt to install it
if ($dotnetCliVersion.Contains('\n') -or [string]::IsNullOrWhitespace($dotnetCliVersion)) {
& $env:dotnetInstallScript
}

# Compile the MSBuild arguments
$BuildArguments = @(
"--configuration $($env:buildConfiguration)",
"--verbosity $Verbosity"
)

# Set the output path if required
if (-Not [string]::IsNullOrWhiteSpace($OutputPath))
{
$MSBuildArguments += "--output `"$OutputPath`""
}

# Set the assembly name if required
if (-Not [string]::IsNullOrWhiteSpace($AssemblyName))
{
$BuildArguments += "/p:AssemblyName=$AssemblyName"
}

# Run MSBuild in the given working directory
Push-Location $WorkingDirectory
try {
$command = "dotnet build $BuildArguments"
Write-Host $command -f DarkCyan
Invoke-Expression $command
if (-Not $?)
{
throw "MSBuild exited with error code '$LastExitCode'"
}
} finally {
Pop-Location
}
Loading

0 comments on commit 0eaa187

Please sign in to comment.