|
I was thinking of calling my band 1073741824. mkay?
speramus in juniperus
|
|
|
|
|
|
Are we bored again?
If first you don't succeed recurse[^]!
|
|
|
|
|
Word.
Software Zen: delete this;
|
|
|
|
|
We've been using .LESS and Javascript packagers and minifiers for years and the concept of writing a single file and having that generate multiple files is brilliant.
For example, we'll update a JavaScript file and have the updates automatically be included in a number of other files, and also have minified versions of those files be created too.
We have a situation where we're porting some SQL Server stuff to MySQL (well, probably MariaDB) and the syntax for stored procedures is similar but not the same. We've been playing with T4 templates that would allow us to have all versions in one file, and then have .sql and .mysql versions of the stored procedure files created. It works, but it's not seamless.
So I was wondering: has anyone else played with any file templating solutions like this (and not necessarily for SQL files - anything really)? We're *this* close to writing our own VS extension but didn't want to go down that path if there's a neater solution or better approach to these things.
cheers,
Chris Maunder
The Code Project | Co-founder
Microsoft C++ MVP
|
|
|
|
|
What's wrong with you man, a couple of regexp and knock it all through sed .
Simples.
speramus in juniperus
|
|
|
|
|
Totally a legit way to do it, but clunky.
I looking for ideas that others have used. Preferably something that's a massive overkill for the problem at hand. Something that would appear on Software Developers Gone Wild or something.
cheers,
Chris Maunder
The Code Project | Co-founder
Microsoft C++ MVP
|
|
|
|
|
I thought the whole idea of Codeproject was that it was about de-ve-lop-ing, not this copy'n'paste bull!
Bring back punched cards, that's what I say!
speramus in juniperus
|
|
|
|
|
I'm sure there's a way to pipe the regex/sed solution trough multiple emacs/vim addons too.
Did you ever see history portrayed as an old man with a wise brow and pulseless heart, waging all things in the balance of reason?
Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful?
--Zachris Topelius
Training a telescope on one’s own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies.
-- Sarah Hoyt
|
|
|
|
|
I'm using T4 templates to generate a number of javascript proxy objects for the json methods on our controlers, but we have to remember to click the transform button whenever we make a change. We're also using a plugin for scss flies instead of LESS, but I haven't seen anything like that for sql.
|
|
|
|
|
T4 is useful... I use it extensively whenever I'm making a proxy layer in .NET. A little reflection to iterate over the classes and methods, pick up attributes to modify the template behavior, and generate one giant file full of partial classes with boilerplate code.
Debugging it is a pain though.
Oh, and unless you install an extension or a pre-build script or something, it doesn't automatically update. Gotta open up the T4 template and Save, and that will re-generate the output file. THEN compile.
|
|
|
|
|
There is a transform all template toolbar button that you can map to the ui. It's not as nice as auto updating but better than finding the file.
|
|
|
|
|
Still, would be better if it re-generated whenever the dependent files changed... Of course, that'd require it to know what the dependent files are.
|
|
|
|
|
Chris Maunder wrote: So I was wondering: has anyone else played with any file templating solutions like this
I have been using code generation for years.
That has included generating basically entire backends and database layers from external languages like C# and java down to schemas and stored procs.
In my experience generating non-CRUD stored procs for multiple database targets is at best difficult and it isn't worth it. Because of differences and complexity one ends up providing a mechanism to insert custom code for different targets. So rather than having X number of different procs that one must manage one then has X number of different fragments, or worse, X * multiplier fragments in a system that one must understand in detail to update.
I have no problem with CRUD proc generation across multiple platforms. But there are multiple frameworks these days that at least provide an alternative to that.
Of course if you are the only one that must maintain the system then the experience and technical challenge is a factor.
|
|
|
|
|
I know - we should just shift to entity framework and be done with it.
cheers,
Chris Maunder
The Code Project | Co-founder
Microsoft C++ MVP
|
|
|
|
|
I've saved a link to this!
|
|
|
|
|
|
GNU m4[^]?
Keep Clam And Proofread
--
√(-1) 23 ∑ π...
And it was delicious.
|
|
|
|
|
Dog[^]
---------------------------------
Obscurum per obscurius.
Ad astra per alas porci.
Quidquid latine dictum sit, altum videtur .
|
|
|
|
|
blocked by the IT police
|
|
|
|
|
Dave, look at my FB Page.
---------------------------------
Obscurum per obscurius.
Ad astra per alas porci.
Quidquid latine dictum sit, altum videtur .
|
|
|
|
|
It is like the canine version of "The Good Life"....
|
|
|
|
|
I think the chicken is aware that something is amiss!
---------------------------------
Obscurum per obscurius.
Ad astra per alas porci.
Quidquid latine dictum sit, altum videtur .
|
|
|
|
|
The chicken has that same worried look as the sheep when Griff enters the field.
speramus in juniperus
|
|
|
|
|
First off, some background:
GNU Libiconv v1.14 has issues when enabling a relocatable library.
I was looking through the makefile, and saw that the relocatable.c file was missing from the sources list, so I added it, ran make, then make install, and it worked! That was somewhat fun to figure out (I hate makefiles).
Keep Clam And Proofread
--
√(-1) 23 ∑ π...
And it was delicious.
|
|
|
|