Skip to content

Commit

Permalink
re organizes sln files and build script
Browse files Browse the repository at this point in the history
  • Loading branch information
Shazwazza committed May 16, 2017
1 parent aa735d0 commit bb5f65f
Show file tree
Hide file tree
Showing 90 changed files with 311 additions and 75,643 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@ NDepend/*
.Examine.boltdata/*
src/Examine.Web.Demo/App_Data/SimpleIndexSet2/*
src/Examine.Web.Demo/App_Data/Database1.sdf
src/Examine.vsmdi
src/Local.testsettings
src/packages/*
1 change: 0 additions & 1 deletion .hgtags

This file was deleted.

6 changes: 6 additions & 0 deletions .nuget/Nuget.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<solution>
<add key="disableSourceControlIntegration" value="true" />
</solution>
</configuration>
6 changes: 0 additions & 6 deletions Examine.vsmdi

This file was deleted.

10 changes: 0 additions & 10 deletions Local.testsettings

This file was deleted.

2 changes: 1 addition & 1 deletion appveyor.build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 0.1.83-build.{build}
skip_tags: true
image: Visual Studio 2017
build_script:
- ps: .\Build-Release.ps1 1
- ps: .\Build\Build-Release.ps1 1
artifacts:
- path: build\Release\*.nupkg
name: Nuget Package
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 0.1.83
skip_non_tags: true
image: Visual Studio 2017
build_script:
- ps: .\Build-Release.ps1 1
- ps: .\Build\Build-Release.ps1 1
artifacts:
- path: build\Release\*.nupkg
name: Nuget Package
208 changes: 107 additions & 101 deletions Build-Release.ps1 → build/Build-Release.ps1
Original file line number Diff line number Diff line change
@@ -1,102 +1,108 @@
param (
[Parameter(Mandatory=$false)]
[int]
$IsBuildServer = 0
)

$PSScriptFilePath = (Get-Item $MyInvocation.MyCommand.Path).FullName
$SolutionRoot = Split-Path -Path $PSScriptFilePath -Parent

if ($IsBuildServer -eq 1) {
$MSBuild = "MSBuild.exe"
}
else {
$ProgFiles86 = [Environment]::GetEnvironmentVariable("ProgramFiles(x86)");
$MSBuild = "$ProgFiles86\MSBuild\14.0\Bin\MSBuild.exe"
}

# Read XML
$buildXmlFile = (Join-Path $SolutionRoot "build.xml")
[xml]$buildXml = Get-Content $buildXmlFile

# Make sure we don't have a release folder for this version already
$BuildFolder = Join-Path -Path $SolutionRoot -ChildPath "build";
$ReleaseFolder = Join-Path -Path $BuildFolder -ChildPath "Release";
if ((Get-Item $ReleaseFolder -ErrorAction SilentlyContinue) -ne $null)
{
Write-Warning "$ReleaseFolder already exists on your local machine. It will now be deleted."
Remove-Item $ReleaseFolder -Recurse
}

# Set the version number in SolutionInfo.cs
$SolutionInfoPath = Join-Path -Path $SolutionRoot -ChildPath "src\SolutionInfo.cs"

# Set the copyright
$Copyright = "Copyright © Shannon Deminick " + (Get-Date).year
(gc -Path $SolutionInfoPath) `
-replace "(?<=AssemblyCopyright\(`").*(?=`"\))", $Copyright |
sc -Path $SolutionInfoPath -Encoding UTF8

# Iterate projects and update their versions
[System.Xml.XmlElement] $root = $buildXml.get_DocumentElement()
[System.Xml.XmlElement] $project = $null
foreach($project in $root.ChildNodes) {

$projectPath = Join-Path -Path $SolutionRoot -ChildPath ("src\" + $project.id)
$projectAssemblyInfo = Join-Path -Path $projectPath -ChildPath "Properties\AssemblyInfo.cs"
$projectVersion = $project.version.Split("-")[0];

Write-Host "Updating verion for $projectPath to $($project.version) ($projectVersion)"

#update assembly infos with correct version

(gc -Path $projectAssemblyInfo) `
-replace "(?<=Version\(`")[.\d]*(?=`"\))", "$projectVersion.0" |
sc -Path $projectAssemblyInfo -Encoding UTF8

(gc -Path $projectAssemblyInfo) `
-replace "(?<=AssemblyInformationalVersion\(`")[.\w-]*(?=`"\))", $project.version |
sc -Path $projectAssemblyInfo -Encoding UTF8
}

# Build the solution in release mode
$SolutionPath = Join-Path -Path $SolutionRoot -ChildPath "Examine.sln"
& $MSBuild "$SolutionPath" /p:Configuration=Release /maxcpucount /t:Clean
if (-not $?)
{
throw "The MSBuild process returned an error code."
}
& $MSBuild "$SolutionPath" /p:Configuration=Release /maxcpucount /t:Rebuild
if (-not $?)
{
throw "The MSBuild process returned an error code."
}

# Iterate projects and output them

# Go get nuget.exe if we don't hae it
$NuGet = "$BuildFolder\nuget.exe"
$FileExists = Test-Path $NuGet
If ($FileExists -eq $False) {
$SourceNugetExe = "http://nuget.org/nuget.exe"
Invoke-WebRequest $SourceNugetExe -OutFile $NuGet
}

$include = @('*Examine*.dll','*Examine*.pdb','*Lucene*.dll','ICSharpCode.SharpZipLib.dll')
foreach($project in $root.ChildNodes) {
$projectRelease = Join-Path -Path $ReleaseFolder -ChildPath "$($project.id)";
New-Item $projectRelease -Type directory

$projectBin = Join-Path -Path $SolutionRoot -ChildPath "src\$($project.id)\bin\Release";
Copy-Item "$projectBin\*.*" -Destination $projectRelease -Include $include

$nuSpecSource = Join-Path -Path $BuildFolder -ChildPath "Nuspecs\$($project.id)\*";
Copy-Item $nuSpecSource -Destination $projectRelease
$nuSpec = Join-Path -Path $projectRelease -ChildPath "$($project.id).nuspec";

& $NuGet pack $nuSpec -OutputDirectory $ReleaseFolder -Version $project.version -Properties copyright=$Copyright
}


""
param (
[Parameter(Mandatory=$false)]
[int]
$IsBuildServer = 0
)

$PSScriptFilePath = (Get-Item $MyInvocation.MyCommand.Path).FullName
$RepoRoot = (get-item $PSScriptFilePath).Directory.Parent.FullName;
$SolutionRoot = Join-Path -Path $RepoRoot "src";

if ($IsBuildServer -eq 1) {
$MSBuild = "MSBuild.exe"
}
else {
$ProgFiles86 = [Environment]::GetEnvironmentVariable("ProgramFiles(x86)");
$MSBuild = "$ProgFiles86\MSBuild\14.0\Bin\MSBuild.exe"
}

Write-Host "MSBUILD = $MSBuild"

# Make sure we don't have a release folder for this version already
$BuildFolder = Join-Path -Path $RepoRoot -ChildPath "build";
$ReleaseFolder = Join-Path -Path $BuildFolder -ChildPath "Release";
if ((Get-Item $ReleaseFolder -ErrorAction SilentlyContinue) -ne $null)
{
Write-Warning "$ReleaseFolder already exists on your local machine. It will now be deleted."
Remove-Item $ReleaseFolder -Recurse
}

# Read XML
$buildXmlFile = (Join-Path $BuildFolder "build.xml")
[xml]$buildXml = Get-Content $buildXmlFile

# Set the version number in SolutionInfo.cs
$SolutionInfoPath = Join-Path -Path $SolutionRoot -ChildPath "SolutionInfo.cs"

# Set the copyright
$Copyright = "Copyright © Shannon Deminick " + (Get-Date).year
(gc -Path $SolutionInfoPath) `
-replace "(?<=AssemblyCopyright\(`").*(?=`"\))", $Copyright |
sc -Path $SolutionInfoPath -Encoding UTF8

$SolutionPath = Join-Path -Path $SolutionRoot -ChildPath "Examine.sln"

# Go get nuget.exe if we don't hae it
$NuGet = "$BuildFolder\nuget.exe"
$FileExists = Test-Path $NuGet
If ($FileExists -eq $False) {
$SourceNugetExe = "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe"
Invoke-WebRequest $SourceNugetExe -OutFile $NuGet
}

#restore nuget packages
& $NuGet restore $SolutionPath

# Iterate projects and update their versions
[System.Xml.XmlElement] $root = $buildXml.get_DocumentElement()
[System.Xml.XmlElement] $project = $null
foreach($project in $root.ChildNodes) {

$projectPath = Join-Path -Path $SolutionRoot -ChildPath $project.id
$projectAssemblyInfo = Join-Path -Path $projectPath -ChildPath "Properties\AssemblyInfo.cs"
$projectVersion = $project.version.Split("-")[0];

Write-Host "Updating verion for $projectPath to $($project.version) ($projectVersion)"

#update assembly infos with correct version

(gc -Path $projectAssemblyInfo) `
-replace "(?<=Version\(`")[.\d]*(?=`"\))", "$projectVersion.0" |
sc -Path $projectAssemblyInfo -Encoding UTF8

(gc -Path $projectAssemblyInfo) `
-replace "(?<=AssemblyInformationalVersion\(`")[.\w-]*(?=`"\))", $project.version |
sc -Path $projectAssemblyInfo -Encoding UTF8
}

# Build the solution in release mode
& $MSBuild "$SolutionPath" /p:Configuration=Release /maxcpucount /t:Clean
if (-not $?)
{
throw "The MSBuild process returned an error code."
}
& $MSBuild "$SolutionPath" /p:Configuration=Release /maxcpucount /t:Rebuild
if (-not $?)
{
throw "The MSBuild process returned an error code."
}

# Iterate projects and output them
$include = @('*Examine*.dll','*Examine*.pdb','*Lucene*.dll','ICSharpCode.SharpZipLib.dll')
foreach($project in $root.ChildNodes) {
$projectRelease = Join-Path -Path $ReleaseFolder -ChildPath "$($project.id)";
New-Item $projectRelease -Type directory

$projectBin = Join-Path -Path $SolutionRoot -ChildPath "$($project.id)\bin\Release";
Copy-Item "$projectBin\*.*" -Destination $projectRelease -Include $include

$nuSpecSource = Join-Path -Path $BuildFolder -ChildPath "Nuspecs\$($project.id)\*";
Copy-Item $nuSpecSource -Destination $projectRelease
$nuSpec = Join-Path -Path $projectRelease -ChildPath "$($project.id).nuspec";

& $NuGet pack $nuSpec -OutputDirectory $ReleaseFolder -Version $project.version -Properties copyright=$Copyright
}


""
"Build is done!"
File renamed without changes.
32 changes: 12 additions & 20 deletions src/Examine.AzureDirectory/Examine.AzureDirectory.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,46 +32,38 @@
<ItemGroup>
<Reference Include="ICSharpCode.SharpZipLib, Version=0.86.0.518, Culture=neutral, PublicKeyToken=1b03e6acf1164f73, processorArchitecture=MSIL">
<HintPath>..\packages\SharpZipLib.0.86.0\lib\20\ICSharpCode.SharpZipLib.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Lucene.Net, Version=2.9.4.1, Culture=neutral, PublicKeyToken=85089178b9ac3181, processorArchitecture=MSIL">
<HintPath>..\packages\Lucene.Net.2.9.4.1\lib\net40\Lucene.Net.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Azure.KeyVault.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.Azure.KeyVault.Core.1.0.0\lib\net40\Microsoft.Azure.KeyVault.Core.dll</HintPath>
<Private>True</Private>
<HintPath>..\packages\Microsoft.Azure.KeyVault.Core.1.0.0\lib\net40\Microsoft.Azure.KeyVault.Core.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Data.Edm, Version=5.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.Data.Edm.5.7.0\lib\net40\Microsoft.Data.Edm.dll</HintPath>
<Private>True</Private>
<Reference Include="Microsoft.Data.Edm, Version=5.8.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Data.Edm.5.8.2\lib\net40\Microsoft.Data.Edm.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Data.OData, Version=5.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.Data.OData.5.7.0\lib\net40\Microsoft.Data.OData.dll</HintPath>
<Private>True</Private>
<Reference Include="Microsoft.Data.OData, Version=5.8.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Data.OData.5.8.2\lib\net40\Microsoft.Data.OData.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Data.Services.Client, Version=5.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.Data.Services.Client.5.7.0\lib\net40\Microsoft.Data.Services.Client.dll</HintPath>
<Private>True</Private>
<Reference Include="Microsoft.Data.Services.Client, Version=5.8.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Data.Services.Client.5.8.2\lib\net40\Microsoft.Data.Services.Client.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.3\lib\net40\Microsoft.WindowsAzure.Configuration.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Storage, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\packages\WindowsAzure.Storage.8.0.0\lib\net45\Microsoft.WindowsAzure.Storage.dll</HintPath>
<Private>True</Private>
<Reference Include="Microsoft.WindowsAzure.Storage, Version=8.1.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\WindowsAzure.Storage.8.1.1\lib\net45\Microsoft.WindowsAzure.Storage.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll</HintPath>
<HintPath>..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Spatial, Version=5.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Spatial.5.7.0\lib\net40\System.Spatial.dll</HintPath>
<Private>True</Private>
<Reference Include="System.Spatial, Version=5.8.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\System.Spatial.5.8.2\lib\net40\System.Spatial.dll</HintPath>
</Reference>
<Reference Include="System.Web" />
<Reference Include="System.Xml.Linq" />
Expand Down
14 changes: 9 additions & 5 deletions src/Examine.AzureDirectory/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@
<packages>
<package id="Lucene.Net" version="2.9.4.1" targetFramework="net45" />
<package id="Microsoft.Azure.KeyVault.Core" version="1.0.0" targetFramework="net45" />
<package id="Microsoft.Data.Edm" version="5.7.0" targetFramework="net45" />
<package id="Microsoft.Data.OData" version="5.7.0" targetFramework="net45" />
<package id="Microsoft.Data.Services.Client" version="5.7.0" targetFramework="net45" />
<package id="Microsoft.Data.Edm" version="5.8.2" targetFramework="net45" />
<package id="Microsoft.Data.OData" version="5.8.2" targetFramework="net45" />
<package id="Microsoft.Data.Services.Client" version="5.8.2" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.ConfigurationManager" version="2.0.3" targetFramework="net45" />
<package id="Newtonsoft.Json" version="6.0.8" targetFramework="net45" />
<package id="SharpZipLib" version="0.86.0" targetFramework="net45" />
<package id="System.Spatial" version="5.7.0" targetFramework="net45" />
<package id="WindowsAzure.Storage" version="8.0.0" targetFramework="net45" />
<package id="System.ComponentModel.EventBasedAsync" version="4.0.11" targetFramework="net45" />
<package id="System.Dynamic.Runtime" version="4.0.0" targetFramework="net45" />
<package id="System.Linq.Queryable" version="4.0.0" targetFramework="net45" />
<package id="System.Net.Requests" version="4.0.11" targetFramework="net45" />
<package id="System.Spatial" version="5.8.2" targetFramework="net45" />
<package id="WindowsAzure.Storage" version="8.1.1" targetFramework="net45" />
</packages>
Loading

0 comments on commit bb5f65f

Please sign in to comment.