Пример #1
0
        public IEnumerable <RuntimeDependency> GetDependencies(string targetDirectory, ScriptMode scriptMode, string[] packagesSources, string code = null)
        {
            var pathToProjectFile = scriptMode == ScriptMode.Script
                ? _scriptProjectProvider.CreateProject(targetDirectory, _scriptEnvironment.TargetFramework, true)
                : _scriptProjectProvider.CreateProjectForRepl(code, Path.Combine(targetDirectory, scriptMode.ToString()), ScriptEnvironment.Default.TargetFramework);

            return(GetDependenciesInternal(pathToProjectFile, packagesSources));
        }
        public IEnumerable <RuntimeDependency> GetDependencies(string targetDirectory, ScriptMode scriptMode, string code = null)
        {
            var pathToProjectFile = scriptMode == ScriptMode.Script
                ? _scriptProjectProvider.CreateProject(targetDirectory, RuntimeHelper.TargetFramework, true)
                : _scriptProjectProvider.CreateProjectForRepl(code, Path.Combine(targetDirectory, scriptMode.ToString()), RuntimeHelper.TargetFramework);

            return(GetDependenciesInternal(pathToProjectFile));
        }
        public IEnumerable <RuntimeDependency> GetDependenciesForCode(string targetDirectory, ScriptMode scriptMode, string[] packageSources, string code = null)
        {
            var projectFileInfo = _scriptProjectProvider.CreateProjectForRepl(code, Path.Combine(targetDirectory, scriptMode.ToString()), ScriptEnvironment.Default.TargetFramework);

            _restorer.Restore(projectFileInfo, packageSources);
            var pathToAssetsFile = Path.Combine(Path.GetDirectoryName(projectFileInfo.Path), "obj", "project.assets.json");

            return(GetDependenciesInternal(pathToAssetsFile));
        }
        public IEnumerable <RuntimeDependency> GetDependenciesFromCode(string targetDirectory, string code)
        {
            var pathToProjectFile = _scriptProjectProvider.CreateProjectForRepl(code, targetDirectory, "netcoreapp2.0");

            return(GetDependenciesInternal(pathToProjectFile));
        }