コード例 #1
0
        public IPackageInfo LoadFromFolder(string folder)
        {
            folder = Path.GetFullPath(folder);

            var manifest = _fileSystem.LoadFromFile<PackageManifest>(folder, PackageManifest.FILE);
            var package = new PackageInfo(manifest.Name){
                Description = "{0} ({1})".ToFormat(manifest.Name, folder)
            };

            // Right here, this needs to be different
            package.RegisterFolder(FubuMvcPackages.WebContentFolder, _getContentFolderFromPackageFolder(folder));
            package.RegisterFolder(PackageInfo.DataFolder, Path.Combine(folder, PackageInfo.DataFolder));

            var binPath = FileSystem.Combine(_applicationFolder, folder, "bin");
            var debugPath = FileSystem.Combine(binPath, "debug");
            if(new FileSystem().DirectoryExists(debugPath))
            {
                binPath = debugPath;
            }

            var assemblyPaths = findCandidateAssemblyFiles(binPath);
            assemblyPaths.Each(path =>
            {
                var assemblyName = Path.GetFileNameWithoutExtension(path);
                if (manifest.AssemblyNames.Contains(assemblyName))
                {
                    package.RegisterAssemblyLocation(assemblyName, path);
                }
            });

            return package;
        }
コード例 #2
0
        public IPackageInfo LoadFromFolder(string folder)
        {
            var manifest = _fileSystem.LoadFromFile<PackageManifest>(folder, PackageManifest.FILE);
            var package = new PackageInfo(manifest.Name);
            package.RegisterFolder(FubuMvcPackages.WebContentFolder, folder);

            var binPath = FileSystem.Combine(_applicationFolder, folder, "bin");

            var assemblyPaths = findCandidateAssemblyFiles(binPath);
            assemblyPaths.Each(path =>
            {
                var assemblyName = Path.GetFileNameWithoutExtension(path);
                if (manifest.AssemblyNames.Contains(assemblyName))
                {
                    package.RegisterAssemblyLocation(assemblyName, path);
                }
            });

            return package;
        }
コード例 #3
0
        public void SetUp()
        {
            theDataFolder = "data";

            if (Directory.Exists(theDataFolder))
            {
                Directory.Delete(theDataFolder, true);
            }

            thePackage = new PackageInfo("something");
            thePackage.RegisterFolder(FubuMvcPackages.DataFolder, Path.GetFullPath(theDataFolder));
        }
コード例 #4
0
ファイル: PackageInfo.cs プロジェクト: petejohanson/fubumvc
 public bool Equals(PackageInfo other)
 {
     if (ReferenceEquals(null, other)) return false;
     if (ReferenceEquals(this, other)) return true;
     return Equals(other.Name, Name) && Equals(other.Description, Description);
 }