Skip to content

Commit c4f3113

Browse files
committed
Initial commit
0 parents  commit c4f3113

22 files changed

Lines changed: 502 additions & 0 deletions

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/.vs/
2+
/build/bin/
3+
obj/
4+
/dist/
5+
/packages/
6+
/src/bin/
7+
/tools/

Engage.Dnn.SqlServerTypes.sln

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.30717.126
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Engage.Dnn.SqlServerTypes", "src\Engage.Dnn.SqlServerTypes.csproj", "{E213FF42-424D-4955-B4A1-A737F273C100}"
7+
EndProject
8+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Engage.Dnn.SqlServerTypes.Build", "build\Engage.Dnn.SqlServerTypes.Build.csproj", "{C9114CCE-983F-41E1-BE83-94725516B644}"
9+
EndProject
10+
Global
11+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
12+
Debug|Any CPU = Debug|Any CPU
13+
Release|Any CPU = Release|Any CPU
14+
EndGlobalSection
15+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
16+
{E213FF42-424D-4955-B4A1-A737F273C100}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17+
{E213FF42-424D-4955-B4A1-A737F273C100}.Debug|Any CPU.Build.0 = Debug|Any CPU
18+
{E213FF42-424D-4955-B4A1-A737F273C100}.Release|Any CPU.ActiveCfg = Release|Any CPU
19+
{E213FF42-424D-4955-B4A1-A737F273C100}.Release|Any CPU.Build.0 = Release|Any CPU
20+
{C9114CCE-983F-41E1-BE83-94725516B644}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21+
{C9114CCE-983F-41E1-BE83-94725516B644}.Debug|Any CPU.Build.0 = Debug|Any CPU
22+
{C9114CCE-983F-41E1-BE83-94725516B644}.Release|Any CPU.ActiveCfg = Release|Any CPU
23+
{C9114CCE-983F-41E1-BE83-94725516B644}.Release|Any CPU.Build.0 = Release|Any CPU
24+
EndGlobalSection
25+
GlobalSection(SolutionProperties) = preSolution
26+
HideSolutionNode = FALSE
27+
EndGlobalSection
28+
GlobalSection(ExtensibilityGlobals) = postSolution
29+
SolutionGuid = {E4C8D96C-6B4B-4829-86C3-40E9C1413C18}
30+
EndGlobalSection
31+
EndGlobal

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
### SQL Server Types for DNN
2+
3+
This repository packages the
4+
[Microsoft.SqlServer.Types](https://www.nuget.org/packages/Microsoft.SqlServer.Types)
5+
NuGet package for [DNN Platform](https://github.com/dnnsoftware/Dnn.Platform/).

build.config

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
CAKE_VERSION=0.38.5
3+
DOTNET_VERSION=5.0.100

build.ps1

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
#!/usr/bin/env pwsh
2+
$DotNetInstallerUri = 'https://dot.net/v1/dotnet-install.ps1';
3+
$DotNetUnixInstallerUri = 'https://dot.net/v1/dotnet-install.sh'
4+
$DotNetChannel = 'LTS'
5+
$PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent
6+
7+
[string] $DotNetVersion= ''
8+
foreach($line in Get-Content (Join-Path $PSScriptRoot 'build.config'))
9+
{
10+
if ($line -like 'DOTNET_VERSION=*') {
11+
$DotNetVersion =$line.SubString(15)
12+
}
13+
}
14+
15+
16+
if ([string]::IsNullOrEmpty($DotNetVersion)) {
17+
'Failed to parse .NET Core SDK Version'
18+
exit 1
19+
}
20+
21+
$DotNetInstallerUri = "https://dot.net/v1/dotnet-install.ps1";
22+
23+
# Make sure tools folder exists
24+
$PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent
25+
$ToolPath = Join-Path $PSScriptRoot "tools"
26+
if (!(Test-Path $ToolPath)) {
27+
Write-Verbose "Creating tools directory..."
28+
New-Item -Path $ToolPath -Type directory | out-null
29+
}
30+
31+
###########################################################################
32+
# INSTALL .NET CORE CLI
33+
###########################################################################
34+
35+
Function Remove-PathVariable([string]$VariableToRemove)
36+
{
37+
$path = [Environment]::GetEnvironmentVariable("PATH", "User")
38+
$newItems = $path.Split(';') | Where-Object { $_.ToString() -inotlike $VariableToRemove }
39+
[Environment]::SetEnvironmentVariable("PATH", [System.String]::Join(';', $newItems), "User")
40+
$path = [Environment]::GetEnvironmentVariable("PATH", "Process")
41+
$newItems = $path.Split(';') | Where-Object { $_.ToString() -inotlike $VariableToRemove }
42+
[Environment]::SetEnvironmentVariable("PATH", [System.String]::Join(';', $newItems), "Process")
43+
}
44+
45+
# Get .NET Core CLI path if installed.
46+
$FoundDotNetCliVersion = $null;
47+
if (Get-Command dotnet -ErrorAction SilentlyContinue) {
48+
$FoundDotNetCliVersion = dotnet --version;
49+
}
50+
51+
if($FoundDotNetCliVersion -ne $DotNetVersion) {
52+
$InstallPath = Join-Path $PSScriptRoot ".dotnet"
53+
if (!(Test-Path $InstallPath)) {
54+
mkdir -Force $InstallPath | Out-Null;
55+
}
56+
(New-Object System.Net.WebClient).DownloadFile($DotNetInstallerUri, "$InstallPath\dotnet-install.ps1");
57+
& $InstallPath\dotnet-install.ps1 -Version $DotNetVersion -InstallDir $InstallPath;
58+
59+
Remove-PathVariable "$InstallPath"
60+
$env:PATH = "$InstallPath;$env:PATH"
61+
$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
62+
$env:DOTNET_CLI_TELEMETRY_OPTOUT=1
63+
}
64+
65+
###########################################################################
66+
# RUN BUILD SCRIPT
67+
###########################################################################
68+
69+
dotnet run --project build/Engage.Dnn.SqlServerTypes.Build.csproj -- $args
70+
exit $LASTEXITCODE;

build.sh

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/usr/bin/env bash
2+
# Define varibles
3+
SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
4+
source $SCRIPT_DIR/build.config
5+
6+
if [ "$DOTNET_VERSION" = "" ]; then
7+
echo "An error occured while parsing .NET Core SDK version."
8+
exit 1
9+
fi
10+
11+
###########################################################################
12+
# INSTALL .NET CORE CLI
13+
###########################################################################
14+
15+
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
16+
export DOTNET_CLI_TELEMETRY_OPTOUT=1
17+
export DOTNET_SYSTEM_NET_HTTP_USESOCKETSHTTPHANDLER=0
18+
export DOTNET_ROLL_FORWARD_ON_NO_CANDIDATE_FX=2
19+
20+
DOTNET_INSTALLED_VERSION=$(dotnet --version 2>&1)
21+
22+
if [ "$DOTNET_VERSION" != "$DOTNET_INSTALLED_VERSION" ]; then
23+
echo "Installing .NET CLI..."
24+
if [ ! -d "$SCRIPT_DIR/.dotnet" ]; then
25+
mkdir "$SCRIPT_DIR/.dotnet"
26+
fi
27+
curl -Lsfo "$SCRIPT_DIR/.dotnet/dotnet-install.sh" https://dot.net/v1/dotnet-install.sh
28+
bash "$SCRIPT_DIR/.dotnet/dotnet-install.sh" --version $DOTNET_VERSION --install-dir .dotnet --no-path
29+
export PATH="$SCRIPT_DIR/.dotnet":$PATH
30+
export DOTNET_ROOT="$SCRIPT_DIR/.dotnet"
31+
fi
32+
33+
###########################################################################
34+
# RUN BUILD SCRIPT
35+
###########################################################################
36+
37+
echo "Running build script.."
38+
dotnet run --project ./build/Engage.Dnn.SqlServerTypes.Build.csproj -- "$@"

build/Context.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
namespace Engage.Dnn.SqlServerTypes.Build
2+
{
3+
using Cake.Core;
4+
using Cake.Frosting;
5+
6+
public class Context : FrostingContext
7+
{
8+
public Context(ICakeContext context)
9+
: base(context)
10+
{
11+
}
12+
}
13+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<OutputType>Exe</OutputType>
4+
<TargetFramework>netcoreapp3.1</TargetFramework>
5+
<PackAsTool>true</PackAsTool>
6+
<!-- Make sure start same folder .NET Core CLI and Visual Studio -->
7+
<RunWorkingDirectory>$(MSBuildProjectDirectory)</RunWorkingDirectory>
8+
</PropertyGroup>
9+
<ItemGroup>
10+
<PackageReference Include="Cake.Frosting" Version="1.0.0-rc0001" />
11+
<PackageReference Include="JetBrains.Annotations" Version="2020.3.0" />
12+
</ItemGroup>
13+
</Project>

build/Lifetime.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
namespace Engage.Dnn.SqlServerTypes.Build
2+
{
3+
using Cake.Frosting;
4+
5+
public sealed class Lifetime : FrostingLifetime<Context>
6+
{
7+
}
8+
}

build/Program.cs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
namespace Engage.Dnn.SqlServerTypes.Build
2+
{
3+
using Cake.Frosting;
4+
5+
public class Program : IFrostingStartup
6+
{
7+
public static int Main(string[] args)
8+
{
9+
// Create the host.
10+
var host = new CakeHostBuilder().WithArguments(args)
11+
.UseStartup<Program>()
12+
.Build();
13+
14+
// Run the host.
15+
return host.Run();
16+
}
17+
18+
public void Configure(ICakeServices services)
19+
{
20+
services.UseContext<Context>();
21+
services.UseLifetime<Lifetime>();
22+
services.UseWorkingDirectory("..");
23+
}
24+
}
25+
}

0 commit comments

Comments
 (0)