예제 #1
0
        public void set_role_to_data()
        {
            var manifest = new PackageManifest();
            manifest.SetRole(BottleRoles.Data);

            manifest.ContentFileSet.ShouldBeNull();
        }
예제 #2
0
        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);
            }
        }
예제 #3
0
        public void set_role_to_binaries()
        {
            var manifest = new PackageManifest();
            manifest.SetRole(BottleRoles.Binaries);

            manifest.ContentFileSet.ShouldBeNull();
        }
예제 #4
0
        public void set_role_to_data()
        {
            var manifest = new PackageManifest();

            manifest.SetRole(BottleRoles.Data);

            manifest.ContentFileSet.ShouldBeNull();
        }
예제 #5
0
        public void set_role_to_binaries()
        {
            var manifest = new PackageManifest();

            manifest.SetRole(BottleRoles.Binaries);

            manifest.ContentFileSet.ShouldBeNull();
        }
예제 #6
0
        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");
        }
예제 #7
0
        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();
        }
예제 #8
0
        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("*.*");
        }
예제 #9
0
        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();
        }
예제 #10
0
        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();
        }
예제 #11
0
        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("*.*");
        }
예제 #12
0
        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();
        }
예제 #13
0
        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();
        }
예제 #14
0
        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);
        }