Scala infrastructure in plugins SDK

 

I am an Scala enthusiast; I must to admit it :) ! It allows me writing clear and concise code having all the advantages of an extremely powerful type system, functional and object paradigms  among another such things.
 
But this is not a blog post introducing Scala benefits (you can see a very quick intro to the language https://github.com/migue/blog-examples/tree/scala-blog-examples/scala-talk) but talking about including it in the Plugins SDK so we can use it to develop our new portlets based on Scala.
 
This is a very quick overview on what you can do with the ongoing work ( https://github.com/migue/liferay-plugins/tree/scala-support-infrastructure). I need to make some minor hacking but I hope to be pushing it to master during this week (if the child allows me to do it). Let's get started:
 
  • You can create a new Scala based portlet by executing the create script: create.sh portlet_name porlet_display scala
  • The previous command line execution will create a basic infrastructure with all the artifacts we need: a build.xml file, all the Scala library needed and a simple portlet class.
  • Using the previous build.xml file we can compile Scala code, Java code, use scalac (the single one compiler and the daemon) and make our deployments. This infrastructure will take care of the mixed compilation process if you are using both Java and Scala as your development languages for your new portlet.

I have some more work to do, like including a command in order to allow updating the Scala libraries with a specific version or generating IDE files in an automatic way. The current version is working fine but I hope to improve during this weekend and push it to master.

Short entry; hopefully I will write a more detailed one with some more news: I am working on building an Scala wrapper on top of the Liferay API . . . so stay tunned!! 

Hope you like it!

 

ブログ
[...] Liferay is Java-based, but you don't have to be a Java expert to use it or create websites with it. In fact, suppose you are a Scala expert? Miguel demonstrates that even Scala fits into the Liferay... [...] Read More
the code is very old, is this reported as a feature in liferay issues? I'd like to see this in the main SDK.

github status: "This branch is 7 commits ahead and 3502 commits behind master".
I did a quick announcement here https://www.liferay.com/web/miguel.pastor/blog/-/blogs/a-quick-update-about-the-scala-support-in-liferay-sdk

We are doing a refactor of the SDK so I haven't pushed it yet but I hope it will be available in the near future.

I will rebase my changes in top of the latest commits of the master branch and update my Github repo