Skip to content

Commit

Permalink
Builds a release for Examine.AzureDirectory - first real release
Browse files Browse the repository at this point in the history
  • Loading branch information
Shazwazza committed Feb 11, 2020
1 parent 0afec36 commit dd1139c
Show file tree
Hide file tree
Showing 11 changed files with 55 additions and 96 deletions.
46 changes: 18 additions & 28 deletions build/Build-Release.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,9 @@ else {
mv "$dir\$file" $vswhere
}

$MSBuild = &$vswhere -latest -products * -requires Microsoft.Component.MSBuild -property installationPath
if ($MSBuild) {
$MSBuild = join-path $MSBuild 'MSBuild\15.0\Bin\MSBuild.exe'
if (-not (test-path $msbuild)) {
throw "MSBuild not found!"
}
$MSBuild = &$vswhere -latest -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe | select-object -first 1
if (-not (test-path $MSBuild)) {
throw "MSBuild not found!"
}
}

Expand All @@ -62,7 +59,7 @@ $buildXmlFile = (Join-Path $BuildFolder "build.xml")
$SolutionInfoPath = Join-Path -Path $SolutionRoot -ChildPath "SolutionInfo.cs"

# Set the copyright
$Copyright = "Copyright © Shannon Deminick " + (Get-Date).year
$Copyright = "Copyright " + [char]0x00A9 + " Shannon Deminick " + (Get-Date).year
(gc -Path $SolutionInfoPath) `
-replace "(?<=AssemblyCopyright\(`").*(?=`"\))", $Copyright |
sc -Path $SolutionInfoPath -Encoding UTF8
Expand All @@ -80,19 +77,22 @@ 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)"
if (Test-Path -Path $projectAssemblyInfo){
$projectVersion = $project.version.Split("-")[0];

#update assembly infos with correct version
Write-Host "Updating verion for $projectPath to $($project.version) ($projectVersion)"

(gc -Path $projectAssemblyInfo) `
-replace "(?<=Version\(`")[.\d]*(?=`"\))", "$projectVersion.0" |
sc -Path $projectAssemblyInfo -Encoding UTF8
#update assembly infos with correct version

(gc -Path $projectAssemblyInfo) `
-replace "(?<=AssemblyInformationalVersion\(`")[.\w-]*(?=`"\))", $project.version |
sc -Path $projectAssemblyInfo -Encoding UTF8
(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
Expand All @@ -108,18 +108,8 @@ if (-not $?)
}

# 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";

foreach($project in $root.ChildNodes) {
$nuSpec = Join-Path -Path $SolutionRoot -ChildPath "$($project.id)\$($project.id).nuspec";
& $NuGet pack $nuSpec -OutputDirectory $ReleaseFolder -Version $project.version -Properties copyright=$Copyright
}

Expand Down
18 changes: 0 additions & 18 deletions build/Nuspecs/Examine/web.config.transform

This file was deleted.

2 changes: 1 addition & 1 deletion build/build.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<build>
<project id="Examine" version="0.1.90"/>
<project id="Examine.AzureDirectory" version="1.0.0"/>
<project id="Examine.AzureDirectory" version="0.1.90"/>
</build>
1 change: 1 addition & 0 deletions src/Examine.AzureDirectory/Examine.AzureDirectory.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="Examine.AzureDirectory.nuspec" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</dependencies>
</metadata>
<files>
<file src="Examine.AzureDirectory.dll" target="lib\Examine.AzureDirectory.dll" />
<file src="Examine.AzureDirectory.pdb" target="lib\Examine.AzureDirectory.pdb" />
<file src="bin\Release\Examine.AzureDirectory.dll" target="lib\net452\Examine.AzureDirectory.dll" />
<file src="bin\Release\Examine.AzureDirectory.pdb" target="lib\net452\Examine.AzureDirectory.pdb" />
</files>
</package>
6 changes: 3 additions & 3 deletions src/Examine.AzureDirectory/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0-beta05")]
[assembly: AssemblyVersion("0.1.90.0")]
[assembly: AssemblyFileVersion("0.1.90.0")]
[assembly: AssemblyInformationalVersion("0.1.90")]
19 changes: 2 additions & 17 deletions src/Examine.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26430.15
# Visual Studio Version 16
VisualStudioVersion = 16.0.29521.150
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{8F5756F2-7449-400C-BE52-A91F862967B0}"
ProjectSection(SolutionItems) = preProject
Expand All @@ -21,12 +21,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{EE632768
..\build\build.xml = ..\build\build.xml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Examine", "Examine", "{976F400B-2ABA-4C36-8FD6-B0B35D0911D0}"
ProjectSection(SolutionItems) = preProject
..\build\Nuspecs\Examine\Examine.nuspec = ..\build\Nuspecs\Examine\Examine.nuspec
..\build\Nuspecs\Examine\web.config.transform = ..\build\Nuspecs\Examine\web.config.transform
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UmbracoExamine", "UmbracoExamine\UmbracoExamine.csproj", "{07FBC26B-2927-4A22-8D96-D644C667FECC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Examine", "Examine\Examine.csproj", "{DA5E35C3-89BA-4A2E-A559-32CF7B23CBFF}"
Expand All @@ -37,11 +31,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Examine.Web.Demo", "Examine
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Examine.AzureDirectory", "Examine.AzureDirectory\Examine.AzureDirectory.csproj", "{C3880B59-8B08-4990-B3FA-0A8DB9476319}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Examine.AzureDirectory", "Examine.AzureDirectory", "{1667E2A1-051D-48F6-A2DE-301788613870}"
ProjectSection(SolutionItems) = preProject
..\build\Nuspecs\Examine.AzureDirectory\Examine.AzureDirectory.nuspec = ..\build\Nuspecs\Examine.AzureDirectory\Examine.AzureDirectory.nuspec
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -72,10 +61,6 @@ Global
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{976F400B-2ABA-4C36-8FD6-B0B35D0911D0} = {EE632768-6ECD-40EF-84BD-5594670EA7A8}
{1667E2A1-051D-48F6-A2DE-301788613870} = {EE632768-6ECD-40EF-84BD-5594670EA7A8}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {1FD5A35C-59D2-4BF3-B524-2F84242A42AA}
EndGlobalSection
Expand Down
1 change: 1 addition & 0 deletions src/Examine/Examine.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@
<None Include="App.config">
<SubType>Designer</SubType>
</None>
<None Include="Examine.nuspec" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
Expand Down
46 changes: 23 additions & 23 deletions build/Nuspecs/Examine/Examine.nuspec → src/Examine/Examine.nuspec
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>Examine</id>
<version>0.0.0.0</version>
<title>Examine</title>
<authors>Shannon Deminick</authors>
<owners>Shannon Deminick</owners>
<projectUrl>https://github.com/Shazwazza/Examine</projectUrl>
<licenseUrl>http://www.opensource.org/licenses/ms-pl</licenseUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Examine is a wrapper for getting a Lucene index up and running for any type of data and comes with an API to search it. You can either use the Fluent API that the library comes with or use raw Lucene query syntax. The indexing is configurable and will allow both synchronous and asynchronous indexing and everything works happily in web projects too.</description>
<summary>Examine is a wrapper for getting a Lucene index up and running for any type of data and comes with an API to search it</summary>
<tags>examine search lucene</tags>
<copyright>$copyright$</copyright>
<dependencies>
<dependency id="Lucene.Net" version="2.9.4.1" />
</dependencies>
</metadata>
<files>
<file src="Examine.dll" target="lib\net45\Examine.dll" />
<file src="Examine.pdb" target="lib\net45\Examine.pdb" />
</files>
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>Examine</id>
<version>0.0.0.0</version>
<title>Examine</title>
<authors>Shannon Deminick</authors>
<owners>Shannon Deminick</owners>
<projectUrl>https://github.com/Shazwazza/Examine</projectUrl>
<licenseUrl>http://www.opensource.org/licenses/ms-pl</licenseUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Examine is a wrapper for getting a Lucene index up and running for any type of data and comes with an API to search it. You can either use the Fluent API that the library comes with or use raw Lucene query syntax. The indexing is configurable and will allow both synchronous and asynchronous indexing and everything works happily in web projects too.</description>
<summary>Examine is a wrapper for getting a Lucene index up and running for any type of data and comes with an API to search it</summary>
<tags>examine search lucene</tags>
<copyright>$copyright$</copyright>
<dependencies>
<dependency id="Lucene.Net" version="2.9.4.1" />
</dependencies>
</metadata>
<files>
<file src="bin\Release\Examine.dll" target="lib\net452\Examine.dll" />
<file src="bin\Release\Examine.pdb" target="lib\net452\Examine.pdb" />
</files>
</package>
6 changes: 3 additions & 3 deletions src/Examine/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@

[assembly: AllowPartiallyTrustedCallers]

[assembly: AssemblyVersion("0.1.89.0")]
[assembly: AssemblyFileVersion("0.1.89.0")]
[assembly: AssemblyInformationalVersion("0.1.89")]
[assembly: AssemblyVersion("0.1.90.0")]
[assembly: AssemblyFileVersion("0.1.90.0")]
[assembly: AssemblyInformationalVersion("0.1.90")]
2 changes: 1 addition & 1 deletion src/SolutionInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
using System.Security;

[assembly: AssemblyCompany("Shannon Deminick")]
[assembly: AssemblyCopyright("Copyright © Shannon Deminick 2018")]
[assembly: AssemblyCopyright("Copyright © Shannon Deminick 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

0 comments on commit dd1139c

Please sign in to comment.