Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Dynamic Project Builder

License

NotificationsYou must be signed in to change notification settings

Senparc/DPB

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

90 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DPB is a tool that allows developers to automatically generate project code.

You can add annotations to the code templates, and use DPB to automatically filter or generate code to build a complete new project.

DPB support for all files and all languages.

Why I need DPB

We always build new customized projects and template projects. When new project requirements come, we have to copy the whole project files and do a lot ofwashing jobs: remove the files, change the key contents, modify configuration values and so on.

Also when we published an open source project, we always support Demo / Sample and Documents. But it's really not every developer wants to read all of the code and sample project and documents.

With DPB, you just need to put same marks into your code, such asDPBMARK Keep and 'DPBMARK_END', or configure a profile, then run DPB, it will build a new clearn-project into the Output Directory, just keep the code and files you want.

How to use

Method 1: Build App by your own

  1. Install the DPB from Nuget into your project(or compile the source code):https://www.nuget.org/packages/DPB/

Both your working prject or a new project are OK.

  1. Create a new class, such as BuildProject.cs

  2. Create a method such as Build() in to BuildBProject

  3. Create a manifest entity, and set the SourceDir(your template peojrct_ and OutputDir:

usingDPB.Models;namespaceDPB.Tests{publicclassBuildProject{publicvoidBuild(){Manifestmanifest=newManifest();manifest.SourceDir="..\\..\\SourceDir";//or absolute address: e:\ThisProject\srcmanifest.OutputDir="..\\..\\OutputDir";//or absolute address: e:\ThisProject\Output}}}
  1. set the rules, such as :

Remove content block

//keep content Condition - while all the code blocks in *.cs files with keywrod mark: DPBMARK MPmanifest.ConfigGroup.Add(newGroupConfig(){Files=newList<string>(){"*.cs"},KeepContentConiditions=newList<string>(){"MP"}});

it will keep the code in your source project with the certain code block:

//DPBMARK MPvartip="this line will stay here in OutputDir while Conditions have MP keyword.";//DPBMARK_END

When another code block withDPBMARK OTHER instead ofDPBMARK MP in the file region, the block will be removed.

You can also set multipleKeepContentConiditions keywords to keep the code stay in new project.

The code (or any text file content) with outDPBMARK mark bolck will always keep in new project.

Delete whole file

If you want to remove a file, just Add the following code into the file in any where:

DPBMARK_FILE RemoveFile

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp