cli
parent
f36f1861bc
commit
734c9c75d2
@ -1,57 +0,0 @@
|
||||
using System;
|
||||
using System.Runtime.Versioning;
|
||||
using Microsoft.Extensions.PlatformAbstractions;
|
||||
|
||||
namespace cli_2
|
||||
{
|
||||
public class ApplicationEnvironment : IApplicationEnvironment
|
||||
{
|
||||
internal ApplicationEnvironment( FrameworkName targetFramework, string appRootDir )
|
||||
{
|
||||
this.RuntimeFramework = targetFramework;
|
||||
ApplicationBasePath = appRootDir;
|
||||
}
|
||||
public string ApplicationBasePath
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
public string ApplicationName
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
public string ApplicationVersion
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
public string Configuration
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
public FrameworkName RuntimeFramework
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
public string Version
|
||||
{
|
||||
get
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
public object GetData(string name)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void SetData(string name, object value)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
namespace cli.Modules
|
||||
{
|
||||
public interface IModule
|
||||
{
|
||||
void Run (string[] args);
|
||||
}
|
||||
}
|
@ -1,29 +0,0 @@
|
||||
using System;
|
||||
using RazorEngine.Templating;
|
||||
using Yavsc.Models;
|
||||
using Yavsc.Services;
|
||||
|
||||
namespace cli.Modules
|
||||
{
|
||||
public class MonthlyEMailGenerator : IModule
|
||||
{
|
||||
IRazorEngineService engine;
|
||||
IEmailSender emailSender;
|
||||
|
||||
ApplicationDbContext dbContext;
|
||||
public MonthlyEMailGenerator(ApplicationDbContext context, IRazorEngineService res, IEmailSender sender)
|
||||
{
|
||||
dbContext = context;
|
||||
engine = res;
|
||||
emailSender = sender;
|
||||
// engine.AddTemplate(new Tem)
|
||||
}
|
||||
public void Run(string[] args)
|
||||
{
|
||||
Console.WriteLine($"Hello from second module using {engine}");
|
||||
string template = "Hello @Model.Name, welcome to RazorEngine!";
|
||||
var result = engine.RunCompile(template, "templateKey", null, new { Name = "World" });
|
||||
Console.WriteLine(result);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,25 +0,0 @@
|
||||
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using RazorEngine.Configuration;
|
||||
using RazorEngine.Templating;
|
||||
|
||||
namespace cli.Modules
|
||||
{
|
||||
public class MyGenerator : IModule
|
||||
{
|
||||
|
||||
ILogger logger;
|
||||
public MyGenerator(ILoggerFactory loggerfactory)
|
||||
{
|
||||
logger = loggerfactory.CreateLogger<MyGenerator>();
|
||||
}
|
||||
|
||||
public void Run(string[] args)
|
||||
{
|
||||
logger.LogInformation(nameof(MyGenerator));
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,63 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="MonthlySubjectTemplate"><value>[{0} Monthly] {1}</value></data>
|
||||
|
||||
</root>
|
@ -0,0 +1,95 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{9580B70F-0C6F-4C5A-868D-97517BD51D55}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<RootNamespace>cli</RootNamespace>
|
||||
<AssemblyName>cli</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG;</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ExternalConsole>true</ExternalConsole>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ExternalConsole>true</ExternalConsole>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Services\EMailer.cs" />
|
||||
<Compile Include="YaRazorEngineHost.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
<None Include="appsettings.Development.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="appsettings.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="App.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="mscorlib" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="Microsoft.Web.Infrastructure">
|
||||
<HintPath>packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||
<Reference Include="System.Security" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="Mono.Security">
|
||||
<HintPath>packages\Npgsql.2.2.0-rc1\lib\net45\Mono.Security.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Transactions" />
|
||||
<Reference Include="EntityFramework7.Npgsql">
|
||||
<HintPath>..\packages\EntityFramework7.Npgsql.3.1.0-rc1-3\lib\net451\EntityFramework7.Npgsql.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="EntityFramework.Core">
|
||||
<HintPath>..\packages\EntityFramework.Core.7.0.0-rc1-final\lib\net451\EntityFramework.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Yavsc.Server">
|
||||
<HintPath>..\packages\Yavsc.Server.1.0.5-rc9\lib\portable-net45+win8+wp8+wpa81+Xamarin.Mac+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Yavsc.Server.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Yavsc.Abstract">
|
||||
<HintPath>..\packages\Yavsc.Abstract.1.0.5-rc9\lib\portable-net45+win8+wp8+wpa81+Xamarin.Mac+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Yavsc.Abstract.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Interactive.Async">
|
||||
<HintPath>..\packages\Ix-Async.1.2.5\lib\net45\System.Interactive.Async.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="CommandLine">
|
||||
<HintPath>..\packages\Machine.Specifications.Runner.Console.0.9.0\tools\CommandLine.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Machine.Specifications.Reporting">
|
||||
<HintPath>..\packages\Machine.Specifications.Runner.Console.0.9.0\tools\Machine.Specifications.Reporting.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Machine.Specifications.Reporting.Templates">
|
||||
<HintPath>..\packages\Machine.Specifications.Runner.Console.0.9.0\tools\Machine.Specifications.Reporting.Templates.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Machine.Specifications.Runner.Utility">
|
||||
<HintPath>..\packages\Machine.Specifications.Runner.Console.0.9.0\tools\Machine.Specifications.Runner.Utility.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Services\" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
@ -0,0 +1,60 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
|
||||
<package id="Microsoft.AspNet.Server.Kestrel" version="1.0.0-rc1-final" targetFramework="net451" />
|
||||
<package id="EntityFramework.Relational.Design" version="7.0.0-rc1-final" targetFramework="net451" />
|
||||
<package id="Microsoft.AspNet.Hosting.Abstractions" version="1.0.0-rc1-final" targetFramework="net451" />
|
||||
|
||||
<package id="EntityFramework.Core" version="7.0.0-rc1-final" targetFramework="net451" />
|
||||
<package id="EntityFramework.Relational" version="7.0.0-rc1-final" targetFramework="net451" />
|
||||
<package id="Microsoft.AspNet.Identity.EntityFramework" version="3.0.0-rc1-final" targetFramework="net451" />
|
||||
<package id="Microsoft.AspNet.Mvc.Razor" version="6.0.0-rc1-final" targetFramework="net451" />
|
||||
<package id="Microsoft.CodeAnalysis.Analyzers" version="1.0.0" targetFramework="net451" />
|
||||
<package id="Microsoft.CodeAnalysis.Common" version="1.1.0-rc1" targetFramework="net451" />
|
||||
<package id="Microsoft.CodeAnalysis.CSharp" version="1.1.0-rc1" targetFramework="net451" />
|
||||
<package id="Microsoft.Dnx.Compilation.Abstractions" version="1.0.0-rc1-final" targetFramework="net451" />
|
||||
<package id="Microsoft.Dnx.Compilation.CSharp.Abstractions" version="1.0.0-rc1-final" targetFramework="net451" />
|
||||
<package id="Microsoft.Dnx.Compilation.CSharp.Common" version="1.0.0-rc1-final" targetFramework="net451" />
|
||||
<package id="Microsoft.Extensions.Caching.Abstractions" version="1.0.0-rc1-final" targetFramework="net451" />
|
||||
<package id="Microsoft.Extensions.Caching.Memory" version="1.0.0-rc1-final" targetFramework="net451" />
|
||||
<package id="Microsoft.Extensions.Configuration" version="1.0.0-rc1-final" targetFramework="net451" />
|
||||
<package id="Microsoft.Extensions.Configuration.Abstractions" version="1.0.0-rc1-final" targetFramework="net451" />
|
||||
<package id="Microsoft.Extensions.Configuration.FileExtensions" version="1.0.0-rc1-final" targetFramework="net451" />
|
||||
<package id="Microsoft.Extensions.Configuration.Json" version="1.0.0-rc1-final" targetFramework="net451" />
|
||||
<package id="Microsoft.Extensions.DependencyInjection" version="1.0.0-rc1-final" targetFramework="net451" />
|
||||
<package id="Microsoft.Extensions.DependencyInjection.Abstractions" version="1.0.0-rc1-final" targetFramework="net451" />
|
||||
<package id="Microsoft.Extensions.Localization" version="1.0.0-rc1-final" targetFramework="net451" />
|
||||
<package id="Microsoft.Extensions.Localization.Abstractions" version="1.0.0-rc1-final" targetFramework="net451" />
|
||||
<package id="Microsoft.Extensions.Logging" version="1.0.0-rc1-final" targetFramework="net451" />
|
||||
<package id="Microsoft.Extensions.Logging.Abstractions" version="1.0.0-rc1-final" targetFramework="net451" />
|
||||
<package id="Microsoft.Extensions.MemoryPool" version="1.0.0-rc1-final" targetFramework="net451" />
|
||||
<package id="Microsoft.Extensions.OptionsModel" version="1.0.0-rc1-final" targetFramework="net451" />
|
||||
<package id="Microsoft.Extensions.PlatformAbstractions" version="1.0.0-rc1-final" targetFramework="net451" />
|
||||
<package id="Microsoft.Extensions.Primitives" version="1.0.0-rc1-final" targetFramework="net451" />
|
||||
<package id="Microsoft.Framework.ConfigurationModel" version="1.0.0-beta4" targetFramework="net451" />
|
||||
<package id="Microsoft.Framework.ConfigurationModel.Interfaces" version="1.0.0-beta4" targetFramework="net451" />
|
||||
<package id="Microsoft.Framework.ConfigurationModel.Json" version="1.0.0-beta4" targetFramework="net451" />
|
||||
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net451" />
|
||||
<package id="Remotion.Linq" version="2.0.1" targetFramework="net451" />
|
||||
<package id="System.Collections" version="4.0.11" targetFramework="net451" />
|
||||
<package id="System.Collections.Immutable" version="1.1.37" targetFramework="net451" />
|
||||
<package id="System.Diagnostics.Debug" version="4.0.11" targetFramework="net451" />
|
||||
<package id="System.Diagnostics.DiagnosticSource" version="4.0.0-beta-23516" targetFramework="net451" />
|
||||
<package id="System.Diagnostics.Tracing" version="4.0.0" targetFramework="net451" />
|
||||
<package id="System.Globalization" version="4.0.11" targetFramework="net451" />
|
||||
<package id="System.IO" version="4.0.0" targetFramework="net451" />
|
||||
<package id="System.Linq" version="4.1.0" targetFramework="net451" />
|
||||
<package id="System.Reflection" version="4.1.0" targetFramework="net451" />
|
||||
<package id="System.Reflection.Extensions" version="4.0.0" targetFramework="net451" />
|
||||
<package id="System.Reflection.Metadata" version="1.1.0" targetFramework="net451" />
|
||||
<package id="System.Reflection.Primitives" version="4.0.0" targetFramework="net451" />
|
||||
<package id="System.Resources.ResourceManager" version="4.0.1" targetFramework="net451" />
|
||||
<package id="System.Runtime" version="4.0.0" targetFramework="net451" />
|
||||
<package id="System.Runtime.Extensions" version="4.1.0" targetFramework="net451" />
|
||||
<package id="System.Runtime.InteropServices" version="4.1.0" targetFramework="net451" />
|
||||
<package id="System.Text.Encoding" version="4.0.0" targetFramework="net451" />
|
||||
<package id="System.Text.Encoding.Extensions" version="4.0.0" targetFramework="net451" />
|
||||
<package id="System.Threading" version="4.0.0" targetFramework="net451" />
|
||||
<package id="Yavsc.Abstract" version="1.0.5-rc9" targetFramework="net451" />
|
||||
<package id="Yavsc.Server" version="1.0.5-rc9" targetFramework="net451" />
|
||||
</packages>
|
@ -1,37 +1,35 @@
|
||||
{
|
||||
"version": "1.0.0-*",
|
||||
"commands": {
|
||||
"run": "cli"
|
||||
},
|
||||
"resource": "Resources/**/*.resx",
|
||||
"buildOptions": {
|
||||
"debugType": "full",
|
||||
"emitEntryPoint": true,
|
||||
"compile": {
|
||||
"include": "*.cs",
|
||||
"exclude": [
|
||||
"contrib"
|
||||
]
|
||||
"version": "1.0.0-*",
|
||||
"commands": {
|
||||
"run": "cli"
|
||||
},
|
||||
"embed": [
|
||||
"Resources/**/*.resx"
|
||||
]
|
||||
},
|
||||
"dependencies": {
|
||||
"Yavsc.Server": {
|
||||
"target": "project",
|
||||
"type": "build"
|
||||
"resource": "Resources/**/*.resx",
|
||||
"buildOptions": {
|
||||
"debugType": "full",
|
||||
"emitEntryPoint": true,
|
||||
"compile": {
|
||||
"include": "*.cs",
|
||||
"exclude": [
|
||||
"contrib"
|
||||
]
|
||||
},
|
||||
"embed": [
|
||||
"Resources/**/*.resx"
|
||||
]
|
||||
},
|
||||
"Microsoft.Framework.Configuration.Json": "1.0.0-beta8",
|
||||
"Microsoft.Framework.ConfigurationModel.Json": "1.0.0-beta4",
|
||||
"Microsoft.Extensions.Configuration.Json": "1.0.0-rc1-final",
|
||||
"Microsoft.Extensions.Logging.Console": "1.0.0-rc1-final",
|
||||
"Microsoft.Extensions.DependencyInjection": "1.0.0-rc1-final",
|
||||
"RazorEngine": "4.5.1-alpha001",
|
||||
"Microsoft.CodeAnalysis.CSharp": "2.8.0-beta3"
|
||||
},
|
||||
"frameworks": {
|
||||
"dnx451": {},
|
||||
"net451": {}
|
||||
}
|
||||
"dependencies": {
|
||||
"Microsoft.AspNet.Hosting": "1.0.0-rc1-final",
|
||||
"Microsoft.Extensions.Configuration.Json": "1.0.0-rc1-final",
|
||||
"Microsoft.Extensions.DependencyInjection": "1.0.0-rc1-final",
|
||||
"Microsoft.Extensions.Logging.Console": "1.0.0-rc1-final",
|
||||
"Microsoft.Extensions.PlatformAbstractions": "1.0.0-rc1-final",
|
||||
"Microsoft.Framework.Configuration.Json": "1.0.0-*",
|
||||
"Microsoft.Framework.ConfigurationModel.Json": "1.0.0-*",
|
||||
"Yavsc.Server": "1.0.5-rc9",
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "1.0.0-rc1-final",
|
||||
"Microsoft.Extensions.Logging.Debug": "1.0.0-rc1-final"
|
||||
},
|
||||
"frameworks": {
|
||||
"dnx451": {}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue