Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Revert back to using NuGet in a more (Visual Studio -wise) standard way

  • Loading branch information...
commit 3e85515952170351329dfaf7424eb966bdf26acd 1 parent 51a956f
Marko Lahma lahma authored
BIN  .nuget/NuGet.exe
View
Binary file not shown
12 .nuget/NuGet.targets
View
@@ -8,6 +8,9 @@
<!-- Property that enables building a package from a project -->
<BuildPackage Condition=" '$(BuildPackage)' == '' ">false</BuildPackage>
+
+ <!-- Determines if package restore consent is required to restore packages -->
+ <RequireRestoreConsent Condition=" '$(RequireRestoreConsent)' != 'false' ">true</RequireRestoreConsent>
<!-- Download NuGet.exe if it does not already exist -->
<DownloadNuGetExe Condition=" '$(DownloadNuGetExe)' == '' ">false</DownloadNuGetExe>
@@ -24,14 +27,14 @@
<PropertyGroup Condition=" '$(OS)' == 'Windows_NT'">
<!-- Windows specific commands -->
<NuGetToolsPath>$([System.IO.Path]::Combine($(SolutionDir), ".nuget"))</NuGetToolsPath>
- <PackagesConfig>$([System.IO.Path]::Combine($(SolutionDir), "packages.config"))</PackagesConfig>
+ <PackagesConfig>$([System.IO.Path]::Combine($(ProjectDir), "packages.config"))</PackagesConfig>
<PackagesDir>$([System.IO.Path]::Combine($(SolutionDir), "packages"))</PackagesDir>
</PropertyGroup>
<PropertyGroup Condition=" '$(OS)' != 'Windows_NT'">
<!-- We need to launch nuget.exe with the mono command if we're not on windows -->
<NuGetToolsPath>$(SolutionDir).nuget</NuGetToolsPath>
- <PackagesConfig>$(SolutionDir)packages.config</PackagesConfig>
+ <PackagesConfig>packages.config</PackagesConfig>
<PackagesDir>$(SolutionDir)packages</PackagesDir>
</PropertyGroup>
@@ -44,9 +47,10 @@
<NuGetCommand Condition=" '$(OS)' != 'Windows_NT' ">mono --runtime=v4.0.30319 $(NuGetExePath)</NuGetCommand>
<PackageOutputDir Condition="$(PackageOutputDir) == ''">$(TargetDir.Trim('\\'))</PackageOutputDir>
-
+
+ <RequireConsentSwitch Condition=" $(RequireRestoreConsent) == 'true' ">-RequireConsent</RequireConsentSwitch>
<!-- Commands -->
- <RestoreCommand>$(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" -o "$(PackagesDir)"</RestoreCommand>
+ <RestoreCommand>$(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(RequireConsentSwitch) -o "$(PackagesDir)"</RestoreCommand>
<BuildCommand>$(NuGetCommand) pack "$(ProjectPath)" -p Configuration=$(Configuration) -o "$(PackageOutputDir)" -symbols</BuildCommand>
<!-- Make the build depend on restore packages -->
6 packages/repositories.config
View
@@ -1,4 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<repositories>
- <repository path="..\packages.config" />
+ <repository path="..\server\Quartz.Server\packages.config" />
+ <repository path="..\src\Quartz.Examples\packages.config" />
+ <repository path="..\src\Quartz.Tests.Integration\packages.config" />
+ <repository path="..\src\Quartz.Tests.Unit\packages.config" />
+ <repository path="..\src\Quartz\packages.config" />
</repositories>
42 server/Quartz.Server/Program.cs
View
@@ -10,35 +10,23 @@ public static class Program
/// <summary>
/// Main.
/// </summary>
- /// <param name="args"></param>
- public static void Main(string[] args)
+ public static void Main()
{
- Host host = HostFactory.New(x =>
- {
- x.Service<IQuartzServer>(s =>
- {
- s.SetServiceName("quartz.server");
- s.ConstructUsing(builder =>
- {
- QuartzServer server = new QuartzServer();
- server.Initialize();
- return server;
- });
- s.WhenStarted(server => server.Start());
- s.WhenPaused(server => server.Pause());
- s.WhenContinued(server => server.Resume());
- s.WhenStopped(server => server.Stop());
- });
+ HostFactory.Run(x =>
+ {
+ x.RunAsLocalSystem();
- x.RunAsLocalSystem();
+ x.SetDescription(Configuration.ServiceDescription);
+ x.SetDisplayName(Configuration.ServiceDisplayName);
+ x.SetServiceName(Configuration.ServiceName);
- x.SetDescription(Configuration.ServiceDescription);
- x.SetDisplayName(Configuration.ServiceDisplayName);
- x.SetServiceName(Configuration.ServiceName);
- });
-
- host.Run();
+ x.Service(factory =>
+ {
+ QuartzServer server = new QuartzServer();
+ server.Initialize();
+ return server;
+ });
+ });
}
-
}
-}
+}
8 server/Quartz.Server/Quartz.Server.2010.csproj
View
@@ -45,6 +45,8 @@
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
+ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+ <RestorePackages>true</RestorePackages>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<OutputPath>..\..\build\4.0\Debug\Quartz.Server\</OutputPath>
@@ -111,8 +113,9 @@
<Reference Include="System.Xml">
<Name>System.XML</Name>
</Reference>
- <Reference Include="Topshelf">
- <HintPath>..\..\packages\TopShelf.2.3.0.0\lib\NET40\Topshelf.dll</HintPath>
+ <Reference Include="Topshelf, Version=3.0.85.0, Culture=neutral, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\..\packages\Topshelf.3.0.0\lib\net40-full\Topshelf.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
@@ -170,4 +173,5 @@
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
+ <Import Project="$(SolutionDir)\.nuget\nuget.targets" />
</Project>
39 server/Quartz.Server/QuartzServer.cs
View
@@ -2,13 +2,14 @@
using System.Threading;
using Common.Logging;
using Quartz.Impl;
+using Topshelf;
namespace Quartz.Server
{
/// <summary>
/// The main server logic.
/// </summary>
- public class QuartzServer : IQuartzServer
+ public class QuartzServer : ServiceControl, IQuartzServer
{
private readonly ILog logger;
private ISchedulerFactory schedulerFactory;
@@ -117,5 +118,41 @@ public void Resume()
{
scheduler.ResumeAll();
}
+
+ /// <summary>
+ /// TopShelf's method delegated to <see cref="Start()"/>.
+ /// </summary>
+ public bool Start(HostControl hostControl)
+ {
+ Start();
+ return true;
+ }
+
+ /// <summary>
+ /// TopShelf's method delegated to <see cref="Stop()"/>.
+ /// </summary>
+ public bool Stop(HostControl hostControl)
+ {
+ Stop();
+ return true;
+ }
+
+ /// <summary>
+ /// TopShelf's method delegated to <see cref="Pause()"/>.
+ /// </summary>
+ public bool Pause(HostControl hostControl)
+ {
+ Pause();
+ return true;
+ }
+
+ /// <summary>
+ /// TopShelf's method delegated to <see cref="Resume()"/>.
+ /// </summary>
+ public bool Continue(HostControl hostControl)
+ {
+ Resume();
+ return true;
+ }
}
}
4 packages.config → server/Quartz.Server/packages.config
View
@@ -3,7 +3,5 @@
<package id="Common.Logging" version="2.1.1" />
<package id="Common.Logging.Log4Net1211" version="2.1.1" />
<package id="log4net" version="1.2.11" />
- <package id="NUnit" version="2.6.0.12054" />
- <package id="RhinoMocks" version="3.6.1" />
- <package id="Topshelf" version="2.3" />
+ <package id="TopShelf" version="3.0.0" />
</packages>
4 src/Quartz.Examples/packages.config
View
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+ <package id="Common.Logging" version="2.1.1" />
+</packages>
3  src/Quartz.Tests.Integration/Quartz.Tests.Integration.2010.csproj
View
@@ -30,6 +30,8 @@
<OldToolsVersion>3.5</OldToolsVersion>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile />
+ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+ <RestorePackages>true</RestorePackages>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<OutputPath>..\..\build\4.0\Debug\Quartz.Tests.Integration\</OutputPath>
@@ -129,4 +131,5 @@
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
+ <Import Project="$(SolutionDir)\.nuget\nuget.targets" />
</Project>
6 src/Quartz.Tests.Integration/packages.config
View
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+ <package id="Common.Logging" version="2.1.1" />
+ <package id="NUnit" version="2.6.0.12054" />
+ <package id="RhinoMocks" version="3.6.1" />
+</packages>
3  src/Quartz.Tests.Unit/Quartz.Tests.Unit.2010.csproj
View
@@ -30,6 +30,8 @@
<OldToolsVersion>3.5</OldToolsVersion>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile />
+ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+ <RestorePackages>true</RestorePackages>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<OutputPath>..\..\build\4.0\Debug\Quartz.Tests.Unit\</OutputPath>
@@ -257,4 +259,5 @@
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
+ <Import Project="$(SolutionDir)\.nuget\nuget.targets" />
</Project>
6 src/Quartz.Tests.Unit/packages.config
View
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+ <package id="Common.Logging" version="2.1.1" />
+ <package id="NUnit" version="2.6.0.12054" />
+ <package id="RhinoMocks" version="3.6.1" />
+</packages>
4 src/Quartz/packages.config
View
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+ <package id="Common.Logging" version="2.1.1" />
+</packages>
Please sign in to comment.
Something went wrong with that request. Please try again.