Skip to content
Browse files

Reorganized the build process.

- markdown files are converted to html during build
- release build outputs are placed in the 'build' folder to make packaging easier
  • Loading branch information...
1 parent 6a9f323 commit 35966bf008af28c6fabe753288d9e164d0fa59b9 @enyim committed Oct 20, 2010
View
2 DemoApp/DemoApp.csproj
@@ -12,7 +12,7 @@
<AssemblyName>DemoApp</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
</PropertyGroup>
- <Import Project="..\CommonProperties.targets" />
+ <Import Project="..\build\CommonProperties.targets" />
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<NoWarn>1591</NoWarn>
</PropertyGroup>
View
4 Enyim.Caching.Log4NetAdapter/Enyim.Caching.Log4NetAdapter.csproj
@@ -13,7 +13,7 @@
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
- <Import Project="..\CommonProperties.targets" />
+ <Import Project="..\build\CommonProperties.targets" />
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<NoWarn>1591</NoWarn>
@@ -54,5 +54,5 @@
<PropertyGroup>
<GitTagMatch>emc*</GitTagMatch>
</PropertyGroup>
- <Import Project="..\VersionInfo.targets" />
+ <Import Project="..\build\VersionInfo.targets" />
</Project>
View
4 Enyim.Caching.NLogAdapter/Enyim.Caching.NLogAdapter.csproj
@@ -14,7 +14,7 @@
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
- <Import Project="..\CommonProperties.targets" />
+ <Import Project="..\build\CommonProperties.targets" />
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<NoWarn>1591</NoWarn>
@@ -55,5 +55,5 @@
<PropertyGroup>
<GitTagMatch>emc*</GitTagMatch>
</PropertyGroup>
- <Import Project="..\VersionInfo.targets" />
+ <Import Project="..\build\VersionInfo.targets" />
</Project>
View
4 Enyim.Caching.sln
@@ -3,7 +3,6 @@ Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{319FC4D5-5302-46B4-887A-65CC10157B64}"
ProjectSection(SolutionItems) = preProject
- CHANGES = CHANGES
LICENSE = LICENSE
README.mdown = README.mdown
EndProjectSection
@@ -35,19 +34,16 @@ Global
{0ACEA848-04B3-4E9C-8F74-D051006CA43D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0ACEA848-04B3-4E9C-8F74-D051006CA43D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0ACEA848-04B3-4E9C-8F74-D051006CA43D}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {0ACEA848-04B3-4E9C-8F74-D051006CA43D}.Release|Any CPU.Build.0 = Release|Any CPU
{7225B6E0-A1FB-4F64-A5C5-1F640E21C90B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7225B6E0-A1FB-4F64-A5C5-1F640E21C90B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7225B6E0-A1FB-4F64-A5C5-1F640E21C90B}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {7225B6E0-A1FB-4F64-A5C5-1F640E21C90B}.Release|Any CPU.Build.0 = Release|Any CPU
{708A2350-A26C-444D-B975-8164263951A7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{708A2350-A26C-444D-B975-8164263951A7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{708A2350-A26C-444D-B975-8164263951A7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{708A2350-A26C-444D-B975-8164263951A7}.Release|Any CPU.Build.0 = Release|Any CPU
{607B1927-A964-48B2-AEA3-6810D10A6831}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{607B1927-A964-48B2-AEA3-6810D10A6831}.Debug|Any CPU.Build.0 = Debug|Any CPU
{607B1927-A964-48B2-AEA3-6810D10A6831}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {607B1927-A964-48B2-AEA3-6810D10A6831}.Release|Any CPU.Build.0 = Release|Any CPU
{9D3F12E6-6BDD-4DED-8B25-D877780640B4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9D3F12E6-6BDD-4DED-8B25-D877780640B4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9D3F12E6-6BDD-4DED-8B25-D877780640B4}.Release|Any CPU.ActiveCfg = Release|Any CPU
View
4 Enyim.Caching/Changes.mdown
@@ -2,5 +2,7 @@
## Version 2.7
- * Fixed the config section to default to the Binary protocol. (The MemcachedClientConfiguration was already doing this for some time.)
* Removed log4net from the project and made the log provider configurable. See http://github.com/enyim/EnyimMemcached/wiki/Configure-Logging
+ * Fixed the config section to default to the Binary protocol. (The MemcachedClientConfiguration was already doing this for some time.)
+ * The client no longer checks if objects are larger than 1MB, but lets the server sort it out
+
View
0 Enyim.Caching/App.config → Enyim.Caching/Demo.config 100755 → 100644
File renamed without changes.
View
11 Enyim.Caching/Enyim.Caching.csproj
@@ -12,7 +12,7 @@
<AssemblyName>Enyim.Caching</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
</PropertyGroup>
- <Import Project="..\CommonProperties.targets" />
+ <Import Project="..\build\CommonProperties.targets" />
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<NoWarn>1591</NoWarn>
@@ -327,11 +327,16 @@
<Compile Include="UIntEqualityComparer.cs" />
</ItemGroup>
<ItemGroup>
- <None Include="App.config" />
+ <None Include="Demo.config">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="Changes.mdown">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<GitTagMatch>emc*</GitTagMatch>
</PropertyGroup>
- <Import Project="..\VersionInfo.targets" />
+ <Import Project="..\build\VersionInfo.targets" />
</Project>
View
0 Membase/App.config → Membase/Demo.config
File renamed without changes.
View
13 Membase/Membase.csproj
@@ -12,7 +12,7 @@
<AssemblyName>Membase</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
</PropertyGroup>
- <Import Project="..\CommonProperties.targets" />
+ <Import Project="..\build\CommonProperties.targets" />
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<NoWarn>1591</NoWarn>
@@ -69,11 +69,16 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
- <None Include="App.config" />
+ <None Include="Demo.config">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="Changes.mdown">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
- <GitTagMatch>ns*</GitTagMatch>
+ <GitTagMatch>mb*</GitTagMatch>
</PropertyGroup>
- <Import Project="..\VersionInfo.targets" />
+ <Import Project="..\build\VersionInfo.targets" />
</Project>
View
2 MemcachedTest/MemcachedTest.csproj
@@ -12,7 +12,7 @@
<WarningLevel>4</WarningLevel>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
</PropertyGroup>
- <Import Project="..\CommonProperties.targets" />
+ <Import Project="..\build\CommonProperties.targets" />
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<NoWarn>1591</NoWarn>
</PropertyGroup>
View
6 README.mdown
@@ -1,6 +1,6 @@
# Enyim Memcached Client
-This is a .NET client library for [memcached](http://memcached.org) written in C#. Also it has a special client for [Membase](http://membase.com)'s persistent memcached server.
+This is a .NET client library for [memcached](http://memcached.org) written in C#. There is also a client for [Membase](http://membase.com)'s persistent memcached server.
Features:
@@ -11,7 +11,6 @@ Features:
* Persistent connections for more speed
* SASL Authentication
-
## Requirements
You'll need .NET Framework 3.5 or later to use the precompiled binaries. To build client, you'll need Visual Studio 2010.
@@ -33,5 +32,4 @@ The best bug reports come with a patch: fork the code on GitHub, then send a pul
## Questions?
-First, have a look at the [wiki](http://github.com/enyim/EnyimMemcached/wiki). If you still have questions, please feel free to ask them on the mailing list, which can be found here:
-[http://groups.google.com/group/enyim-memcached/](http://groups.google.com/group/enyim-memcached/)
+First, have a look at the [wiki](http://github.com/enyim/EnyimMemcached/wiki). If you still have questions, please feel free to ask them on the mailing list, which can be found at: [http://groups.google.com/group/enyim-memcached/](http://groups.google.com/group/enyim-memcached/)
View
2 TestApp/TestApp.csproj
@@ -12,7 +12,7 @@
<AssemblyName>testApp</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
</PropertyGroup>
- <Import Project="..\CommonProperties.targets" />
+ <Import Project="..\build\CommonProperties.targets" />
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<NoWarn>1591</NoWarn>
</PropertyGroup>
View
2 build.cmd
@@ -1 +1 @@
-powershell -noprofile -command "&'.\build.ps1'"
+@powershell -noprofile -command "&'.\build\build.ps1'"
View
68 build.ps1
@@ -1,68 +0,0 @@
-$config = "Release"
-
-function get-assembly-title
-{
- param([string] $Path)
-
- $file = get-item $Path
- $content = [io.file]::ReadAllBytes($file.fullname)
- $a = [System.Reflection.Assembly]::Load($content)
- $d = [System.Attribute]::GetCustomAttribute($a, [System.Reflection.AssemblyTitleAttribute])
-
- return $d.Title
-}
-
-# tools
-$msbuild = "$Env:SYSTEMROOT\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe"
-$zip = "$Env:ProgramFiles\7-Zip\7z.exe"
-
-if ((test-path $zip) -eq $False)
-{
- "Could not find 7-zip, exiting."
- return
-}
-
-$projects = @( "Enyim.Caching", "Membase" )
-$includes = @{ "Enyim.Caching.Log4NetAdapter" = "log4net"; "Enyim.Caching.NLogAdapter" = "NLog" }
-
-# remove the output folders
-try {
- $projects | % { @("$_\bin", "$_\obj") } | where-object { test-path $_ } | remove-item -Recurse -Force -ErrorAction Stop
-} catch {
- write-host "Couldn't remove the output directories, exiting." -foregroundcolor red
- return
-}
-
-# build the projects
-.$msbuild /v:m /nologo /target:Rebuild /property:"Configuration=$config;IsReleaseBuild=true" Enyim.Caching.sln
-
-$projects | % {
-
- $current = $_
- $destRoot = "$current\bin\$config\"
-
- $includes.Keys | % {
-
- $includeDest = $destRoot + "\" + $includes[$_]
- md $includeDest
-
- $what = @("$_\Bin\$config\$_.*", "$_\Bin\$config\Demo.config")
- copy $what -Destination $includeDest
- }
-
- # we have to remove the tag from the version (emc2.3.4-9786545)
- $version = get-assembly-title -Path "$current\bin\$config\$current.dll"
- $zipname = "..\..\..\" + $current + "." + ($version -replace "^[^0-9]+", "") + ".zip"
-
- # 7zip roots the files relative to the current path
- pushd
- cd "$current\bin\release"
-
- ren "$current.dll.config" "Demo.config"
-
- .$zip a -mx9 "$zipname" "." "..\..\..\LICENSE" "..\..\..\CHANGES" "..\..\..\README.mdown"
-
- popd
-}
-
-## all done
View
2 CommonProperties.targets → build/CommonProperties.targets
@@ -15,7 +15,7 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
- <OutputPath>bin\Release\</OutputPath>
+ <OutputPath>..\build\output\$(MSBuildProjectName)\</OutputPath>
<DefineConstants>TRACE;SIGN</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
View
BIN build/MarkdownSharp.dll
Binary file not shown.
View
2 VersionInfo.targets → build/VersionInfo.targets
@@ -9,7 +9,7 @@
<Using Namespace="System.Text.RegularExpressions" />
<Code Type="Fragment" Language="cs">
<![CDATA[
- var m = Regex.Match(Describe, @"^(emc|ns)?(?'Major'\d+)\.(?'Minor'\d+)(-(?'Revision'\d+))?");
+ var m = Regex.Match(Describe, @"^([a-zA-Z]*)(?'Major'\d+)\.(?'Minor'\d+)(-(?'Revision'\d+))?");
if (m.Success)
{
View
101 build/build.ps1
@@ -0,0 +1,101 @@
+$config = "Release"
+
+function get-assembly-title
+{
+ param([string] $Path)
+
+ $file = get-item $Path
+ $content = [io.file]::ReadAllBytes($file.fullname)
+ $a = [System.Reflection.Assembly]::Load($content)
+ $d = [System.Attribute]::GetCustomAttribute($a, [System.Reflection.AssemblyTitleAttribute])
+
+ return $d.Title
+}
+
+function transform
+{
+ param($Markdown, $TemplatePath, $FilePath, $Title)
+
+ return (get-content $TemplatePath) -replace '\$title', $Title -replace '\$content', $Markdown.Transform([io.file]::ReadAllText($FilePath))
+}
+
+# prepare
+pushd
+
+# tools
+$msbuild = "$Env:SYSTEMROOT\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe"
+$zip = "$Env:ProgramFiles\7-Zip\7z.exe"
+
+if ((test-path $zip) -eq $False)
+{
+ "Could not find 7-zip, exiting."
+ return
+}
+
+if ((test-path "build.ps1") -eq $True) {
+ cd ..
+}
+
+$projectRoot = (get-location).path
+
+$buildRoot = "$projectRoot\build\output"
+
+$projects = @( "Enyim.Caching", "Membase" )
+$includes = @{ "Enyim.Caching.Log4NetAdapter" = "log4net"; "Enyim.Caching.NLogAdapter" = "NLog" }
+
+# remove the output folders
+
+try {
+ if ((test-path $buildRoot) -eq $True) {
+ remove-item $buildRoot -Recurse -Force -ErrorAction Stop
+ }
+}
+catch {
+ write-host "Couldn't clean the build directory, exiting." -foregroundcolor red
+ return
+}
+
+md $buildRoot > $nul
+
+[System.Reflection.Assembly]::Load([io.file]::ReadAllBytes("$projectRoot\build\markdownsharp.dll")) > $nul
+$md = new-object MarkdownSharp.Markdown
+
+set-content "$buildRoot\Readme.html" -Value (transform -TemplatePath "$projectRoot\build\template.html" -FilePath "$projectRoot\README.mdown" -Title "Read Me" -Markdown $md)
+
+# build the projects
+.$msbuild /m:1 /v:m /nologo /target:Rebuild /property:"Configuration=Release;IsReleaseBuild=true" Enyim.Caching.sln
+
+$projects | % {
+
+ $current = $_
+ $currentDest = "$buildRoot\$current"
+
+ $includes.Keys | % {
+
+ $includeDest = $currentDest + "\" + $includes[$_]
+ md $includeDest > $nul
+
+ $what = @("$buildRoot\$_\$_.*", "$buildRoot\$_\Demo.config")
+ copy $what -Destination $includeDest
+ }
+
+ set-content "$currentDest\Changes.html" -Value (transform -TemplatePath "$projectRoot\build\template.html" -FilePath "$currentDest\Changes.mdown" -Title "Change Log" -Markdown $md)
+ rm "$currentDest\Changes.mdown" > $nul
+
+ # we have to remove the tag from the version (emc2.3.4-9786545)
+ $version = get-assembly-title -Path "$currentDest\$current.dll"
+ $zipname = $projectRoot + "\" + $current + "." + ($version -replace "^[^0-9]+", "") + ".zip"
+
+ del $zipname -ErrorAction SilentlyContinue
+
+ # 7zip roots the files relative to the current path
+ pushd
+ cd $currentDest > $nul
+
+ .$zip a -mx9 "$zipname" "." "$projectRoot\LICENSE" "$buildRoot\Readme.html"
+
+ popd
+}
+
+## all done
+popd
View
9 build/template.html
@@ -0,0 +1,9 @@
+<html>
+<head>
+ <title>$title</title>
+ <style type="text/css">
+ body { font: normal 10pt Helvetica, Arial, sans-serif; }
+ </style>
+</head>
+<body>$content</body>
+</html>

0 comments on commit 35966bf

Please sign in to comment.
Something went wrong with that request. Please try again.