예제 #1
0
        public SelfCompilingExecutable(string executable, string cacheRoot = null)
        {
            if (cacheRoot == null)
            {
                cacheRoot = Path.Combine(Path.GetTempPath(), "sce");
            }

            this.executable = Path.GetFullPath(executable);
            this.cacheDir   = Path.Combine(cacheRoot, Util.GetDigest(this.executable));
            this.sourceDir  = this.executable + ".src";
            repository      = new Nuget.Repository(Path.Combine(cacheRoot, "packages"));
            FS.EnsureDirectoryExists(this.cacheDir);
        }
예제 #2
0
파일: Nuget.cs 프로젝트: sidiandi/sce
            public async Task <InstalledPackage> Install(ISource source, PackageSpec package)
            {
                var pdir = GetPackageDir(package);

                if (Directory.Exists(pdir))
                {
                    throw new Exception("Package already installed.");
                }

                FS.EnsureDirectoryExists(pdir);

                var nupkgDest = GetNupkgPath(package);

                FS.EnsureParentDirectoryExists(nupkgDest);
                await source.Download(package, nupkgDest);

                ZipFile.ExtractToDirectory(nupkgDest, pdir);
                return(new InstalledPackage(this, package));
            }
예제 #3
0
        async Task <int> RunImpl()
        {
            // locate compiled assembly
            FS.EnsureDirectoryExists(cacheDir);
            log(cacheDir);

            var sourceDir = GetSourceDir();

            EnsureSourceDirectoryExists(sourceDir);

            // still up-to-date ?
            if (IsBuildRequired(sourceDir, OutputFile))
            {
                await Build(sourceDir, OutputFile, repository);
            }

            // run
            var a = Assembly.LoadFrom(OutputFile);

            return(Run(a));
        }