Giter VIP home page Giter VIP logo

Comments (3)

sayedihashimi avatar sayedihashimi commented on August 24, 2024

There is an older sample at https://github.com/dotnet/dotnet-template-samples/tree/master/03-optional-page which I believe should still work that demonstrates how to exclude a file.

from template-sample.

akhileshk9 avatar akhileshk9 commented on August 24, 2024

Thanks for the reply syed. I have more complex use case. It is as follows:

  1. I have solution with multiple projects in it.
  2. I need to exclude a folder in one of the project based on a parameter.
    Eg:

Solution Structure:

SampleSolution
      ProjectName.Implementation
      ProjectName.Infrastructure
                Data
                    Cosmos
                          Interfaces
                             <Files>
                          Implementation
                             <Files>
                    SQL
                        <Files>

The "ProjectName" part in the above project name is replaced based on the project name given in the wizard. If the user selects the datasource as SQL, then cosmos folder in the infrastructure project should be excluded.

Below is snippet from template.json:

"Datasource":{
        "type": "parameter",
        "datatype": "choice",
        "choices": [
          {
            "choice": "Cosmos"
          },
          {
            "choice": "SQL"
          }
        ]
      }
    },
    "sources": [
      {
        "modifiers": [
          {
            "condition": "(Datasource == 'SQL')",
            "exclude": [
              "*.Infrastructure/Data/Cosmos"
            ]
          }
        ]
      }
    ]

from template-sample.

sayedihashimi avatar sayedihashimi commented on August 24, 2024

I'm sorry I never replied here @akhileshk9 are you still working through this or did you figure it out?

from template-sample.

Related Issues (20)

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.