void Operation.Execute( Installation genericInstallation, OperationResult operationResult ) { var installation = genericInstallation as RecognizedDevelopmentInstallation; var localNuGetFeedFolderPath = EwlStatics.CombinePaths( ConfigurationStatics.RedStaplerFolderPath, "Local NuGet Feed" ); // NuGet.exe has problems if the folder doesn't exist. Directory.CreateDirectory( localNuGetFeedFolderPath ); ExportLogic.CreateEwlNuGetPackage( installation, true, localNuGetFeedFolderPath, null ); }
void Operation.Execute( Installation genericInstallation, OperationResult operationResult ) { if( !ConfigurationLogic.NDependIsPresent ) throw new UserCorrectableException( "NDepend is not present." ); var installation = genericInstallation as DevelopmentInstallation; var locCount = GetNDependLocCount( installation, true ); Console.WriteLine(); Console.WriteLine( "LOGIC SIZE (in size points)" ); Console.WriteLine( locCount ); Console.WriteLine(); }
void Operation.Execute( Installation genericInstallation, OperationResult operationResult ) { IsuStatics.ConfigureIis( true ); Console.WriteLine( "Configured IIS Express." ); // This block exists because of https://enduracode.kilnhg.com/Review/K164316. try { IsuStatics.ConfigureIis( false ); Console.WriteLine( "Configured full IIS." ); } catch { Console.WriteLine( "Did not configure full IIS." ); } var installation = genericInstallation as DevelopmentInstallation; DatabaseOps.UpdateDatabaseLogicIfUpdateFileExists( installation.DevelopmentInstallationLogic.Database, installation.ExistingInstallationLogic.DatabaseUpdateFilePath, true ); try { copyInEwlFiles( installation ); } catch( Exception e ) { var message = "Failed to copy {0} files into the installation. Please try the operation again.".FormatWith( EwlStatics.EwlName ); if( e is UnauthorizedAccessException || e is IOException ) throw new UserCorrectableException( message, e ); throw new ApplicationException( message, e ); } // Generate code. if( installation.DevelopmentInstallationLogic.SystemIsEwl ) { generateCodeForProject( installation, AppStatics.CoreProjectName, writer => { writer.WriteLine( "using System;" ); writer.WriteLine( "using System.Globalization;" ); writer.WriteLine( "using System.Reflection;" ); writer.WriteLine( "using System.Runtime.InteropServices;" ); writer.WriteLine(); writeAssemblyInfo( writer, installation, "" ); writer.WriteLine(); writer.WriteLine( "namespace EnterpriseWebLibrary {" ); writer.WriteLine( "partial class EwlStatics {" ); CodeGenerationStatics.AddSummaryDocComment( writer, "The date/time at which this version of EWL was built." ); writer.WriteLine( "public static readonly DateTimeOffset EwlBuildDateTime = {0};".FormatWith( AppStatics.GetLiteralDateTimeExpression( DateTimeOffset.UtcNow ) ) ); writer.WriteLine( "}" ); writer.WriteLine( "}" ); } ); generateCodeForProject( installation, "Development Utility", writer => { writer.WriteLine( "using System.Reflection;" ); writer.WriteLine( "using System.Runtime.InteropServices;" ); writeAssemblyInfo( writer, installation, "Development Utility" ); } ); } generateLibraryCode( installation ); foreach( var webProject in installation.DevelopmentInstallationLogic.DevelopmentConfiguration.webProjects ?? new WebProject[ 0 ] ) generateWebConfigAndCodeForWebProject( installation, webProject ); foreach( var service in installation.ExistingInstallationLogic.RuntimeConfiguration.WindowsServices ) generateWindowsServiceCode( installation, service ); foreach( var project in installation.DevelopmentInstallationLogic.DevelopmentConfiguration.ServerSideConsoleProjectsNonNullable ) generateServerSideConsoleProjectCode( installation, project ); if( installation.DevelopmentInstallationLogic.DevelopmentConfiguration.clientSideAppProject != null ) { generateCodeForProject( installation, installation.DevelopmentInstallationLogic.DevelopmentConfiguration.clientSideAppProject.name, writer => { writer.WriteLine( "using System.Reflection;" ); writer.WriteLine( "using System.Runtime.InteropServices;" ); writeAssemblyInfo( writer, installation, installation.DevelopmentInstallationLogic.DevelopmentConfiguration.clientSideAppProject.name ); } ); } generateXmlSchemaLogicForCustomInstallationConfigurationXsd( installation ); generateXmlSchemaLogicForOtherXsdFiles( installation ); if( !installation.DevelopmentInstallationLogic.SystemIsEwl && Directory.Exists( EwlStatics.CombinePaths( installation.GeneralLogic.Path, ".hg" ) ) ) updateMercurialIgnoreFile( installation ); }
void Operation.Execute( Installation genericInstallation, OperationResult operationResult ) { var installation = genericInstallation as DevelopmentInstallation; var logicPackagesFolderPath = EwlStatics.CombinePaths( installation.GeneralLogic.Path, "Logic Packages" ); IoMethods.DeleteFolder( logicPackagesFolderPath ); // Set up the main (build) object in the build message. var build = new InstallationSupportUtility.RsisInterface.Messages.BuildMessage.Build(); build.SystemName = installation.ExistingInstallationLogic.RuntimeConfiguration.SystemName; build.SystemShortName = installation.ExistingInstallationLogic.RuntimeConfiguration.SystemShortName; build.MajorVersion = installation.CurrentMajorVersion; build.BuildNumber = installation.NextBuildNumber; build.LogicSize = ConfigurationLogic.NDependIsPresent && !installation.DevelopmentInstallationLogic.SystemIsEwl ? GetLogicSize.GetNDependLocCount( installation, false ) as int? : null; var serverSideLogicFolderPath = EwlStatics.CombinePaths( logicPackagesFolderPath, "Server Side Logic" ); packageWebApps( installation, serverSideLogicFolderPath ); packageWindowsServices( installation, serverSideLogicFolderPath ); packageServerSideConsoleApps( installation, serverSideLogicFolderPath ); packageGeneralFiles( installation, serverSideLogicFolderPath, true ); build.ServerSideLogicPackage = ZipOps.ZipFolderAsByteArray( serverSideLogicFolderPath ); operationResult.NumberOfBytesTransferred = build.ServerSideLogicPackage.LongLength; // Set up the client side application object in the build message, if necessary. if( installation.DevelopmentInstallationLogic.DevelopmentConfiguration.clientSideAppProject != null ) { build.ClientSideApp = new InstallationSupportUtility.RsisInterface.Messages.BuildMessage.Build.ClientSideAppType(); build.ClientSideApp.Name = installation.DevelopmentInstallationLogic.DevelopmentConfiguration.clientSideAppProject.name; build.ClientSideApp.AssemblyName = installation.DevelopmentInstallationLogic.DevelopmentConfiguration.clientSideAppProject.assemblyName; var clientSideAppFolder = EwlStatics.CombinePaths( logicPackagesFolderPath, "Client Side Application" ); packageClientSideApp( installation, clientSideAppFolder ); packageGeneralFiles( installation, clientSideAppFolder, false ); build.ClientSideApp.Package = ZipOps.ZipFolderAsByteArray( clientSideAppFolder ); operationResult.NumberOfBytesTransferred += build.ClientSideApp.Package.LongLength; } // Set up the list of installation objects in the build message. build.Installations = new InstallationSupportUtility.RsisInterface.Messages.BuildMessage.Build.InstallationsType(); foreach( var installationConfigurationFolderPath in Directory.GetDirectories( EwlStatics.CombinePaths( installation.ExistingInstallationLogic.RuntimeConfiguration.ConfigurationFolderPath, InstallationConfiguration.InstallationConfigurationFolderName, InstallationConfiguration.InstallationsFolderName ) ) ) { if( Path.GetFileName( installationConfigurationFolderPath ) != InstallationConfiguration.DevelopmentInstallationFolderName ) { var buildMessageInstallation = new InstallationSupportUtility.RsisInterface.Messages.BuildMessage.Installation(); // Do not perform schema validation since the schema file on disk may not match this version of the ISU. var installationConfigurationFile = XmlOps.DeserializeFromFile<InstallationStandardConfiguration>( EwlStatics.CombinePaths( installationConfigurationFolderPath, InstallationConfiguration.InstallationStandardConfigurationFileName ), false ); buildMessageInstallation.Id = installationConfigurationFile.rsisInstallationId; buildMessageInstallation.Name = installationConfigurationFile.installedInstallation.name; buildMessageInstallation.ShortName = installationConfigurationFile.installedInstallation.shortName; buildMessageInstallation.IsLiveInstallation = installationConfigurationFile.installedInstallation.InstallationTypeConfiguration != null ? installationConfigurationFile.installedInstallation.InstallationTypeConfiguration is LiveInstallationConfiguration : installationConfigurationFile.installedInstallation.IsLiveInstallation; buildMessageInstallation.ConfigurationPackage = ZipOps.ZipFolderAsByteArray( installationConfigurationFolderPath ); build.Installations.Add( buildMessageInstallation ); operationResult.NumberOfBytesTransferred += buildMessageInstallation.ConfigurationPackage.LongLength; } } if( installation.DevelopmentInstallationLogic.SystemIsEwl ) build.NuGetPackages = packageEwl( installation, logicPackagesFolderPath ); var recognizedInstallation = installation as RecognizedDevelopmentInstallation; if( recognizedInstallation == null ) return; build.SystemId = recognizedInstallation.KnownSystemLogic.RsisSystem.Id; operationResult.TimeSpentWaitingForNetwork = EwlStatics.ExecuteTimedRegion( delegate { using( var memoryStream = new MemoryStream() ) { // Understand that by doing this, we are not really taking advantage of streaming, but at least it will be easier to do it the right way some day (probably by implementing our own BuildMessageStream) XmlOps.SerializeIntoStream( build, memoryStream ); memoryStream.Position = 0; ConfigurationLogic.ExecuteIsuServiceMethod( channel => channel.UploadBuild( new BuildUploadMessage { AuthenticationKey = ConfigurationLogic.AuthenticationKey, BuildDocument = memoryStream } ), "build upload" ); } } ); }
void Operation.Execute( Installation genericInstallation, OperationResult operationResult ) { var installation = genericInstallation as RecognizedDevelopmentInstallation; installation.ExistingInstallationLogic.InstallServices(); installation.ExistingInstallationLogic.Start(); }