SmartCode.CLI 1.0.0

Package Description

There is a newer version of this package available.
See the version list below for details.
dotnet tool install --global SmartCode.CLI --version 1.0.0
This package contains a .NET Core Global Tool you can call from the shell/command line.

SmartCode

SmartCode = IDataSource -> IBuildTask -> IOutput => Build Everything

Introduction

SmartCode

SmartCode.Db (代码生成器)

Demo

SmartCode

Getting Started

  1. Install from .NET Core Global Tool
dotnet tool install --global SmartCode.CLI --version 1.0.0
  1. 编辑构建配置文件(默认:SmartCode.yml)
  2. 命令行执行SmartCode命令
    • SmartCode
    • 等待提示输入配置文件路径(可选:默认程序根目录下SmartCode.yml文件)
    • 回车执行命令
  3. 等待任务执行结束
  4. 查看输出目录结果

构建配置文件

Module: SmartSql.Starter
Author: Ahoo Wang
DataSource:
  Name: Db
  Paramters:
    DbName: SmartSqlStarterDB
    DbProvider: SqlServer
    ConnectionString: Data Source=.;Initial Catalog=SmartSqlStarterDB;Integrated Security=True
Language: CSharp
TemplateEngine: Razor 
Output: 
  Type: File
  Path: 'E://SmartSql-Starter'

# 构建任务
Build:
  ClearDir:
    Type: Clear
    Paramters:
      Dirs: '.'
  Solution:
    Type: Project
    Template: Sln.cshtml
    Output:
      Path: '.'
      Name: '{{Project.Module}}'
      Extension: '.sln'
  SmartSqlConfig:
    Type: Project
    Template: SqlMapConfig.cshtml
    Output:
      Path: '{{Project.Module}}.API'
      Name: 'SmartSqlMapConfig'
      Extension: '.xml'
  Entity_Project:
    Type: Project
    Template: Proj.cshtml
    Output:
      Path: '{{Project.Module}}.Entity'
      Name: '{{Project.Module}}.Entity'
      Extension: '.csproj'
  Entity:
    Type: Table
    Module: Entity
    Template: Entity.cshtml
    Output:
      Path: '{{Project.Module}}.{{Build.Module}}'
      Extension: '.cs'
    NamingConverter:
      Table:
        Tokenizer:
          Type: Default
          Paramters:
            IgnorePrefix: 'T_'
            Delimiter: '_'
        Converter:
          Type: Default
          Paramters: { }
      View:
        Tokenizer:
          Type: Default
          Paramters:
            IgnorePrefix: 'V_'
            Delimiter: '_'
        Converter:
          Type: Pascal
      Column:
        Tokenizer:
          Type: Default
          Paramters: 
            Delimiter: '_'
        Converter:
          Type: Pascal
  Repository_Project:
    Type: Project
    Template: Proj-Repository.cshtml
    Output:
      Path: '{{Project.Module}}.Repository'
      Name: '{{Project.Module}}.Repository'
      Extension: '.csproj'
  Repository:
    Type: Table
    Module: Repository
    Template: Repository.cshtml
    Output:
      Path: '{{Project.Module}}.{{Build.Module}}'
      Name: 'I{{OutputName}}Repository'
      Extension: .cs
    NamingConverter:
      Table:
        Tokenizer:
          Type: Default
          Paramters:
            IgnorePrefix: 'T_'
            Delimiter: '_'
        Converter:
          Type: Default
      View:
        Tokenizer:
          Type: Default
          Paramters: 
            IgnorePrefix: 'V_'
            Delimiter: '_'
        Converter:
          Type: Default

  SqlMap:
    Type: Table
    Template: SqlMap-SqlServer.cshtml
    Output:
      Path: '{{Project.Module}}.API/Maps'
      Extension: .xml
    IgnoreTables: null
    NamingConverter:
      Table:
        Tokenizer:
          Type: Default
          Paramters: 
            IgnorePrefix: 'T_'
            Delimiter: '_'
        Converter:
          Type: Default
      View:
        Tokenizer:
          Type: Default
          Paramters: 
            IgnorePrefix: 'V_'
            Delimiter: '_'
        Converter:
          Type: Default
      Column:
        Tokenizer:
          Type: Default
          Paramters: 
            IgnorePrefix: 'T_'
            Delimiter: '_'
        Converter:
          Type: Default

| 参数名 | 说明 |
| :--------- | --------:|
| Module | 根模块名 |
| Author | 作者 |
| DataSource | 数据源 |
| Language | 语言:CSharp/Java/.... |
| TemplateEngine | 模板引擎:目前内置:Razor/Handlebars |
| Output | 输出 |
| Build | 任务构建s |

DataSource 数据源,Name:Db

属性 Name:Db,使用DbSource插件作为数据源

DbSource.Paramters 接受以下三个参数:

| 参数名 | 说明 |
| :--------- | --------:|
| DbName | 数据库名称 |
| DbProvider | 数据驱动提供者:MySql,MariaDB,PostgreSql,SqlServer,Oracle,SQLite |
| ConnectionString | 连接字符串 |

Build 任务构建

| 参数名 | 说明 |
| :--------- | --------:|
| Type | 构建类型,Clear:用于清理目录s/文件s,Project:用于构建单文件,如:解决方案文件/项目文件,Table: 用于构建以数据表为基础的文件,如:Entity,Repository文件|
| Module | 构建模块名 |
| TemplateEngine | 模板引擎,可选,默认使用根模块引擎 |
| Template | 模板文件 |
| Output | 输出 |
| IncludeTables | 包括表名s |
| IgnoreTables | 忽略表名s |
| NamingConverter | 命名转换器 |
| Paramters | 自定义构建参数 |

NamingConverter 命名转换

| 属性 | 说明 |
| :--------- | --------:|
| 类型 | Table/View/Column |
| Tokenizer | 分词器 |
| Converter | 转换器:Camel/Pascal/None |

NamingConverter.Tokenizer 分词器

| 属性 | 说明 |
| :--------- | --------:|
| Type | Default |
| Paramters.IgnorePrefix | 忽略前缀字符 |
| Paramters.Delimiter | 分隔符 |

SmartCode

SmartCode = IDataSource -> IBuildTask -> IOutput => Build Everything

Introduction

SmartCode

SmartCode.Db (代码生成器)

Demo

SmartCode

Getting Started

  1. Install from .NET Core Global Tool
dotnet tool install --global SmartCode.CLI --version 1.0.0
  1. 编辑构建配置文件(默认:SmartCode.yml)
  2. 命令行执行SmartCode命令
    • SmartCode
    • 等待提示输入配置文件路径(可选:默认程序根目录下SmartCode.yml文件)
    • 回车执行命令
  3. 等待任务执行结束
  4. 查看输出目录结果

构建配置文件

Module: SmartSql.Starter
Author: Ahoo Wang
DataSource:
  Name: Db
  Paramters:
    DbName: SmartSqlStarterDB
    DbProvider: SqlServer
    ConnectionString: Data Source=.;Initial Catalog=SmartSqlStarterDB;Integrated Security=True
Language: CSharp
TemplateEngine: Razor 
Output: 
  Type: File
  Path: 'E://SmartSql-Starter'

# 构建任务
Build:
  ClearDir:
    Type: Clear
    Paramters:
      Dirs: '.'
  Solution:
    Type: Project
    Template: Sln.cshtml
    Output:
      Path: '.'
      Name: '{{Project.Module}}'
      Extension: '.sln'
  SmartSqlConfig:
    Type: Project
    Template: SqlMapConfig.cshtml
    Output:
      Path: '{{Project.Module}}.API'
      Name: 'SmartSqlMapConfig'
      Extension: '.xml'
  Entity_Project:
    Type: Project
    Template: Proj.cshtml
    Output:
      Path: '{{Project.Module}}.Entity'
      Name: '{{Project.Module}}.Entity'
      Extension: '.csproj'
  Entity:
    Type: Table
    Module: Entity
    Template: Entity.cshtml
    Output:
      Path: '{{Project.Module}}.{{Build.Module}}'
      Extension: '.cs'
    NamingConverter:
      Table:
        Tokenizer:
          Type: Default
          Paramters:
            IgnorePrefix: 'T_'
            Delimiter: '_'
        Converter:
          Type: Default
          Paramters: { }
      View:
        Tokenizer:
          Type: Default
          Paramters:
            IgnorePrefix: 'V_'
            Delimiter: '_'
        Converter:
          Type: Pascal
      Column:
        Tokenizer:
          Type: Default
          Paramters: 
            Delimiter: '_'
        Converter:
          Type: Pascal
  Repository_Project:
    Type: Project
    Template: Proj-Repository.cshtml
    Output:
      Path: '{{Project.Module}}.Repository'
      Name: '{{Project.Module}}.Repository'
      Extension: '.csproj'
  Repository:
    Type: Table
    Module: Repository
    Template: Repository.cshtml
    Output:
      Path: '{{Project.Module}}.{{Build.Module}}'
      Name: 'I{{OutputName}}Repository'
      Extension: .cs
    NamingConverter:
      Table:
        Tokenizer:
          Type: Default
          Paramters:
            IgnorePrefix: 'T_'
            Delimiter: '_'
        Converter:
          Type: Default
      View:
        Tokenizer:
          Type: Default
          Paramters: 
            IgnorePrefix: 'V_'
            Delimiter: '_'
        Converter:
          Type: Default

  SqlMap:
    Type: Table
    Template: SqlMap-SqlServer.cshtml
    Output:
      Path: '{{Project.Module}}.API/Maps'
      Extension: .xml
    IgnoreTables: null
    NamingConverter:
      Table:
        Tokenizer:
          Type: Default
          Paramters: 
            IgnorePrefix: 'T_'
            Delimiter: '_'
        Converter:
          Type: Default
      View:
        Tokenizer:
          Type: Default
          Paramters: 
            IgnorePrefix: 'V_'
            Delimiter: '_'
        Converter:
          Type: Default
      Column:
        Tokenizer:
          Type: Default
          Paramters: 
            IgnorePrefix: 'T_'
            Delimiter: '_'
        Converter:
          Type: Default

| 参数名 | 说明 |
| :--------- | --------:|
| Module | 根模块名 |
| Author | 作者 |
| DataSource | 数据源 |
| Language | 语言:CSharp/Java/.... |
| TemplateEngine | 模板引擎:目前内置:Razor/Handlebars |
| Output | 输出 |
| Build | 任务构建s |

DataSource 数据源,Name:Db

属性 Name:Db,使用DbSource插件作为数据源

DbSource.Paramters 接受以下三个参数:

| 参数名 | 说明 |
| :--------- | --------:|
| DbName | 数据库名称 |
| DbProvider | 数据驱动提供者:MySql,MariaDB,PostgreSql,SqlServer,Oracle,SQLite |
| ConnectionString | 连接字符串 |

Build 任务构建

| 参数名 | 说明 |
| :--------- | --------:|
| Type | 构建类型,Clear:用于清理目录s/文件s,Project:用于构建单文件,如:解决方案文件/项目文件,Table: 用于构建以数据表为基础的文件,如:Entity,Repository文件|
| Module | 构建模块名 |
| TemplateEngine | 模板引擎,可选,默认使用根模块引擎 |
| Template | 模板文件 |
| Output | 输出 |
| IncludeTables | 包括表名s |
| IgnoreTables | 忽略表名s |
| NamingConverter | 命名转换器 |
| Paramters | 自定义构建参数 |

NamingConverter 命名转换

| 属性 | 说明 |
| :--------- | --------:|
| 类型 | Table/View/Column |
| Tokenizer | 分词器 |
| Converter | 转换器:Camel/Pascal/None |

NamingConverter.Tokenizer 分词器

| 属性 | 说明 |
| :--------- | --------:|
| Type | Default |
| Paramters.IgnorePrefix | 忽略前缀字符 |
| Paramters.Delimiter | 分隔符 |

Dependencies

This package has no dependencies.

Version History

Version Downloads Last updated
2.3.5 65 4/29/2020
2.3.4 95 3/27/2020
2.3.3 74 3/27/2020
2.3.2 74 3/11/2020
2.3.1 63 3/11/2020
2.3.0 75 3/11/2020
2.2.95 102 2/17/2020
2.2.94 102 2/14/2020
2.2.93 50 2/14/2020
2.2.92 195 11/18/2019
2.2.90 73 11/12/2019
2.2.88 99 10/30/2019
2.2.86 85 10/23/2019
2.2.85 81 10/22/2019
2.2.84 70 10/22/2019
2.2.83 85 10/22/2019
2.2.82 80 10/21/2019
2.2.81 85 10/21/2019
2.2.80 87 10/21/2019
2.2.70 178 8/21/2019
2.2.68 155 8/5/2019
2.2.66 123 7/29/2019
2.2.65 129 7/22/2019
2.2.62 108 7/19/2019
2.2.60 100 7/19/2019
2.2.58 150 7/10/2019
2.2.57 140 7/8/2019
2.2.56 153 6/28/2019
2.2.55 173 6/11/2019
2.2.53 138 6/10/2019
2.2.52 168 6/4/2019
2.2.50 154 6/3/2019
2.2.48 157 5/23/2019
2.2.46 157 5/23/2019
2.2.45 1,024 5/7/2019
2.2.44 163 5/6/2019
2.2.42 324 4/30/2019
2.2.40 149 4/30/2019
2.2.38 155 4/30/2019
2.2.36 150 4/29/2019
2.2.30 149 4/26/2019
2.2.25 197 4/26/2019
2.2.22 174 4/25/2019
2.2.20 196 4/24/2019
2.2.10 233 4/23/2019
2.2.8 209 4/23/2019
2.2.2 157 4/18/2019
2.2.0 164 4/16/2019
2.1.10 159 4/16/2019
2.1.9 183 4/11/2019
2.1.8 174 4/10/2019
2.1.6 151 4/10/2019
2.1.5 170 4/1/2019
2.1.3 162 3/29/2019
2.1.2 167 3/25/2019
2.1.1 173 3/22/2019
2.1.0 180 3/22/2019
2.0.5 220 2/27/2019
2.0.4 346 12/17/2018
2.0.2 195 12/14/2018
2.0.0 100,832 12/14/2018
1.18.2 113,103 11/22/2018
1.18.1 13,512 11/16/2018
1.16.20 10,822 11/16/2018
1.16.19 10,334 11/16/2018
1.16.18 5,045 11/14/2018
1.16.16 1,697 11/7/2018
1.16.15 261 11/4/2018
1.16.13 7,214 11/4/2018
1.16.12 2,186 11/1/2018
1.16.6 8,498 10/31/2018
1.16.2 8,986 10/31/2018
1.16.1 44,687 10/31/2018
1.16.0 214 10/30/2018
1.12.0 246 10/30/2018
1.9.0 658 10/27/2018
1.8.1 902 10/26/2018
1.8.0 968 10/25/2018
1.7.6 1,124 10/24/2018
1.7.5 1,185 10/24/2018
1.7.2 1,393 10/22/2018
1.7.1 961 10/21/2018
1.6.9 306 10/20/2018
1.6.8.1 769 10/20/2018
1.6.8 557 10/20/2018
1.6.2 255 10/19/2018
1.5.0 283 10/18/2018
1.4.6 214 10/18/2018
1.3.9 317 10/17/2018
1.3.8 246 10/17/2018
1.3.6 206 10/15/2018
1.3.4 411 10/11/2018
1.3.0 256 10/9/2018
1.2.0 228 10/8/2018
1.1.0 220 10/7/2018
1.0.0 247 10/7/2018
Show less