Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add projectspecific files based on directory #140

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

JohannesGoetz
Copy link

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
Copy link
Author

Hello everyone,

I just realized, that i forgot to clean up my commit history. Do you think it would help if I sqashed them into fewer commits?

Best Regards,
Johannes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant