Giter VIP home page Giter VIP logo

Comments (3)

smaudet avatar smaudet commented on August 27, 2024

@abskulkarni It has different issues, but a workaround I have used for this situation is to use MSM modules (I have on per folder).

You can recursively include files for each msm module, then include each folder as a "merge" into the main folder. I am missing a lot of context from the previous discussion probably, but that gets around the issue.

An alternative approach is to just manually recurse the folder(s) yourself - the code is not too difficult, and I actually wrote it myself before I figured out how to use the Files / DirFiles (maybe you shouldn't need to call a separate method to "resolve wildcards", I understand having written the recursive routines myself that there are various filtering issues that make this a bit harder, but there's no reason it can't be done ahead of time).

Actually a major issue I have with the API, perhaps a new feature, is that SourceDir can only be set once per project. So I started using MSM for this exact issue. Later I ended up pulling SourceDir up to the repo roots, and passing around relative directories more "smartly", but it would be simpler to just be able to specify multiple-per-wixitem SourceDirs.

from wixsharp.

abskulkarni avatar abskulkarni commented on August 27, 2024

Hi @oleg-shilo
Can you please guide me if there is any solution to my issue above?

from wixsharp.

oleg-shilo avatar oleg-shilo commented on August 27, 2024

As @smaudet suggested, manually recursing through the folders is the most powerful option you have. But it's costly. You have to do recursion heavy lifting:

// pseudo code
foreach(var file in Directory.GetFiles("<your root dir>", "*", SearchOptions.AllFiles))
{
    string instalDir = file.GetDirName().MakeRelativeTo(project.SourceDir);
      
    Dir wDir = project.FindOrCreateDir(installDir);

    var wFile = new File(file);
    wFile.Features = new[] { "<whatever feature you want 1>", "<whatever feature you want 2>" };
    
    wDir.AddFile(new File(wfile));
}
project.Build.Msi();

However, ... dId you try the suggestion I posted in the original thread?

AutoElements.SupportEmptyDirectories = CompilerSupportState.Disabled;
Compiler.AutoGeneration.IgnoreWildCardEmptyDirectories = true;

from wixsharp.

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.