RegisterAssemblyLocation() public method

public RegisterAssemblyLocation ( string assemblyName, string filePath ) : void
assemblyName string
filePath string
return void
 private void readAssemblyPaths(PackageManifest manifest, PackageInfo package, string binPath)
 {
     var assemblyPaths = findCandidateAssemblyFiles(binPath);
     assemblyPaths.Each(path =>
     {
         var assemblyName = Path.GetFileNameWithoutExtension(path);
         if (manifest.Assemblies.Contains(assemblyName))
         {
             package.RegisterAssemblyLocation(assemblyName, path);
         }
     });
 }
        private void readAssemblyPaths(PackageManifest manifest, PackageInfo package, string binPath)
        {
            var assemblyPaths = findCandidateAssemblyFiles(binPath);

            assemblyPaths.Each(path =>
            {
                var assemblyName = Path.GetFileNameWithoutExtension(path);
                if (manifest.Assemblies.Contains(assemblyName))
                {
                    package.RegisterAssemblyLocation(assemblyName, path);
                }
            });
        }
Beispiel #3
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(BottleFiles.WebContentFolder, _getContentFolderFromPackageFolder(folder));
            package.RegisterFolder(BottleFiles.DataFolder, FileSystem.Combine(folder, BottleFiles.DataFolder));
            package.RegisterFolder(BottleFiles.ConfigFolder, FileSystem.Combine(folder, BottleFiles.ConfigFolder));

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

            if (_fileSystem.DirectoryExists(debugPath))
            {
                binPath = debugPath;
            }

            //REVIEW: I feel this whole section is left-hand / right-hand code
            package.Role = manifest.Role;

            var assemblyPaths = findCandidateAssemblyFiles(binPath);

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

            return(package);
        }
Beispiel #4
0
        public IPackageInfo LoadFromFolder(string packageDirectory)
        {
            packageDirectory = packageDirectory.ToFullPath();

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

            // Right here, this needs to be different
            package.RegisterFolder(BottleFiles.WebContentFolder, _getContentFolderFromPackageFolder(packageDirectory));
            package.RegisterFolder(BottleFiles.DataFolder, FileSystem.Combine(packageDirectory, BottleFiles.DataFolder));
            package.RegisterFolder(BottleFiles.ConfigFolder, FileSystem.Combine(packageDirectory, BottleFiles.ConfigFolder));

            var binPath = FileSystem.Combine(packageDirectory, "bin");
            var debugPath = FileSystem.Combine(binPath, "debug");
            if (_fileSystem.DirectoryExists(debugPath))
            {
                binPath = debugPath;
            }

            //REVIEW: I feel this whole section is left-hand / right-hand code
            package.Role = manifest.Role;

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

            return package;
        }