-
-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
re organizes sln files and build script
- Loading branch information
Showing
90 changed files
with
311 additions
and
75,643 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.