singrdk/base/Targets/ServiceCategory.targets

72 lines
3.3 KiB
Plaintext
Raw Normal View History

2008-03-05 09:52:00 -05:00
<!--
2008-11-17 18:29:00 -05:00
###############################################################################
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
###############################################################################
-->
2008-03-05 09:52:00 -05:00
2008-11-17 18:29:00 -05:00
<!--
2008-03-05 09:52:00 -05:00
Service executables should import this file.
2008-11-17 18:29:00 -05:00
The distro builder automatically builds a list of all service projects (projects that import
this file), and will add service definitions to the system manifest (metadata.xml). When the
system boots, the kernel passes these service entries to the Service Manager. So, if your
project imports this file, then your service project will automatically be picked up by the
Service Manager at boot time.
Projects that import this file MUST define the following properties:
* ServiceActivationMode - The Service Manager uses this value to control when it should
start instances of the service (service processes). Valid values:
* Manual - The Service Manager never starts are stops processes. Instead, management
clients send requests to the Service Manager to start and stop processes.
* AlwaysActive - The Service Manager always attempts to keep an instance of the service
running. If a process terminates, the Service Manager will create a new instance, etc.
* Demand - The Service Manager does not immediately create any processes for the service.
Instead, processes are created when clients connect to the service, as needed.
These properties are optional:
* ApplyServiceTransform - (boolean) By default, ServiceCategory.targets will automatically
include a source file in the build process that declares the CTR Transform attribute,
which applies the service resource transform to the project. If a project does not want
this transform applied, it can set this property to 'false' to inhibit this.
2008-03-05 09:52:00 -05:00
-->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2008-11-17 18:29:00 -05:00
<PropertyGroup>
<ApplicationCategory>Service</ApplicationCategory>
<OutputItemAdditionalMetadata>$(OutputItemAdditionalMetadata);ServiceActivationMode=$(ServiceActivationMode)</OutputItemAdditionalMetadata>
<CheckPropertiesDependsOn>$(CheckPropertiesDependsOn);CheckServiceProperties</CheckPropertiesDependsOn>
</PropertyGroup>
2008-03-05 09:52:00 -05:00
<ItemGroup>
<ProjectReference Include="$(SINGULARITY_ROOT)\Services\Transforms\ServiceTransform.csproj">
<ExcludeFromNativeReferences>true</ExcludeFromNativeReferences>
</ProjectReference>
2008-11-17 18:29:00 -05:00
<Compile Condition="'$(ApplyServiceTransform)'!='false'"
Include="$(SINGULARITY_ROOT)\Services\Transforms\ApplyServiceTransform.sg"/>
2008-03-05 09:52:00 -05:00
</ItemGroup>
2008-11-17 18:29:00 -05:00
<Target Name="CheckServiceProperties">
<Error Condition="'$(ServiceActivationMode)' == ''"
Text="All service projects are required to set the ServiceActivationMode property. This project does not."/>
<Error Condition="'$(ServiceActivationMode)' != 'AlwaysActive'
and '$(ServiceActivationMode)' != 'Demand'
and '$(ServiceActivationMode)' != 'Manual'
and '$(ServiceActivationMode)' != ''"
Text="The value '$(ServiceActivationMode)' is not a valid choice for the ServiceActivationMode property. Valid values are Manual, Demand, and AlwaysActive."/>
</Target>
2008-03-05 09:52:00 -05:00
<Import Project="App.targets"/>
</Project>