Skip to content

Commit

Permalink
First major commit in support of #87
Browse files Browse the repository at this point in the history
Migrated first 3 major projects over to .NET Core/Standard 2.0
- adjusted configuration handling (still some work left here)
- adjusted logging setup (still some work left here)
- added support for running as a Windows Service
- cleaned up namespace naming conventions

NOTE, unit tests have not yet been moved over.
  • Loading branch information
ebekker committed Jan 29, 2018
1 parent 2e1f548 commit 7a88124
Show file tree
Hide file tree
Showing 83 changed files with 5,708 additions and 34 deletions.
13 changes: 12 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "TugDSC.Server.WebAppHost - .NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
//"preLaunchTask": "build",
"program": "${workspaceRoot}/src/TugDSC.Server.WebAppHost/bin/Debug/netcoreapp2.0/TugDSC.Server.WebAppHost.dll",
"args": ["/h:host_foo:some:nested:value=host_bar", "/c:app_foo=app_bar"],
"cwd": "${workspaceRoot}/src/TugDSC.Server.WebAppHost",
"stopAtEntry": false,
"console": "internalConsole"
},
{
"name": "Tug.Client - .NET Core Launch (console)",
"type": "coreclr",
Expand Down Expand Up @@ -54,7 +65,7 @@
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach",
"processId": "${command.pickProcess}"
"processId": "${command:pickProcess}"
}
]
}
9 changes: 9 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
// Place your settings in this file to overwrite default and user settings.
{
"cSpell.words": [
"asms",
"assms",
"authz",
"csum",
"dotnetfw",
"ext",
"rtasm"
]
}
56 changes: 27 additions & 29 deletions TugDSC.common.props
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<PropertyGroup>
<SharedSourceDir>$(MSBuildThisFileDirectory)/src/shared</SharedSourceDir>
<NETStandardMoniker>netstandard2.0</NETStandardMoniker>
<NETCoreAppMoniker>netcoreapp2.0</NETCoreAppMoniker>
<NETFrameworkMoniker>net461</NETFrameworkMoniker>
</PropertyGroup>
<!--
- References:
- * https://docs.microsoft.com/en-us/dotnet/core/tools/csproj
- * https://docs.microsoft.com/en-us/visualstudio/msbuild/common-msbuild-project-properties
- * https://github.com/dotnet/sdk/issues/2#issuecomment-238368991
-->

<PropertyGroup>
<SharedSourceDir>$(MSBuildThisFileDirectory)/src/shared</SharedSourceDir>
<NETStandardMoniker>netstandard2.0</NETStandardMoniker>
<NETCoreAppMoniker>netcoreapp2.0</NETCoreAppMoniker>

<!-- Disabling .NET Framework for now -->
<!-- <NETFrameworkMoniker>net461</NETFrameworkMoniker> -->
<NETFrameworkMoniker></NETFrameworkMoniker>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == '$(NETStandardMoniker)' ">
<DefineConstants>$(DefineConstants);DOTNET_CORE</DefineConstants>
Expand All @@ -20,28 +30,16 @@
</PropertyGroup>


<PropertyGroup>
<NeutralLanguage>en-US</NeutralLanguage>
<Authors>github.com/PowerShellOrg/tug/graphs/contributors</Authors>
<!--
* https://docs.microsoft.com/en-us/dotnet/csharp/misc/cs0169
The private field 'class member' is never used
* https://docs.microsoft.com/en-us/dotnet/csharp/misc/cs0649
Field 'field' is never assigned to, and will always have its default value 'value'
-->
<CommonNoWarn>CS0169;CS0649</CommonNoWarn>
</PropertyGroup>

<PropertyGroup>
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
<GenerateAssemblyDescriptionAttribute>false</GenerateAssemblyDescriptionAttribute>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<GenerateAssemblyCopyrightAttribute>false</GenerateAssemblyCopyrightAttribute>
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
<GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute>
<GenerateAssemblyInformationalVersionAttribute>false</GenerateAssemblyInformationalVersionAttribute>
</PropertyGroup>
<PropertyGroup>
<NeutralLanguage>en-US</NeutralLanguage>
<Authors>github.com/PowerShellOrg/tug/graphs/contributors</Authors>
<!--
* https://docs.microsoft.com/en-us/dotnet/csharp/misc/cs0169
The private field 'class member' is never used
* https://docs.microsoft.com/en-us/dotnet/csharp/misc/cs0649
Field 'field' is never assigned to, and will always have its default value 'value'
-->
<CommonNoWarn>CS0169;CS0649</CommonNoWarn>
</PropertyGroup>

</Project>
54 changes: 54 additions & 0 deletions TugDSC.sharedasm.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<!--
- References:
- * https://github.com/dotnet/sdk/issues/2#issuecomment-238368991
-->

<Import Project="$(MSBuildThisFileDirectory)/TugDSC.common.props" />


<PropertyGroup>
<!-- Versioning - base is static, build is computed by CI -->
<BuildNum Condition="$(BuildNum)==''">0</BuildNum>
<CommonVersion>0.7.0.$(BuildNum)</CommonVersion>
<AssemblyVersion>$(CommonVersion)</AssemblyVersion>
<FileVersion>$(CommonVersion)</FileVersion>
<Version>$(CommonVersion)-ea</Version>
</PropertyGroup>


<ItemGroup>
<Compile Include="$(SharedSourceDir)/SharedAssemblyInfo.cs" />
<!--
<Compile Include="$(SharedSourceDir)/SharedAssemblyVersionInfo.cs" />
-->
<Compile Include="$(SharedSourceDir)/SharedGlobalSuppressions.cs" />
</ItemGroup>

<!--
- We disable the generation of these by MSBuild because we pull in common
- manifest properties from shared source files which are pulled in above
-->
<PropertyGroup>
<!-- These need to be defined in the project-specific build file -->
<GenerateAssemblyTitleAttribute>true</GenerateAssemblyTitleAttribute>
<GenerateAssemblyDescriptionAttribute>true</GenerateAssemblyDescriptionAttribute>
</PropertyGroup>
<PropertyGroup>
<!-- These are defined globally in a shared source file - we don't define these
in build configuration properties because not all of them support that. -->
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<GenerateAssemblyCopyrightAttribute>false</GenerateAssemblyCopyrightAttribute>
<GenerateAssemblyCopyrightAttribute>false</GenerateAssemblyCopyrightAttribute>
</PropertyGroup>
<PropertyGroup>
<!-- These are computed dynamically -->
<GenerateAssemblyVersionAttribute>true</GenerateAssemblyVersionAttribute>
<GenerateAssemblyFileVersionAttribute>true</GenerateAssemblyFileVersionAttribute>
<GenerateAssemblyInformationalVersionAttribute>true</GenerateAssemblyInformationalVersionAttribute>
<GenerateAssemblyConfigurationAttribute>true</GenerateAssemblyConfigurationAttribute>
</PropertyGroup>

</Project>
69 changes: 69 additions & 0 deletions TugDSC.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26124.0
MinimumVisualStudioVersion = 15.0.26124.0
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{BA29CE93-33EE-419B-A855-DA934573FA83}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TugDSC.Abstractions", "src\TugDSC.Abstractions\TugDSC.Abstractions.csproj", "{97DECA03-C0C3-4F41-A0FE-F51CA949D501}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TugDSC.Server.Abstractions", "src\TugDSC.Server.Abstractions\TugDSC.Server.Abstractions.csproj", "{8BAD111C-0371-4F65-BAD7-1B88FADC84E0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TugDSC.Server.WebAppHost", "src\TugDSC.Server.WebAppHost\TugDSC.Server.WebAppHost.csproj", "{77F0AAAE-3518-46A7-A0E2-E09A36630300}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{97DECA03-C0C3-4F41-A0FE-F51CA949D501}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{97DECA03-C0C3-4F41-A0FE-F51CA949D501}.Debug|Any CPU.Build.0 = Debug|Any CPU
{97DECA03-C0C3-4F41-A0FE-F51CA949D501}.Debug|x64.ActiveCfg = Debug|x64
{97DECA03-C0C3-4F41-A0FE-F51CA949D501}.Debug|x64.Build.0 = Debug|x64
{97DECA03-C0C3-4F41-A0FE-F51CA949D501}.Debug|x86.ActiveCfg = Debug|x86
{97DECA03-C0C3-4F41-A0FE-F51CA949D501}.Debug|x86.Build.0 = Debug|x86
{97DECA03-C0C3-4F41-A0FE-F51CA949D501}.Release|Any CPU.ActiveCfg = Release|Any CPU
{97DECA03-C0C3-4F41-A0FE-F51CA949D501}.Release|Any CPU.Build.0 = Release|Any CPU
{97DECA03-C0C3-4F41-A0FE-F51CA949D501}.Release|x64.ActiveCfg = Release|x64
{97DECA03-C0C3-4F41-A0FE-F51CA949D501}.Release|x64.Build.0 = Release|x64
{97DECA03-C0C3-4F41-A0FE-F51CA949D501}.Release|x86.ActiveCfg = Release|x86
{97DECA03-C0C3-4F41-A0FE-F51CA949D501}.Release|x86.Build.0 = Release|x86
{8BAD111C-0371-4F65-BAD7-1B88FADC84E0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8BAD111C-0371-4F65-BAD7-1B88FADC84E0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8BAD111C-0371-4F65-BAD7-1B88FADC84E0}.Debug|x64.ActiveCfg = Debug|x64
{8BAD111C-0371-4F65-BAD7-1B88FADC84E0}.Debug|x64.Build.0 = Debug|x64
{8BAD111C-0371-4F65-BAD7-1B88FADC84E0}.Debug|x86.ActiveCfg = Debug|x86
{8BAD111C-0371-4F65-BAD7-1B88FADC84E0}.Debug|x86.Build.0 = Debug|x86
{8BAD111C-0371-4F65-BAD7-1B88FADC84E0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8BAD111C-0371-4F65-BAD7-1B88FADC84E0}.Release|Any CPU.Build.0 = Release|Any CPU
{8BAD111C-0371-4F65-BAD7-1B88FADC84E0}.Release|x64.ActiveCfg = Release|x64
{8BAD111C-0371-4F65-BAD7-1B88FADC84E0}.Release|x64.Build.0 = Release|x64
{8BAD111C-0371-4F65-BAD7-1B88FADC84E0}.Release|x86.ActiveCfg = Release|x86
{8BAD111C-0371-4F65-BAD7-1B88FADC84E0}.Release|x86.Build.0 = Release|x86
{77F0AAAE-3518-46A7-A0E2-E09A36630300}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{77F0AAAE-3518-46A7-A0E2-E09A36630300}.Debug|Any CPU.Build.0 = Debug|Any CPU
{77F0AAAE-3518-46A7-A0E2-E09A36630300}.Debug|x64.ActiveCfg = Debug|x64
{77F0AAAE-3518-46A7-A0E2-E09A36630300}.Debug|x64.Build.0 = Debug|x64
{77F0AAAE-3518-46A7-A0E2-E09A36630300}.Debug|x86.ActiveCfg = Debug|x86
{77F0AAAE-3518-46A7-A0E2-E09A36630300}.Debug|x86.Build.0 = Debug|x86
{77F0AAAE-3518-46A7-A0E2-E09A36630300}.Release|Any CPU.ActiveCfg = Release|Any CPU
{77F0AAAE-3518-46A7-A0E2-E09A36630300}.Release|Any CPU.Build.0 = Release|Any CPU
{77F0AAAE-3518-46A7-A0E2-E09A36630300}.Release|x64.ActiveCfg = Release|x64
{77F0AAAE-3518-46A7-A0E2-E09A36630300}.Release|x64.Build.0 = Release|x64
{77F0AAAE-3518-46A7-A0E2-E09A36630300}.Release|x86.ActiveCfg = Release|x86
{77F0AAAE-3518-46A7-A0E2-E09A36630300}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{97DECA03-C0C3-4F41-A0FE-F51CA949D501} = {BA29CE93-33EE-419B-A855-DA934573FA83}
{8BAD111C-0371-4F65-BAD7-1B88FADC84E0} = {BA29CE93-33EE-419B-A855-DA934573FA83}
{77F0AAAE-3518-46A7-A0E2-E09A36630300} = {BA29CE93-33EE-419B-A855-DA934573FA83}
EndGlobalSection
EndGlobal
52 changes: 52 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,24 @@ version: 0.6.0.{build}
branches:
only:
- ci
- ci2
- migrate-sdk104
skip_tags: true
init:
- ps: >-
## Need to delete .NET Core 1.1 SDK components to roll back to 1.0
## because of some incompatible behavior (such as during dotnet test)
del -Recurse -Force "C:\Program Files\dotnet\sdk\1.0.0-preview2-1-003177"
del -Recurse -Force "C:\Program Files\dotnet\shared\Microsoft.NETCore.App\1.1.0"
del -Recurse -Force 'C:\Program Files\dotnet\swidtag\Microsoft .NET Core 1.1.0 - SDK 1.0.0 Preview 2.1-003177 (x64).swidtag'
## Check if we should Enable RDP access
if ([int]$((Resolve-DnsName blockrdp.tug-ci.tug.bkkr.us -Type TXT).Text)) {
## As per: https://www.appveyor.com/docs/how-to/rdp-to-build-worker/
iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
Expand All @@ -28,79 +35,124 @@ hosts:
install:
- ps: >-
## We want to setup a local PowerShell DSC Pull Server to support
## some of the unit tests that validate protocol compatibility
Install-WindowsFeature PowerShell,PowerShell-ISE,DSC-Service
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force
Install-Module xWebAdministration -Force
Install-Module xPSDesiredStateConfiguration -Force
Start-Service W3SVC ## This is normally not running on AV
## Run it once to create new cert
.\tools\ci\DSC\DscPullServer.dsc.ps1 -RegistrationKey c3ea5066-ce5a-4d12-a42a-850be287b2d8
## Run it a second time to install cert
.\tools\ci\DSC\DscPullServer.dsc.ps1 -RegistrationKey c3ea5066-ce5a-4d12-a42a-850be287b2d8
## Publish a Test MOF used by unit tests
.\tools\ci\DSC\TestConfig1.dsc.ps1
## Copy over exactly as found
.\tools\ci\DSC\StaticTestConfig-copy.ps1
.\tools\ci\DSC\xPSDesiredStateConfiguration-copy.ps1
build_script:
- ps: >-
## With a little help from:
## https://github.com/StevenLiekens/dotnet-core-appveyor/blob/master/appveyor.yml
#$Env:LABEL = "CI" + $Env:APPVEYOR_BUILD_NUMBER.PadLeft(5, "0")
appveyor-retry dotnet restore -v Minimal
dotnet build "src\Tug.Base" #-c %CONFIGURATION% --no-dependencies --version-suffix %LABEL%
dotnet build "src\Tug.Client" #-c %CONFIGURATION% --no-dependencies --version-suffix %LABEL%
dotnet build "src\Tug.Server.Base" #-c %CONFIGURATION% --no-dependencies --version-suffix %LABEL%
dotnet build "src\Tug.Server" #-c %CONFIGURATION% --no-dependencies --version-suffix %LABEL%
dotnet build "src\Tug.Server.Providers.Ps5DscHandler" #-c %CONFIGURATION% --no-dependencies --version-suffix %LABEL%
dotnet build "test\Tug.Ext-tests" #-c %CONFIGURATION% --no-dependencies --version-suffix %LABEL%
dotnet build "test\Tug.Ext-tests-aux" #-c %CONFIGURATION% --no-dependencies --version-suffix %LABEL%
dotnet build "test\client\Tug.Client-tests"
dotnet build "test\server\Tug.Server-itests"
test_script:
- ps: >-
## We're only testing .NET Framework for now because there are some
## inconsistencies on AV for .NET Core that are failing dynamic loading
dotnet test "test\Tug.Ext-tests\Tug.Ext-tests.csproj" -f net452
dotnet test "test\client\Tug.Client-tests\Tug.Client-tests.csproj"
## Only testing .NET Framework for now -- this test assembly is based on
## 4.6.2 because it's the minimum needed to support ASP.NET Core TestHost
dotnet test "test\server\Tug.Server-itests\Tug.Server-itests.csproj" -f net462
deploy: off
on_success:
- ps: >-
## If builds and tests are successful, package up
## some pre-configured bundles and publish them
$bundlePath = '.\src\bundles\Tug.Server-ps5'
$modulePath = $bundlePath + '\bin\posh-modules\Tug.Server-ps5'
dotnet build $bundlePath
& "$bundlePath\build-posh-module.cmd"
## Push bundle to a pre-release Nuget Repo
$nugetUrl = $env:NUGET_TUGPRE_URL
$nugetKey = $env:NUGET_TUGPRE_API_KEY
Update-ModuleManifest -Path $modulePath\Tug.Server-ps5.psd1 -ModuleVersion $env:APPVEYOR_BUILD_VERSION
Register-PSRepository -Name tug-pre -PackageManagementProvider nuget -SourceLocation $nugetUrl -PublishLocation $nugetUrl
Publish-Module -Path $modulePath -Repository tug-pre -NuGetApiKey $nugetKey
on_finish:
- ps: >-
## Check if we should Enable RDP access
if ([int]$((Resolve-DnsName blockrdp.tug-ci.tug.bkkr.us -Type TXT).Text)) {
## As per: https://www.appveyor.com/docs/how-to/rdp-to-build-worker/
$blockRdp = $true
Expand Down
Loading

0 comments on commit 7a88124

Please sign in to comment.