Posted by Jake on Sep 20, 2013 in Gradle, Java, OSGi, Programming
I’ve over the last year or so really started to switch my focus from JEE based architecture more toward OSGi based architecture as the deployment model and service modularity of OSGi fits with my recent service layer designs. That, however, is a topic for another day.
Now if you know nothing about OSGi that’s ok. For the purposes of this post just understand that a service jar’s dependencies are not bundled with it like in the world of JEE. The dependencies must already exist in the OSGi runtime and are then shared with whatever other jars need them.
As it is in the world of Java, most jars have tons of external dependencies. That being said, each one of those dependencies (and their transitive dependencies) will need deployed to our OSGi runtime for our service to function properly – or at all. I could have Gradle list out all the dependencies used by the service and then manually deploy them – but as you can imagine that would be tedious and fraught with errors and omissions. I simply won’t do that (I hate doing anything manually more than once). Suffice it to say that I need an automated means of deploying my services into a OSGi runtime, which is in this case Karaf.
Karaf has this notion of a feature – which is basically a listing of bundles (and other features) to deploy in order to fulfill some product’s dependencies – which sounds exactly like something I need to do to solve my problem. The issue is that it’s a verbose XML file, and I don’t won’t to have to do a bunch of text manipulation of Gradle’s dependency output in order to generate it. No, what I need is a plugin that interacts with the project build that will automatically do this for me – no muss, no fuss.
I immediately – being a Gradle newb – started scouring the doc’s and API’s of Gradle and determined that I could in fact, using Gradle’s API’s, get a concise list of the resolved runtime dependencies of my project, manipulate them, and generate a proper feature file for deployment into the OSGi runtime that would satisfy my project’s requirements.
This post serves to outline a little of the background of my issue and a proposed solution. The next couple will cover:
- What is a feature file?
- Gradle plugin creation
- The final solution
I would imagine it will take at least two follow-up posts – so stick around, it’s kind of cool
Posted by Jake on Mar 30, 2013 in Emacs Lisp, Lisp, Programming
Ok, this post should wrap up the series – finally. Sorry it’s taken me a while, but got caught up in life for a bit…
To summarize what we’ve covered so far, I figured out how to get a iCal file imported into Emacs calendaring system, remove duplicates, and do a little post-processing in order to get it looking the way I wanted.
Up to this point, it’s all been manual calls with
eval-region and that just won’t cut it! We need an Emacsian way of both a) Automatically running this code on start up (which the provided functions can already handle, and b) Being able to manually re-execute at any time via Emacsian means.
The running on start up, as I’ve said, is already handled via normal elisp code execution. We really just need to enable that same functionality through manual Emacs interaction.
Looking through documentation and many blog posts I discovered how to interact with the Emacs system – and it’s actually pretty simple. You only have to do a couple of things, actually:
defun a standard lisp method.
- Include the
interactive form (of which there are varying arguments it takes based on the required functionality.
- From within this form make calls out to the forms that we already created for importing an iCal
Posted by Jake on Mar 28, 2013 in Programming
Sorry folks, but apparently one of the images that I had linked out to in a post – if clicked – would direct you to a malware page…
Luckily, Chrome alerted me to it and I’ve taken care of it.
I guess I need to be even more careful with my content!
Again, my apologies.
Posted by Jake on Mar 15, 2013 in Programming
I dropped a link to the post on my programming history on Facebook and got an interesting comment from one of my lifelong buddies – none other than Digger Waggle:
I learned 6502 assembly when I was around 14 . Never really learned C or C++ or any of the higher level scripting languages(though I know how to read them like I can read a French or Spanish label on the back of the shampoo bottle.) I’m still of the strange mindset that the only way to really program is ASM.
I’ve often thought about the subject of this post, and Digger’s comment just brought it to the forefront of my mind.. Are Lower Level Languages Better?
My definitive answer is: Um, it depends? But more often than not, the higher level language will win out.
“Why”, you ask? Let’s start out with an abbreviated and paraphrased computer history lesson… On second thought, check out this article and then come on back for my explanation. I’ll wait here.
Ok – back? Did you get all that? Good. Read on…
Posted by Jake on Mar 15, 2013 in Programming
I’m an old man – I’ve just broken through the 40 year barrier – and I’ve been coding a long time. By my guesstimation, about 30 years or so – starting with a Basic cartridge on my IBM PCjr.
It was my first real machine, and my mom paid a king’s ransom for it at the time. It was very upsetting to her when I took it all apart to explore the guts (I’ve always been a take-it-apart kinda guy. I could take apart anything. Remember real metal indestructible Tonka trucks – yeah, I took them apart, too). Luckily, I got it all back together and working to avoid Armageddon, but I digress.
Back to Basic programming on that behemoth… I knew nothing about programming back then, but I was always curious as to how this machine did things. Being the inquisitive person that I am – I researched. There were no interwebs back then, no Google, no BBSs – I had no other recourse but to RTFM that came in the box – which was good enough to get me going. The light went on, and I had the perfect project in mind to practice my new skills!
Some background on my selected project. I, like most 10 yr old boys at the time, really dug AD&D. You know – the Dungeons and Dragons role-playing game series (my mom loathed it, but that’s another story in its own right). AD&D was great fun, the only problem was that you really couldn’t play it alone – you needed a player and a Dungeon Master, at the very least. Not only that, you kinda needed a dungeon or something similar in which to adventure. The gathering of folks to play, as you can imagine, wasn’t always easy. But I was in luck! The Dungeon Master’s Guide had in its appendix a series of random dungeon generation tables! Awesome stuff! You roll a D20 die and based on the result you could get the room size, layout, creatures, treasures, etc.