private BSharpFileBasedClassProvider GetOldStyleClsProvider(string rev) { var clsProvider = new BSharpFileBasedClassProvider(); if (rev == "HEAD") { rev = _context.GitBranch; } if (!string.IsNullOrWhiteSpace(rev)) { _context.Log.Trace("reset GIT pre " + rev); _githelper.Reset(true); _githelper.Clean(true); _context.Log.Trace("begin checkout " + rev); _githelper.Checkout(rev); _context.ResolvedUpdateRevision = _githelper.GetCommitId(); _context.Log.Trace("end checkout " + rev); var bscStarter = new ConsoleApplicationHandler(); bscStarter.ExePath = "bsc"; bscStarter.WorkingDirectory = Path.Combine(_context.RootDirectory, _context.ProjectDirectory); if (!string.IsNullOrWhiteSpace(_context.ProjectName)) { bscStarter.Arguments = _context.ProjectName; } _context.Log.Trace("start bsc"); var bscResult = bscStarter.RunSync(); _context.Log.Trace("finish bsc"); if (bscResult.IsOK) { _context.Log.Trace("ok bsc"); clsProvider = new BSharpFileBasedClassProvider { RootDirectory = Path.Combine(_context.RootDirectory, _context.OutputDirectory) }; } else { _context.Log.Error("error in bsc " + bscResult.Error, bscResult.Exception); throw new Exception("bsharp compile exception " + bscResult.Error, bscResult.Exception); } } return(clsProvider); }
private BSharpFileBasedClassProvider GetOldStyleClsProvider(string rev) { var clsProvider = new BSharpFileBasedClassProvider(); if (rev == "HEAD") { rev = _context.GitBranch; } if (!string.IsNullOrWhiteSpace(rev)) { _context.Log.Trace("reset GIT pre " + rev); _githelper.Reset(true); _githelper.Clean(true); _context.Log.Trace("begin checkout " + rev); _githelper.Checkout(rev); _context.ResolvedUpdateRevision = _githelper.GetCommitId(); _context.Log.Trace("end checkout " + rev); var bscStarter = new ConsoleApplicationHandler(); bscStarter.ExePath = "bsc"; bscStarter.WorkingDirectory = Path.Combine(_context.RootDirectory, _context.ProjectDirectory); if (!string.IsNullOrWhiteSpace(_context.ProjectName)) { bscStarter.Arguments = _context.ProjectName; } _context.Log.Trace("start bsc"); var bscResult = bscStarter.RunSync(); _context.Log.Trace("finish bsc"); if (bscResult.IsOK) { _context.Log.Trace("ok bsc"); clsProvider = new BSharpFileBasedClassProvider { RootDirectory = Path.Combine(_context.RootDirectory, _context.OutputDirectory) }; } else { _context.Log.Error("error in bsc " + bscResult.Error, bscResult.Exception); throw new Exception("bsharp compile exception " + bscResult.Error, bscResult.Exception); } } return clsProvider; }