generator-helix icon indicating copy to clipboard operation
generator-helix copied to clipboard

Add projectspecific files based on directory

Open JohannesGoetz opened this issue 5 years ago • 1 comments

Description of the Change

This change addresses a few issues I had with the generator. I realize that there is another pending pull request that adresses part of the Problem, but I believe this solution is more customizeable. I had most of the implementation finished before I saw this request, so I thought it's worth to give it a shot:

1. Make more use of the helix-template folder in the project

With this change the helix generator makes more use of the helix-template folder in the solution. This means, that every file and every folder that is contained in the helix-template folder will be copied to the code folder of the module which is being created. While copying the structure of the helix-template folder, the substings _Layer, _Module and _Vendor in filenames and folder names will be replaced by the current values.

2. Build config generation in .csproj file can be deactivated

I added the option to not generate build configurations in the .csproj file. There is an additional question if build configurations should be generated on script start which controls this. This is useful if there are specific needs to the build configurations which aren't handled by the generator yet. To use this correctly the build configurations should be provided by the .csproj templates.

3. Bugfix

In addition to the above features, I fixed a bug, that could cause a broken solution file. This bug occurred when there were Modules in the solution that contained the name of a Layer, but were not the Layer folder.

For example a solution that had a module which is called FeatureList would cause the created project to have two parent items in the nested projects section, the FeatureList and the Layer folder itself. So in the solution file there would be an assignment like this:

{AA5E14BE-163F-49CF-AB86-83F0B9F11787} = {A6A46CA0-6EE6-4964-9D5B-83163E178A7E}{60DA3F20-DEED-4580-AE38-A296D76ADE79}

To fix this, I changed the generator to only pick the first object that is found with the @like@ operation. So if a solution does have this problem it can be resolved by moving the layer folders to the top of the project definitions in the.sln file.

Benefits

  • More options to adjust the generator to the needs of a specific solution.
  • For most solutions there should be no manual adjustments neccessary after the project is created, assuming the helix-template folder is set up correct.
  • Problems with Modules which have a name of a layer as part of their own name can be avoided.

Possible Drawbacks

  • Wrong content of Files in the helix-template folder of the solution might break the solution
  • There is an additional question on script startup, which might confuse users on first use

JohannesGoetz avatar Jan 24 '20 15:01 JohannesGoetz