-
Notifications
You must be signed in to change notification settings - Fork 0
Kinetix.Tools.Core + T4 and parameters singleton removal + .NET Core #1
Conversation
6a1e66f
to
1a39867
Compare
I checked on my project and it works well. I added a new feature to use the default values from the OOM to generate the adequate C# for EF and the default value in the generated SQL. I think it should work with SSDT too, with the default value file overriding the default values set in the OOM. I also removed the MSBuild dependency for SSDT as discussed (since wildcards work!) Finally, I rebased (painfully) on master, so please check that everything still works fine for you, and you can merge. |
I managed to get both generators work on .NET Core with minimal changes. |
So, I tried It. Class generatorAlmost ok, it changed the content of my sqlproj file by what seems to be the content of a list factory sql file ----
---- ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT (7667C01C58993CD698162FA04A2840CE180E56F7) !
----
-- ===========================================================================================
-- Description : Insertion des valeurs de listes statiques.
-- ===========================================================================================
Service generatorIt doesn't run: |
The ModGen issue is weird and I'd appreciate if you could take a look at what's happening (since you have a SSDT project on hand). It should be pretty trivial to find the problem and fix it. And I'm pretty sure the ServiceGen issue comes from the fact that your project is a classic ASP.NET project that the .NET Core SDK cannot open... Which is probably (one of the reasons) why the classic |
Okay I found why it changed the .sqlproj file You gave the sqlproj path to edit instead of the scriptfile path |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SpaServiceGenerator is broken for framework projects
The sqlproj problem should be fixed now, and I added the option to multitarget net471 and netcoreapp2.1 because using I also noticed that Buildalyzer wasn't properly emulating MSBuildWorkspace on Core because it didn't fill the Please let me know if it works fine for you, so that we can merge it and go forward with new changes. |
var secondFolder = controller.Folders.Count > 1 ? $"/{string.Join("/", controller.Folders.Skip(1).Select(f => f.ToDashCase()))}" : string.Empty; | ||
var folderCount = (frontEnds.Count() > 1 ? 1 : 0) + controller.Folders.Count; | ||
var secondFolder = folders.Count > 1 ? $"/{string.Join("/", folders.Skip(1).Select(f => f.ToDashCase()))}" : string.Empty; | ||
var folderCount = (frontEnds.Count() > 1 ? 1 : 0) + folders.Count - 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is used to generate the JS imports in the service files, and I noticed a "-1" was missing (my Folders.Count
was always 0 instead of always 1, so I didn't catch it).
I hope this works for your folder hierarchy
Preparing groundwork for KleeGroup/kinetix-tools#9, KleeGroup/kinetix-tools#10 and KleeGroup/kinetix-tools#11
This is a PR because it's completely untested, though I am confident there won't be any regression 😃
I created
Kinetix.Tools.Common
where I put all parameter types (GeneratorParameters
and co.), theModel
namespace (i needed to useModelProperty
so I copied everything over),FileWriter
in prevision of the TS gen migration, and every TS util we had across both generators.While working on parameters, I removed the
Singletons.GeneratorParameters
and gave every class the parameters it needed to work instead. I realized we some of them were actually misplaced, so I moved them :Kinetix
from root to csharpDefaultValuesFile
,NoTableFile
,HistoriqueCreationFile
from root to ssdtI removed the T4 files and kept the generated C#, that I cleaned up by removing all the useless things that were generated. It is perfectly usable as it is, but it would be better if we could build in the future something like
CSharpWriter
on top of it.Again, a lot of stuff moved around, because that's my favorite thing to do 😛
Please update your config file and test the PR to confirm there's no regression on your side (well, you could wait for me to test it first on Monday).
(Also, I might have changed the output folder of the generators to remove the framework prefix, so we can more easily test between full .NET and Core in the future.)