Yet Another WSPBuilder Suggestion - DeploymentServerType

Jul 28, 2007 at 1:37 PM
Edited Jul 28, 2007 at 2:21 PM
Hey here is another idea.
To support the Solution DeploymentServerType in WSPbuilder, add the following code. This allows specifing the type on the command line.


Thanks!!!



<Solution DeploymentServerType="ApplicationServer" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" SolutionId="aaa2e700-0001-0001-5012-123456789012 ResetWebServer="FALSE" xmlns="http://schemas.microsoft.com/sharepoint/">


-- Added to SolutionHandler.cs

public void Build()
{
this.Solution.DeploymentServerType = Config.Current.DeploymentServerType;
this.Solution.DeploymentServerTypeSpecified = Config.Current.DeploymentServerTypeFieldSpecified;



- Added to Config.cs
public const string DEPLOYMENTSERVERTYPE = "DeploymentServerType";
private DeploymentServerTypeAttr _DeploymentServerTypeAttr = DeploymentServerTypeAttr.WebFrontEnd;


DisplayName("-DeploymentServerType [ApplicationServer
Description("Specifies if the solution is a targeted to a webfront end or an application")

public DeploymentServerTypeAttr DeploymentServerType
{
get {
string DepServertype = string.Empty;
_arguments.TryGetValue(DEPLOYMENTSERVERTYPE,out DepServertype);
if (DepServertype != null && DepServertype != string.Empty))
{
if (Enum.IsDefined(typeof(DeploymentServerTypeAttr), DepServertype))
{
_DeploymentServerTypeAttr = (DeploymentServerTypeAttr)Enum.Parse(typeof(DeploymentServerTypeAttr), DepServertype, true);
_DeploymentServerTypeFieldSpecified = true;
}
else
{
Console.WriteLine("! Warning Invalid DeploymentServerType Specified :" + DepServertype );
Console.WriteLine("! The DeploymentServerType Setting Is Ignored " );

}

}
return _DeploymentServerTypeAttr;
}
set {_DeploymentServerTypeAttr = value; }
}

private bool _DeploymentServerTypeFieldSpecified = false;

public bool DeploymentServerTypeFieldSpecified
{
get { return _DeploymentServerTypeFieldSpecified; }
set { _DeploymentServerTypeFieldSpecified = value; }
}


Coordinator
Jul 30, 2007 at 11:21 PM
Thank you for your update on DeploymentServerType, it will be added to the next release of WSPBuilder.