dfgenerator 0.1.0-preview.2
dotnet tool install --global dfgenerator --version 0.1.0-preview.2
dotnet new tool-manifest
dotnet tool install --local dfgenerator --version 0.1.0-preview.2
#tool dotnet:?package=dfgenerator&version=0.1.0-preview.2&prerelease
nuke :add-package dfgenerator --version 0.1.0-preview.2
Development Factory : Project generator
Introduction
Development Factory Project Generator is a Dotnet tool which allows you to generate projects from templates. Create your templates and reuse them in your future projects.
You can add multiple sources to contain templates, for example one for your personal projects and one for your company.
Connect the sources to a Git repository to share templates with others and it allows you to be sure to use the latest version of templates when generating a new project.
Compatible with Windows
, Linux
and Mac
.
Get Started with 3 commands
Dotnet tool requires .Net 6 SDK. Install faster here : https://dotnet.microsoft.com/en-us/download/dotnet/6.0
First, install the tool.
dotnet tool install dfgen -g
Second, create source in current folder (move to new folder to contain templates). Option --addsample
will create sample projects
dfgen add-source --sourcename "Test" --folderpath TestSource --addsamples
Third, run generator
dfgen gen --outputpath GeneratedProject
Concepts
Template
Template is a folder which contains files and sub folders. This content will be copied into the target folder when you will choose this template to generate your project.
Template folder can optionally contain a file .dftemplate.json
to configure the template. This file will not be copied into the target folder.
Configuration options :
PromptName
By default, the name is template is the folder name. This name will be used in prompt template selection.
{
"PromptName": "My template"
}
ExcludeFiles
List of file names which will be excluded from generation (.dftemplate.json
file is automatically added to this list).
{
"ExcludeFiles": ["filename"]
}
TemplateProjectName
When this option is specified, this keyword will be replaced by project name on each file and path. In C# template, use this option to change all code namespace to the project name.
{
"TemplateProjectName": "ApiNet6Template"
}
Source
Source is folder which contains multiple templates. The list of source is stored in sources.json
file inside User Profile folder.
Sources files location :
Windows Path | Linux | Mac Path |
---|---|---|
C:\Users\USERNAME.df-templates | home/.df-templates | /Users/USERNAME/.df-templates |
Source can be linked to a git repository. In this case, content of repository will be cloned when source is added and each time you select template of the source.
Tool will use local installed git to execute clone and pull commands. It will use global computer credential for it.
Commands
gen
This command run the generator. You can use interaction, the command will guide you to generate your project, or add option.
Usage:
dfgen gen [options]
Exemple:
dfgen gen --outputpath "D:\Path\To\Project" --templatename "asp-net" --projectname "MyProject" --noprompt
Options
--templatename <string>
The template name. It is template folder name or Prompt Name (see Template concept)
Required with --noprompt.
--projectname <string>
The name of your project.
Required with --noprompt.
--outputpath <string>
Specify path to generate project.
--override
Override source if already exist.
--noprompt
Disable prompt interaction.
add-source
Add or update source.
Usage:
dfgen add-source [options]
Example:
dfgen add-source --sourcename "local" --folderpath "C:\MyLocalSource" --repourl "repo-ssh-link"
--sourcename
The name of the source.
Required
--folderpath
Custom source location. If not specified, folder will be automatically created to the source (see Source concept).
--repourl
Repository URL (http or ssh link) to link source to a repository (see Source concept).
--noprompt
Disable prompt interaction. Be careful, other option are mandatory if no prompt option activated.
list-source
List sources and templates.
Usage:
dfgen list-source [options]
Example:
dfgen list-source --includelocations
--includeslocation
Include the path to the source.
delete-source
Delete sources and templates. This command will remove source folder too. A confirmation is asked.
Usage:
dfgen delete-source [options]
Example:
dfgen delete-source --force
--noprompt
With this option, no confirmation is required to remove.
Knowledge base
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
This package has no dependencies.
Version | Downloads | Last Updated |
---|---|---|
0.1.0-preview.2 | 2,165 | 12/29/2023 |