Import from internal git
This commit is contained in:
48
Generator/Repo/PublisherRepo.cs
Normal file
48
Generator/Repo/PublisherRepo.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
using Core;
|
||||
using Core.Events;
|
||||
using Core.SpecConfig;
|
||||
using Generator.Daos;
|
||||
using Generator.Infrastructure.Publication;
|
||||
using YamlDotNet.Core;
|
||||
|
||||
namespace Generator.Repo;
|
||||
|
||||
public class PublisherRepo
|
||||
{
|
||||
private readonly Publisher _publisher;
|
||||
private readonly DotnetDao _dotnetDao;
|
||||
private readonly JavaDao _javaDao;
|
||||
private readonly JavascriptDao _javascriptDao;
|
||||
|
||||
public PublisherRepo(
|
||||
EnvironmentDao envDao,
|
||||
DotnetDao dotnetDao,
|
||||
JavaDao javaDao,
|
||||
JavascriptDao jsDao,
|
||||
DisplayEmitter emitter)
|
||||
{
|
||||
_publisher = new Publisher(envDao.Invite, emitter);
|
||||
_dotnetDao = dotnetDao;
|
||||
_javaDao = javaDao;
|
||||
_javascriptDao = jsDao;
|
||||
}
|
||||
|
||||
public async Task PublishDotnet(GenerationType type, ISpecFile file)
|
||||
{
|
||||
var config = _dotnetDao.GetDotnetPublish(type, file);
|
||||
await _publisher.PublishNugget(config);
|
||||
}
|
||||
|
||||
public async Task PublishJava(GenerationType type, ISpecFile file)
|
||||
{
|
||||
var config = _javaDao.GetJavaPublish(type, file);
|
||||
await _publisher.PublishMaven(config);
|
||||
}
|
||||
|
||||
public async Task PublishJavascript(GenerationType type, ISpecFile file)
|
||||
{
|
||||
var config = _javascriptDao.GetJavascriptPublish(type, file);
|
||||
await _publisher.PublishNpm(config);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user