A deep dive into Tapestry Plastic - part 1

End of the year is coming and I’m starting the next year with talk on WJUG about Plastic - code generation tool from Tapestry author - Howard Lewis Ship. It’s definitely time to start preparing. I was impressed by authors talk about the library you may see here - http://www.infoq.com/presentations/Have-Your-Cake-and-Eat-It-Too-Meta-Programming-Java

So let’s start by jumping to the source… and there’s a sad surprise - it’s not that easy to find the source :-( Author said Plastic is separate from the rest of Tapestry 5, but all the links for GitHub repo leads to 404 page. It seems that the idea of an independent library is past.

But there’s hope! On Lewis’ GitHub page there’s a repo named plastic-demos. Fast git clone and you may see it’s a Gradle project with Spock unit tests presenting simple Plastic functions. Trying gradle test would be natural next step, but still no luck there:

Missing dependency, huh? Let’s take a quick search in http://mvnrepository.com/ and there it is, http://mvnrepository.com/artifact/org.apache.tapestry/plastic/5.3.5. I’m changing version in build.gradle to ‘org.apache.tapestry:plastic:5.3.5’ and it worked:

So where do I find the sources? Well, it wasn’t hard to guess, it’s inside Tapestry source package, which actually isn’t that nice, because the promise was, it’s a separate project.

Now that we have the source and some examples we can have some more fun… in the next part.

One thing you can see already is that Howard L. Ship is using all the new, cool stuff to develop (Spock, Gradle), which makes it so much better experience to use the code, than it would be using old mainstream tools like Maven2 or JUnit.