Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Nuget packages.

  • Loading branch information...
commit 3b36649928596f3891bd6f3e63334422728382a8 1 parent 309d702
@enyim authored
View
12 Enyim.Caching.Log4NetAdapter/Config.transform
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<configuration>
+ <configSections>
+ <sectionGroup name="enyim.com">
+ <section name="log" type="Enyim.Caching.Configuration.LoggerSection, Enyim.Caching" />
+ </sectionGroup>
+ </configSections>
+
+ <enyim.com>
+ <log factory="Enyim.Caching.Log4NetFactory, Enyim.Caching.Log4NetAdapter" />
+ </enyim.com>
+</configuration>
View
2  Enyim.Caching.Log4NetAdapter/Enyim.Caching.Log4NetAdapter.csproj
@@ -37,9 +37,11 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
+ <None Include="Config.transform" />
<None Include="Demo.config">
<SubType>Designer</SubType>
</None>
+ <None Include="Enyim.Caching.Log4NetAdapter.nuspec" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
View
21 Enyim.Caching.Log4NetAdapter/Enyim.Caching.Log4NetAdapter.nuspec
@@ -0,0 +1,21 @@
+<?xml version="1.0"?>
+<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
+ <metadata>
+ <id>EnyimMemcached-log4net</id>
+ <version>$version$</version>
+ <authors>Attila Kiskó</authors>
+ <owners>Attila Kiskó</owners>
+ <licenseUrl>http://www.apache.org/licenses/LICENSE-2.0</licenseUrl>
+ <projectUrl>https://github.com/enyim/EnyimMemcached</projectUrl>
+ <requireLicenseAcceptance>false</requireLicenseAcceptance>
+ <description>log4net based logging adapter for the Enyim Memcached library.</description>
+ <tags>memcached enyim cache caching log4net</tags>
+ <dependencies>
+ <dependency id="log4net" />
+ </dependencies>
+ </metadata>
+ <files>
+ <file src="bin\Release\Enyim.Caching.Log4NetAdapter.*" target="lib\net35" />
+ <file src="config.transform" target="content\app.config.transform" />
+ </files>
+</package>
View
12 Enyim.Caching.NLogAdapter/Config.transform
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<configuration>
+ <configSections>
+ <sectionGroup name="enyim.com">
+ <section name="log" type="Enyim.Caching.Configuration.LoggerSection, Enyim.Caching" />
+ </sectionGroup>
+ </configSections>
+
+ <enyim.com>
+ <log factory="Enyim.Caching.NLogFactory, Enyim.Caching.NLogAdapter" />
+ </enyim.com>
+</configuration>
View
2  Enyim.Caching.NLogAdapter/Demo.config
@@ -3,7 +3,7 @@
<configSections>
<sectionGroup name="enyim.com">
<section name="log" type="Enyim.Caching.Configuration.LoggerSection, Enyim.Caching" />
- <!-- ... -->
+ <!-- ... -->
</sectionGroup>
</configSections>
View
2  Enyim.Caching.NLogAdapter/Enyim.Caching.NLogAdapter.csproj
@@ -46,9 +46,11 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
+ <None Include="Config.transform" />
<None Include="Demo.config">
<SubType>Designer</SubType>
</None>
+ <None Include="Enyim.Caching.NLogAdapter.nuspec" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
View
21 Enyim.Caching.NLogAdapter/Enyim.Caching.NLogAdapter.nuspec
@@ -0,0 +1,21 @@
+<?xml version="1.0"?>
+<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
+ <metadata>
+ <id>EnyimMemcached-NLog</id>
+ <version>$version$</version>
+ <authors>Attila Kiskó</authors>
+ <owners>Attila Kiskó</owners>
+ <licenseUrl>http://www.apache.org/licenses/LICENSE-2.0</licenseUrl>
+ <projectUrl>https://github.com/enyim/EnyimMemcached</projectUrl>
+ <requireLicenseAcceptance>false</requireLicenseAcceptance>
+ <description>NLog based logging adapter for the Enyim Memcached library.</description>
+ <tags>memcached enyim cache caching NLog</tags>
+ <dependencies>
+ <dependency id="NLog" />
+ </dependencies>
+ </metadata>
+ <files>
+ <file src="bin\Release\Enyim.Caching.NLogAdapter.*" target="lib\net35" />
+ <file src="config.transform" target="content\app.config.transform" />
+ </files>
+</package>
View
28 Enyim.Caching/Config.transform
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<configuration>
+ <configSections>
+ <sectionGroup name="enyim.com">
+ <section name="memcached" type="Enyim.Caching.Configuration.MemcachedClientSection, Enyim.Caching" />
+ </sectionGroup>
+ </configSections>
+
+ <enyim.com>
+ <!--
+ Please read the documentation first:
+ http://github.com/enyim/EnyimMemcached/wiki/MemcachedClient-Configuration
+
+ Use this section as a template if you're connecting to regular memcached servers.
+ Note: you must have the enyim.com/memcached section if you're using the parameterless constructor of EnyimMemcachedClient.
+ -->
+ <memcached>
+ <servers>
+ <!-- make sure you use the same ordering of nodes in every configuration you have -->
+ <add address="127.0.0.1" port="20002" />
+ <add address="127.0.0.1" port="20004" />
+ <add address="127.0.0.1" port="20006" />
+ <add address="127.0.0.1" port="20008" />
+ </servers>
+ </memcached>
+ </enyim.com>
+
+</configuration>
View
6 Enyim.Caching/Demo.config
@@ -6,6 +6,7 @@
</sectionGroup>
</configSections>
+ <enyim.com>
<!--
Please read the documentation first:
http://github.com/enyim/EnyimMemcached/wiki/MemcachedClient-Configuration
@@ -13,8 +14,6 @@
Use this section as a template if you're connecting to regular memcached servers.
Note: you must have the enyim.com/memcached section if you're using the parameterless constructor of EnyimMemcachedClient.
-->
- <enyim.com>
- <!-- you can use protocol="Text" if your memcached is < 1.3 but you should probably upgrade -->
<memcached>
<servers>
<!-- make sure you use the same ordering of nodes in every configuration you have -->
@@ -23,9 +22,6 @@
<add address="127.0.0.1" port="20006" />
<add address="127.0.0.1" port="20008" />
</servers>
- <!-- It's not recommended to use timeouts lower than 1-2sec.
- <socketPool connectionTimeout="00:00:10" deadTimeout="00:00:10" />
- -->
</memcached>
</enyim.com>
View
2  Enyim.Caching/Enyim.Caching.csproj
@@ -256,7 +256,9 @@
</ItemGroup>
<ItemGroup>
<None Include="Changes.mdown" />
+ <None Include="Config.transform" />
<None Include="Demo.config" />
+ <None Include="Enyim.Caching.nuspec" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
View
20 Enyim.Caching/Enyim.Caching.nuspec
@@ -0,0 +1,20 @@
+<?xml version="1.0"?>
+<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
+ <metadata>
+ <id>EnyimMemcached</id>
+ <version>$version$</version>
+ <authors>Attila Kiskó</authors>
+ <owners>Attila Kiskó</owners>
+ <licenseUrl>http://www.apache.org/licenses/LICENSE-2.0</licenseUrl>
+ <projectUrl>https://github.com/enyim/EnyimMemcached</projectUrl>
+ <requireLicenseAcceptance>false</requireLicenseAcceptance>
+ <description>Memcached client library for .NET based languages.</description>
+ <tags>memcached enyim cache caching</tags>
+ </metadata>
+ <files>
+ <file src="bin\Release\*.dll" target="lib\net35" />
+ <file src="bin\Release\*.pdb" target="lib\net35" />
+ <file src="bin\Release\*.xml" target="lib\net35" />
+ <file src="bin\Release\*.transform" target="content" />
+ </files>
+</package>
View
28 Membase/Config.transform
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<configuration>
+ <configSections>
+ <section name="membase" type="Membase.Configuration.MembaseClientSection, Membase" />
+ </configSections>
+
+ <membase>
+ <!--
+ Please read the documentation first:
+ http://github.com/enyim/EnyimMemcached/wiki/MembaseClient-configuration
+
+ Use this section as a template if you're connecting to Membase Servers.
+ Note: you must have the top-level membase section if you're using the parameterless constructor of MembaseClient.
+ -->
+ <servers bucket="enyim" bucketPassword="password" retryCount="2" retryTimeout="00:00:02">
+ <!--
+ Provide at least 2-3 urls from your cluster.
+ Usually you only need to change the host, except when connecting to older versions.
+ Membase uses port 8091, while the NorthScale Memcached Server (1.0.3) uses 8080
+ -->
+ <add uri="http://192.168.2.202:8091/pools/default" />
+ <add uri="http://192.168.2.200:8091/pools/default" />
+ </servers>
+ <!-- the client waits deadTmimeout time to reconnect to the pool when all the specified urls are down -->
+ <socketPool connectionTimeout="00:00:10" deadTimeout="00:00:10" />
+ </membase>
+
+</configuration>
View
24 Membase/Demo.config
@@ -4,25 +4,13 @@
<section name="membase" type="Membase.Configuration.MembaseClientSection, Membase" />
</configSections>
- <!--
- Please read the documentation first:
- http://github.com/enyim/EnyimMemcached/wiki/MembaseClient-configuration
-
- Use this section as a template if you're connecting to Membase Servers.
- Note: you must have the top-level membase section if you're using the parameterless constructor of MembaseClient.
- -->
<membase>
- <!--
-
- Bucket is optional and can be specified in the constructor, so you
- can use the same configuration to connect to different buckets in the cluster.
-
- You must provide userName and password if the server is "secured" (membase is secured by default).
-
- - bucketPassword (optional) : set the password of your bucket. Optional for membase 1.6+ where the client canfind this out automatically.
- - retryCount (optional, default 0): the number of times to reconnect to a pool url before marking it as dead. (useful for ec2/amazon where the load balancer closes our connection to the pool)
- - retryTimeout (optional, default 2secs): the time to wait between two retry attempts
-
+ <!--
+ Please read the documentation first:
+ http://github.com/enyim/EnyimMemcached/wiki/MembaseClient-configuration
+
+ Use this section as a template if you're connecting to Membase Servers.
+ Note: you must have the top-level membase section if you're using the parameterless constructor of MembaseClient.
-->
<servers bucket="enyim" bucketPassword="password" retryCount="2" retryTimeout="00:00:02">
<!--
View
2  Membase/Membase.csproj
@@ -78,8 +78,10 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
+ <None Include="Config.transform" />
<None Include="Demo.config" />
<None Include="Changes.mdown" />
+ <None Include="Membase.nuspec" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
View
19 Membase/Membase.nuspec
@@ -0,0 +1,19 @@
+<?xml version="1.0"?>
+<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
+ <metadata>
+ <id>Membase</id>
+ <version>$version$</version>
+ <authors>Attila Kiskó</authors>
+ <owners>Attila Kiskó</owners>
+ <licenseUrl>http://www.apache.org/licenses/LICENSE-2.0</licenseUrl>
+ <projectUrl>https://github.com/enyim/EnyimMemcached</projectUrl>
+ <requireLicenseAcceptance>false</requireLicenseAcceptance>
+ <description>Membase client library for .NET based languages.</description>
+ <tags>membase enyim cache caching nosql</tags>
+ </metadata>
+ <files>
+ <file src="bin\Release\Enyim.Caching.*" target="lib\net35" />
+ <file src="bin\Release\Membase.*" target="lib\net35" />
+ <file src="config.transform" target="content\app.config.transform" />
+ </files>
+</package>
View
1  build.cmd
@@ -1 +0,0 @@
-@powershell -noprofile -command "&'.\build\build.ps1'"
View
3  build/build.ps1
@@ -17,6 +17,7 @@
- Clean
- Build
- Rebuild
+ - Nuget
If omitted the 'Default' task will be run.
@@ -43,7 +44,7 @@ param(
[string]$KeyPath = $null,
[string]$KeyName = $null)
-. .\parameters.ps1
+. .\properties.ps1
$tmp = $buildParams + @{ "private_key_path" = "$KeyPath"; "private_key_name" = "$KeyName"; }
View
96 build/default.ps1
@@ -2,18 +2,20 @@ Properties {
# these options must be overriden by the parent script
#$solution_name = "Enyim.Caching.sln"
#$projects = @( "Enyim.Caching", "Membase" )
+ #$packages = @( "Enyim.Caching", "Enyim.Caching.Log4NetAdapter", "Enyim.Caching.NLogAdapter" )
#$extras = @{ "Enyim.Caching.Log4NetAdapter" = "log4net"; "Enyim.Caching.NLogAdapter" = "NLog" }
# these are fixed
$build_root = Split-Path $psake.build_script_file
- $source_root = "$build_root\.."
- $output_root = "$build_root\output"
+ $source_root = resolve-path "$build_root\.."
+ $output_root = join-path $build_root "output"
+ $temp_root = join-path $build_root "_temp"
}
Include "./utils.ps1"
FormatTaskName (("-"*20) + "[{0}]" + ("-"*20))
-Task Default -depends _NeedsPrivateKey, Rebuild, _Package
+Task Default -depends _NeedsPrivateKey, Rebuild, _Zip, _Nuget
Task Clean -depends _Clean {
# removes the files created by the build process
@@ -23,10 +25,14 @@ Task Build -depends _Build {
# builds the projects
}
-Task Rebuild -depends Clean,Build {
+Task Rebuild -depends Clean, Build {
# clean & build
}
+Task Nuget -depends _Nuget {
+ # builds the nuget packages
+}
+
################################################################################
################################################################################
@@ -50,9 +56,7 @@ Task _Clean -depends _CheckConfig {
Write-Host "Cleaning the solution." -ForegroundColor Green
- remove-output-dir
-
- Exec { msbuild "$source_root\$solution_name" /t:Clean /p:"Configuration=Release" }
+ Exec { msbuild "$source_root\$solution_name" /t:Clean /p:"Configuration=Release" }
}
#################### Build ####################
@@ -65,45 +69,54 @@ Task _Build -depends _CheckConfig {
Exec { msbuild "$source_root\$solution_name" /t:Build /p:"Configuration=Release;PrivateKeyName=$private_key_name;PrivateKeyPath=$script:private_key_path" }
}
-#################### Package ####################
+#################### Nuget ####################
-Task _Package -depends _PreparePackage -PostAction { remove-output-dir } {
+Task _Nuget -depends _Build -PreAction { create-output-dir } {
- $zip = get7zip
+ $packages | % {
- $projects | % {
+ $package = $_
- $proj = $_
- $proj_dest = "$output_root\$proj"
+ $version = (get-assembly-version -Path "$source_root\$package\bin\Release\$package.dll")
+ $version = "$( $version.Major ).$( $version.Minor )"
- # we have to remove the tag from the version (emc2.3.4-9786545)
- $version = get-assembly-title -Path "$proj_dest\$proj.dll"
- $zipname = $build_root + "\" + $proj + "." + ($version -replace "^[^0-9]+", "") + ".zip"
+ Exec { ./tools/nuget pack "$source_root\$package\$package.nuspec" -Properties version=$version -OutputDirectory $output_root }
+ }
+}
- del $zipname -ErrorAction SilentlyContinue | out-null
+#################### Zip ####################
- # 7zip roots the files relative to the current path
- pushd
- cd $proj_dest > $nul
+Task _Zip -PreAction {
+ if (test-path $temp_root) {
+ remove-item $temp_root -Recurse -Force -ErrorAction Stop
+ }
- .$zip a -mx9 "$zipname" "." "$source_root\LICENSE" "$output_root\Readme.html"
+ mkdir $temp_root -ErrorAction Stop | out-null
+ create-output-dir
+} -PostAction {
+ remove-item "$temp_root" -Recurse -Force -ErrorAction SilentlyContinue
+} -depends _CheckConfig {
- popd
- }
-}
+ Assert (test-path $temp_root) "temp_root missing"
+
+ $zip = get7zip
-Task _PreparePackage -depends _CheckConfig, _Build -PreAction { remove-output-dir;create-output-dir } {
+ set-content "$temp_root\Readme.html" `
+ -Value (transform-markdown `
+ -TemplatePath "$build_root\template.html" `
+ -FilePath "$source_root\README.mdown" `
+ -Title "Read Me")
$projects | % {
$proj = $_
- # output\project_name
- $proj_dest = "$output_root\$proj"
+ # temp\project_name
+ $proj_dest = "$temp_root\$proj"
mkdir $proj_dest | out-null
copy "$source_root\$proj\bin\Release\*.*" $proj_dest
- copy "$source_root\$proj\Demo.config" $proj_dest
+ copy "$source_root\$proj\*.config" $proj_dest
set-content "$proj_dest\Changes.html" `
-Value (transform-markdown `
@@ -114,29 +127,32 @@ Task _PreparePackage -depends _CheckConfig, _Build -PreAction { remove-output-di
if ($extras -ne $null) {
$extras.Keys | % {
- # output\project_name\extra_project
+ # temp\project_name\extra_project
$extra_dest = $proj_dest + "\" + $extras[$_]
md $extra_dest | out-null
copy @("$source_root\$_\bin\release\$_.*", "$source_root\$_\Demo.config") -Destination $extra_dest
}
}
- }
- set-content "$output_root\Readme.html" `
- -Value (transform-markdown `
- -TemplatePath "$build_root\template.html" `
- -FilePath "$source_root\README.mdown" `
- -Title "Read Me")
-}
+ # we have to remove the tag from the version (emc2.3.4-9786545)
+ $version = get-assembly-title -Path "$proj_dest\$proj.dll"
+ $zipname = $output_root + "\" + $proj + "." + ($version -replace "^[^0-9]+", "") + ".zip"
-#################### helpers ####################
+ del $zipname -ErrorAction SilentlyContinue | out-null
-function remove-output-dir
-{
- remove-item $output_root -Recurse -Force -ErrorAction SilentlyContinue
+ # 7zip roots the files relative to the current path
+ pushd
+ cd $proj_dest > $nul
+
+ .$zip a -mx9 "$zipname" "." "$source_root\LICENSE" "$temp_root\Readme.html"
+
+ popd
+ }
}
+#################### helpers ####################
+
function create-output-dir
{
mkdir $output_root -ErrorAction SilentlyContinue | out-null
View
1  build/parameters.ps1 → build/properties.ps1
@@ -2,4 +2,5 @@ $buildParams = @{
"solution_name" = "Enyim.Caching.sln";
"projects" = @( "Enyim.Caching", "Membase" );
"extras" = @{ "Enyim.Caching.Log4NetAdapter" = "log4net"; "Enyim.Caching.NLogAdapter" = "NLog" };
+ "packages" = @( "Enyim.Caching", "Enyim.Caching.Log4NetAdapter", "Enyim.Caching.NLogAdapter", "Membase" );
}
View
BIN  build/tools/NuGet.exe
Binary file not shown
View
12 build/utils.ps1
@@ -10,6 +10,18 @@ function global:get-assembly-title
return $d.Title
}
+function global:get-assembly-version
+{
+ param([string] $Path)
+
+ $file = get-item $Path
+ $content = [io.file]::ReadAllBytes($file.fullname)
+ $a = [System.Reflection.Assembly]::Load($content)
+ $name = $a.GetName()
+
+ return $name.Version
+}
+
$Markdown = $null
function global:transform-markdown
Please sign in to comment.
Something went wrong with that request. Please try again.