Does Bazel work with Grails? - grails

Bazel is a multi-language build tool from Google that acts as a replacement for things like Maven, Gradle, Make, etc. There are articles written on how to migrate from Gradle to Bazel, for instance. But I wonder if this tool works with Grails.
Grails is a web app framework that uses Gradle, but from what I've seen it's a bit more than that. For lack of a better term, Grails itself acts as a "wrapper" for common tasks such as building an app as a WAR or JAR file, running the app locally with different profiles, or scaffolding new files and features. Popular IDEs such as IntelliJ have Grails plugins available to run these Grails commands. So it seems to me like it's perhaps tightly coupled to the Gradle build script that backs it.
It also seems to me that just because Bazel says it supports Gradle projects doesn't necessarily imply that it supports Grails projects, because of all these reasons regarding Grails being more than just Gradle. But I wanted to ask the community if my assumptions are true, or if, in fact, people are already using Bazel as a substitute for Gradle inside Grails projects. Can it be done?

Bazel could in theory be used to build grails projects as it is fundamentally agnostic to the type of thing being built. That said, grails probably works well with gradle out of the box and you'd have to re-implement a number of things yourself again and probably is not worth the effort. If you are a large shop and have multiple other languages that you need to support however, it may be worth investing in the effort.
https://github.com/pubref/rules_maven supports using a gradle file to determine transitive maven dependencies if you want to investigate further.

Related

Why is the Grails-Gradle plugin necessary?

I am building my first Grails app and would like the build to be managed by Gradle. I see that there is a Grails-Gradle plugin and many online searches indicate that it is not possible to build a Grails app using Gradle without this plugin.
My question is: why? Why (specifically) is this plugin necessary in order for Gradle to be able to build a Grails app? What functionality does this plugin provide that is otherwise missing?
I don't know why you think it's impossible to build a Grails app without the plugin. It's possible to issue commands to the grails shell from Gradle without the plugin, but it's not very clean.
That's what this plugin does. It cleans up that process, and makes it much Groovier with a DSL. It also makes your Gradle script more portable to other projects and persons.
If you browse the source code you will see all the inner workings of the plugin and realize what it's setting up in your Gradle script. What it offers is a lot of access to Grails in a very standard and portable manner.

Makefiles in iOS build using jenkins

I'm new to makefiles and jenkins.Is there any guide on how to write makefile to run build and the unit test together using jenkins.?
You can definitely use Makefiles to build and run both your application/library and tests.
Here is a good guide to Makefiles:
http://mrbook.org/tutorials/make/
It should help you with writing a simple makefile. For more information, Google is your friend.
Another good guide is here:
http://www.cs.swarthmore.edu/~newhall/unixhelp/howto_makefiles.html
Remember, jenkins and makefiles are completely unrelated. You can use Jenkins with makefiles, and use makefiles without jenkins. One is a continuous integration system, the other just another way of building your software.
You can go ahead and use Xserver as suggested in the other post, but Jenkins has advantages that many other systems don't: it is extensible using a whole host of plugins, has a large user and developer community and is used for multiple types and styles of projects in various languages. While your project is purely for iOS, there are other things in Jenkins you could take advantage of from the available plugins list.
There is an XCode plugin:
https://wiki.jenkins-ci.org/display/JENKINS/Xcode+Plugin
Maybe this helps too:
http://programming.oreilly.com/2013/04/upward-mobility-automating-ios-builds-with-jenkins.html
But maybe you are better off using Xserver if you try to do continuos integration:
https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/xcode_guide-continuous_integration/200-Adopting_a_Continuous_Integration_Workflow/adopt_continuous_integration.html

Grails / IntelliJ setup with multiple modules

I am currently defining the project structure for a project that I am working on. The project is a simple SOA implementation and as such has a grails app and a number of different services.
I wanted to package these services into separate modules (jars) so that they can easily be deployed separately and there is no risk of cost-contamination of classes.
The project structure and dependancies could be visualised as:
Grails App (war)
|__ Service Gateway (jar)
|__Service A (jar)
|__Service B (jar)
Whilst these services will eventually be deployed seperately, for ease of local development I want to package them into a single grails app until such time as it is necessary to break them apart.
My ultimate goal was to be able to develop these services in the same way I would a simple grails app in that I would be able to change any class (within any of the modules) on the fly and have it picked up.
I am struggling though to see the best way in IntelliJ to represent this structure.
I had created seperate modules for each of the above and added the dependancies between them, but obviously grails has no idea of this at runtime.
I have read about and found the following possible solutions, all of which currently feel a bit unsatisfactory as would require a jar to be built meaning that classes cannot be reloaded on the fly.
Install the modules into the local maven repository and reference this in the grails build dependancies.
Drop the built jars into the lib directory.
Add them as grails plugins (seems a little heavy handed as they won't require grails functionality).
Find some other way of including the output directories for these modules on the grails classpath (not sure of the cleanest way to do this).
Thanks!
In the end, I went with a multi module Maven build. The key to the on the fly code deployment is using JRebel to monitor the output directories and reload the classes when they change.

Gradle vs. Gant

I'm working on a Linux/Apache/MySQL/Grails application and have the choice of build tools. I'm looking at Gradle or Gant. They look very similar to me, so I'm not sure what differentiates them.
What are the major differences between Gradle and Gant that would make me pick one over the other?
The main difference is that Gant is a build tool, while Gradle is a project management tool (from the dev/ops standpoint).
So Gradle, compared to Gant, comes "battery included", because it allows you to easily use plugins, manage dependencies, has a complete, hookable, lifecycle, etc...
It is a bit like comparing Ant and Maven, stricly looking on the Java side.
The major reasons you would likely pick Gradle over Gant:
The functionality of Gant is a subset of Gradle. (basically a groovy wrapper around ANT)
Gant is built with Gradle
Beyond that Gradle has a plugin architecture, is DSL based, integrates with Maven and Ivy and has true incremental builds. Gant was a valuable innovation in its time, the lessons of which are in Gradle.
Grails already comes with a build system included, so you don't need to do anything. At the moment it is based on Gant scripts, but a switch to Gradle is on the roadmap for Grails 2.0.

How to assemble a multi-project ant build system

At my new gig, they use Ant and cannot be persuaded to move to Maven.
I've looked everywhere for a decent example of how a multi-project ant build system should be assembled. The apache site falls short. I'm looking specifically for best practices to:
Automatically build local projects that are dependencies of a project
Share artifacts from project to their dependents
Export a project's dependencies and generated artifacts (jars) to be inherited by dependent projects
Share third-party dependencies between projects
I'm sure I can do all this without using Ivy - what did people do before Ivy? I really don't want to have to set up a corporate repository or rely on external repositories - the engineers here are really against that and have all their third-party jars checked into src control.
Can anyone point me at a good open source example of a multi-project ant build?
I don't have too much hands on experience with building large numbers of dependent projects with Ant, but this tutorial looks like it will do what you need without any additional tools.

Resources