Пример #1
0
        internal ScriptContext(string scriptFilePath, string projectFilePath, ProjectRoot projectRoot)
        {
            if (string.IsNullOrEmpty(scriptFilePath))
            {
                throw new ArgumentException("Value cannot be null or empty", nameof(scriptFilePath));
            }
            if (!Path.IsPathRooted(scriptFilePath))
            {
                throw new ArgumentException("The script file path must be absolute");
            }

            ScriptFilePath  = scriptFilePath;
            ProjectFilePath = projectFilePath;
            Project         = projectRoot;
            Output          = new OutputFileCollection(scriptFilePath);
        }
Пример #2
0
        internal ScriptGlobals(string scriptFilePath, string projectFilePath, Func <Project> loadProject)
        {
            if (string.IsNullOrEmpty(scriptFilePath))
            {
                throw new ArgumentException("Value cannot be null or empty", nameof(scriptFilePath));
            }
            if (!Path.IsPathRooted(scriptFilePath))
            {
                throw new ArgumentException("The script file path must be absolute");
            }
            if (loadProject == null)
            {
                throw new ArgumentNullException(nameof(loadProject));
            }

            Output          = new OutputFileCollection(scriptFilePath);
            ScriptFilePath  = scriptFilePath;
            ProjectFilePath = projectFilePath;
            _loadProject    = loadProject;
        }