Skip to content

Commit

Permalink
Lots of migration to new bits, separate nuspec for dashboard, nested …
Browse files Browse the repository at this point in the history
…builds
  • Loading branch information
F.D.Castel authored and phatboyg committed Mar 1, 2012
1 parent 16a5722 commit 6410837
Show file tree
Hide file tree
Showing 36 changed files with 936 additions and 429 deletions.
27 changes: 27 additions & 0 deletions Topshelf.Dashboard.nuspec
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>Topshelf.Dashboard</id>
<version>2.3.0.0</version>
<authors>Chris Patterson, Dru Sellers, Travis Smith</authors>
<description>Topshelf is a service library and hosting framework for .NET</description>
<language>en-US</language>
<iconUrl>http://topshelf-project.com/wp-content/themes/pandora/img/slide.1.png</iconUrl>
<licenseUrl>https://github.com/Topshelf/Topshelf/blob/master/LICENSE</licenseUrl>
<projectUrl>https://github.com/Topshelf/Topshelf</projectUrl>
<dependencies>
<dependency id="log4net" version="1.2.11" />
<dependency id="Topshelf" version="2.3.0.0" />
<dependency id="Spark" version="1.6" />
</dependencies>
</metadata>
<files>
<file src="build_output\NET35\Topshelf.Dashboard.dll" target="lib\NET35" />
<file src="build_output\NET35\Topshelf.Dashboard.xml" target="lib\NET35" />
<file src="build_output\NET35\Topshelf.Dashboard.pdb" target="lib\NET35" />
<file src="build_output\NET40\Topshelf.Dashboard.dll" target="lib\NET40" />
<file src="build_output\NET40\Topshelf.Dashboard.xml" target="lib\NET40" />
<file src="build_output\NET40\Topshelf.Dashboard.pdb" target="lib\NET40" />
</files>
</package>

4 changes: 2 additions & 2 deletions Topshelf.nuspec
Expand Up @@ -2,15 +2,15 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>Topshelf</id>
<version>2.2.3.0</version>
<version>2.3.0.0</version>
<authors>Chris Patterson, Dru Sellers, Travis Smith</authors>
<description>Topshelf is a service library and hosting framework for .NET</description>
<language>en-US</language>
<iconUrl>http://topshelf-project.com/wp-content/themes/pandora/img/slide.1.png</iconUrl>
<licenseUrl>https://github.com/Topshelf/Topshelf/blob/master/LICENSE</licenseUrl>
<projectUrl>https://github.com/Topshelf/Topshelf</projectUrl>
<dependencies>
<dependency id="log4net" version="1.2.10" />
<dependency id="log4net" version="1.2.11" />
</dependencies>
</metadata>
<files>
Expand Down
Binary file modified lib/Spark/NET35/Spark.dll
Binary file not shown.
Binary file modified lib/Spark/NET40/Spark.dll
Binary file not shown.
33 changes: 27 additions & 6 deletions rakefile.rb
Expand Up @@ -52,10 +52,10 @@
task :all => [:default, :package, :moma]

desc "**Default**, compiles and runs tests"
task :default => [:clean, :compile, :ilmerge, :tests, :prepare_examples]
task :default => [:clean, :compile, :tests, :prepare_examples]

desc "**DOOES NOT CLEAR OUTPUT FOLDER**, compiles and runs tests"
task :unclean => [:compile, :ilmerge, :tests, :prepare_examples]
task :unclean => [:prepare, :compile, :tests, :prepare_examples]

desc "Update the common version information for the build. You can call this task without building."
assemblyinfo :global_version do |asm|
Expand Down Expand Up @@ -90,12 +90,19 @@

Dir.mkdir props[:stage]
Dir.mkdir props[:artifacts]
Dir.mkdir props[:output]
end

task :prepare do
Dir.mkdir props[:output]
end

desc "Cleans, versions, compiles the application and generates build_output/."
task :compile => [:global_version, :build, :build_x86] do
task :compile => [:global_version, :build] do
puts 'Copying unmerged dependencies to output folder'
copyOutputFiles File.join(props[:lib], "Magnum/#{OUTPUT_PATH}"), "Magnum.{dll,pdb,xml}", File.join(props[:src], "Topshelf/bin/#{BUILD_CONFIG}")
copyOutputFiles File.join(props[:src], "Topshelf.Dashboard/bin/#{BUILD_CONFIG}"), "Topshelf.Dashboard.{dll,pdb,xml,config}", props[:output]
copyOutputFiles File.join(props[:src], "Topshelf.Dashboard/bin/#{BUILD_CONFIG}"), "Spark.{dll,pdb}", props[:output]
copyOutputFiles File.join(props[:src], "Topshelf.Host/bin/#{BUILD_CONFIG}"), "log4net.{dll,pdb,xml,config}", props[:output]
copyOutputFiles File.join(props[:src], "Topshelf.Host/bin/#{BUILD_CONFIG}"), "Topshelf.Host.{exe,pdb}", props[:output]
copyOutputFiles File.join(props[:src], "Topshelf.Host/bin/#{BUILD_CONFIG}"), "Topshelf.Host.exe.config", props[:output]
Expand All @@ -113,7 +120,7 @@
ilm.use MSB_USE
ilm.log = File.join( props[:src], "Topshelf","bin","#{BUILD_CONFIG}", 'ilmerge.log' )
ilm.allow_dupes = true
ilm.references = [ 'Topshelf.dll', 'Stact.dll', 'Stact.ServerFramework.dll', 'Magnum.dll', 'Spark.dll' ]
ilm.references = [ 'Topshelf.dll', 'Stact.dll', 'Stact.ServerFramework.dll', 'Magnum.dll']
end

desc "Prepare examples"
Expand All @@ -132,6 +139,8 @@
what_commit.close
end

task :build => [:build_ts, :ilmerge, :build_host, :build_x86]

desc "INTERNAL: Compiles the app in x86 mode"
msbuild :build_x86 do |msb|
msb.properties :Configuration => BUILD_CONFIG,
Expand All @@ -140,11 +149,11 @@
:Platform => 'x86'
msb.use MSB_USE
msb.targets :Clean, :Build
msb.solution = 'src/Topshelf.sln'
msb.solution = 'src/Topshelf.Host.sln'
end

desc "Only compiles the application."
msbuild :build do |msb|
msbuild :build_ts do |msb|
msb.properties :Configuration => BUILD_CONFIG,
:BuildConfigKey => BUILD_CONFIG_KEY,
:TargetFrameworkVersion => TARGET_FRAMEWORK_VERSION,
Expand All @@ -154,6 +163,17 @@
msb.solution = 'src/Topshelf.sln'
end

desc "Only compiles the application."
msbuild :build_host do |msb|
msb.properties :Configuration => BUILD_CONFIG,
:BuildConfigKey => BUILD_CONFIG_KEY,
:TargetFrameworkVersion => TARGET_FRAMEWORK_VERSION,
:Platform => 'Any CPU'
msb.use MSB_USE
msb.targets :Clean, :Build
msb.solution = 'src/Topshelf.Host.sln'
end

def copyOutputFiles(fromDir, filePattern, outDir)
FileUtils.mkdir_p outDir unless exists?(outDir)
Dir.glob(File.join(fromDir, filePattern)){|file|
Expand Down Expand Up @@ -210,6 +230,7 @@ def copyOutputFiles(fromDir, filePattern, outDir)
desc "Builds the nuget package"
task :nuget do
sh "lib/nuget pack topshelf.nuspec /OutputDirectory build_artifacts"
sh "lib/nuget pack topshelf.dashboard.nuspec /OutputDirectory build_artifacts"
end

def project_outputs(props)
Expand Down
17 changes: 6 additions & 11 deletions src/Samples/Stuff/Program.cs
@@ -1,4 +1,4 @@
// Copyright 2007-2008 The Apache Software Foundation.
// Copyright 2007-2011 The Apache Software Foundation.
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
// this file except in compliance with the License. You may obtain a copy of the
Expand All @@ -10,27 +10,22 @@
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.

namespace Stuff
{
using System;
using System.IO;
using log4net.Config;
using Topshelf;
using Topshelf.Configuration;
using Topshelf.Configuration.Dsl;
using log4net.Config;

internal class Program

class Program
{
static void Main(string[] args)
{
XmlConfigurator.ConfigureAndWatch(new FileInfo(".\\log4net.config"));

var h = HostFactory.New(x =>
Host h = HostFactory.New(x =>
{
x.AfterStoppingServices(n => Console.WriteLine("AfterStoppingServices action invoked, services are stopping"));
x.EnableDashboard();
x.Service<TownCrier>(s =>
{
s.SetServiceName("TownCrier");
Expand Down
12 changes: 6 additions & 6 deletions src/Samples/Stuff/Stuff.csproj
Expand Up @@ -68,12 +68,6 @@
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="TownCrier.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Topshelf\Topshelf.csproj">
<Project>{1EEC6A0D-F213-4716-B5CC-33782BCE1908}</Project>
<Name>Topshelf</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="log4net.config">
Expand All @@ -97,6 +91,12 @@
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Topshelf\Topshelf.csproj">
<Project>{1EEC6A0D-F213-4716-B5CC-33782BCE1908}</Project>
<Name>Topshelf</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
11 changes: 11 additions & 0 deletions src/Topshelf.1.2.dotCover
@@ -0,0 +1,11 @@
<Configuration>
<SnapshotDialog>
<InitialDirectory>D:\Home\Topshelf\src</InitialDirectory>
</SnapshotDialog>
<CoverageFilters>
<IncludeFilters>
<Filter ModuleMask="*" ClassMask="*" FunctionMask="*" />
</IncludeFilters>
<ExcludeFilters />
</CoverageFilters>
</Configuration>

0 comments on commit 6410837

Please sign in to comment.