Code Monkey home page Code Monkey logo

dpb's Introduction

DPB: Dynamic Project Builder

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 of washing 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 as PDBMARK Keep and 'PDBMARK_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 PDB 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:

using DPB.Models;

namespace DPB.Tests
{
    public class BuildProject
    {
        public void Build()
        {
            Manifest manifest = new Manifest();
            manifest.SourceDir = "..\\..\\SourceDir";//or absolute address: e:\ThisProject\src
            manifest.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: PDBMARK MP
            manifest.ConfigGroup.Add(new GroupConfig()
            {
                Files = new List<string>() { "*.cs" },
                KeepContentConiditions = new List<string>() { "MP" }
            });

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

            //PDBMARK MP
            var tip = "this line will stay here in OutputDir while Conditions have MP keyword.";
            //PDBMARK_END

When another code block with PDBMARK OTHER instead of PDBMARK MP in the file region, the block will be removed.

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

The code (or any text file content) with out PDBMARK 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:

PDBMARK_FILE RemoveFile

dpb's People

Contributors

jeffreysu avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.