public void set_role_to_data() { var manifest = new PackageManifest(); manifest.SetRole(BottleRoles.Data); manifest.ContentFileSet.ShouldBeNull(); }
public void Execute(InitInput input, IFileSystem fileSystem) { var assemblyName = fileSystem.GetFileName(input.Path); var manifest = new PackageManifest { Name = input.Name }; manifest.AddAssembly(assemblyName); manifest.SetRole(input.RoleFlag ?? BottleRoles.Module); if (input.NoWebContentFlag) { manifest.ContentFileSet = new FileSet { DeepSearch = false, Include = "*.config" }; } if (input.ForceFlag || !fileSystem.FileExists(FileSystem.Combine(input.Path, PackageManifest.FILE))) { fileSystem.PersistToFile(manifest, input.Path, PackageManifest.FILE); } if (input.OpenFlag) { fileSystem.LaunchEditor(input.Path, PackageManifest.FILE); } }
public void set_role_to_binaries() { var manifest = new PackageManifest(); manifest.SetRole(BottleRoles.Binaries); manifest.ContentFileSet.ShouldBeNull(); }
public void set_role_to_module() { var manifest = new PackageManifest(); manifest.SetRole(BottleRoles.Module); manifest.Role.ShouldEqual(BottleRoles.Module); manifest.ContentFileSet.ShouldNotBeNull(); manifest.ContentFileSet.Include.ShouldContain("*.as*x"); }
public void read_config_manifest_from_file() { var manifest = new PackageManifest(); manifest.SetRole(BottleRoles.Config); var system = new FileSystem(); system.WriteObjectToFile("manifest.xml", manifest); var manifest2 = system.LoadFromFile<PackageManifest>("manifest.xml"); manifest2.ContentFileSet.ShouldBeNull(); }
public void set_role_to_data() { var manifest = new PackageManifest(); manifest.SetRole(BottleRoles.Data); manifest.ContentFileSet.ShouldBeNull(); manifest.ConfigFileSet.ShouldBeNull(); manifest.DataFileSet.DeepSearch.ShouldBeTrue(); manifest.DataFileSet.Include.ShouldEqual("*.*"); }
public void set_role_to_config() { var manifest = new PackageManifest(); manifest.SetRole(BottleRoles.Config); manifest.Role.ShouldEqual(BottleRoles.Config); manifest.ContentFileSet.ShouldBeNull(); manifest.Assemblies.Any().ShouldBeFalse(); }
public void set_role_to_module() { var manifest = new PackageManifest(); manifest.SetRole(BottleRoles.Module); manifest.Role.ShouldEqual(BottleRoles.Module); manifest.ContentFileSet.ShouldNotBeNull(); manifest.ContentFileSet.Include.ShouldContain("*.*"); }
public void read_config_manifest_from_file() { var manifest = new PackageManifest(); manifest.SetRole(BottleRoles.Config); var system = new FileSystem(); system.WriteObjectToFile("manifest.xml", manifest); var manifest2 = system.LoadFromFile <PackageManifest>("manifest.xml"); manifest2.ContentFileSet.ShouldBeNull(); }
protected override void beforeEach() { theBaseFolder = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "folder1"); theManifest = new PackageManifest(); theManifest.SetRole(BottleRoles.Data); theInput = new CreateBottleInput { PackageFolder = theBaseFolder }; theZipFile = new StubZipFile(); ClassUnderTest.AddDataFiles(theInput, theZipFile, theManifest); theRequest = theZipFile.ZipRequests.Single(); }
public override bool Execute(AssemblyPackageInput input) { input.RootFolder = new AliasService().GetFolderForAlias(input.RootFolder); determineMissingCsProjFile(input); if (input.PreviewFlag) { return(displayPreview(input)); } if (input.InitFlag) { createNewManifest(input); return(true); } var zipService = new ZipFileService(fileSystem); var manifest = fileSystem.LoadPackageManifestFrom(input.RootFolder); if (manifest == null) { System.Console.WriteLine("No PackageManifest found, using defaults instead"); manifest = new PackageManifest(); manifest.SetRole(BottleRoles.Module); System.Console.WriteLine("WebContent: " + manifest.ContentFileSet); } createZipFile(input, BottleFiles.WebContentFolder, zipService, manifest.ContentFileSet); createZipFile(input, BottleFiles.DataFolder, zipService, BottleFiles.DataFiles); createZipFile(input, BottleFiles.ConfigFolder, zipService, BottleFiles.ConfigFiles); return(true); }