48 lines
1.3 KiB
C#
48 lines
1.3 KiB
C#
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);
|
|
}
|
|
|
|
} |