This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Successfully mixed java and kawa-scheme in a "full" Android app


On Wed, Jul 17, 2013 at 1:38 PM, Marius Kjeldahl <marius@kjeldahl.net> wrote:
> If you've been following my last posts with Per helping me out, you probably
> know by now that I've been trying to get Kawa to build and run together with
> the latest releases from Google, specifically get it to build with a
> "gradle"-based project which is the latest flavour from Google (it's what
> Android Studio uses for build and project configuration).
>

I was following and I'm pretty happy that you finally made it :)

> These at least make it easier to use kawa with an app using the android
> plugin. Essentially you'll do a "./gradlew kawaRelease assembleRelease" (and
> similar for debug). While most people seem to love gradle, I'm not convinced
> yet. While it's probably great for writing a build process from scratch,
> you'll be writing thousand lines of java/groovy code to make it build, it
> certainly does not seem very great as far as modifying existing build
> processes. There are easy improvements to even my simple gradle tasks above
> (like automatically finding the source files), which I haven't gotten around
> to doing yet.

You're right, when you have to hack around it, it can be really a
pain. That's why I think having reusable plugins that can be used
directly by following some conventions is a must. Sad thing, Kawa
plugin for Gradle does not exist ... yet.

>
> Regarding adding kawa support for gradle; My first strategy was to "modify"
> the JavaPlugin task to basically call the kawa compiler instead of the java
> compiler for all *.scm files. While that sounds easy, it's not. First of
> all, the java "plugin" basically has code and abstractions in lots of
> different source locations in Gradle, so it's not like it's easy to figure
> out what you need.
>
> I found another plugin named "Clojuresque" which is a ClojurePlugin for
> building Clojure projects. At least that one has all it's files in one
> place, but it's still a thousand lines of relatively low level code just to
> build (despite inheriting from JavaPlugin...). I ended up using the clojure
> based one and wrote a similar KawaPlugin. When it finally started working,
> imagine how fun it was when I tried to combine my KawaPlugin with the
> Android plugin from when the Android plugin spit out a message saying it's
> not compatible with the JavaPlugin.
>
> After that I basically gave up (correction, I looked at the Android plugin
> source and puked) and settled for simple "make-like" rules in gradle, like
> the ones I showed higher up.

We are currently in the process of moving from an in-house made build
system to a Gradle one. Since we have a fairly decent Kawa code base,
compiling Kawa from Gradle was an important task. We developed a
plugin for Gradle that is compiling Kawa code. This plugin is not yet
ready for prime-time for different reasons (mainly, we use wrapper
around Kawa compiler and are still on version 1.7.90 which is pretty
old, but that is another story).

This plugin follows Gradle conventions for source locations and stuff
like that. I did not do it myself, so I'm not sure if it's based on
the JavaPlugin or not, I will tell you tomorrow.

I think it would be something possible for the company I work for to
release our Kawa plugin on github. For sure, I need to check with my
the management team for he OK. We could then check if we could work
together to integrate what you have done in a single and powerful Kawa
plugin for Gradle :).

I really don't know if my current version would play well in the
context of an Android build, I guess I would need to try to find it
out but that would be a first start that could be improved.

>
> If anybody else will or is trying to go down the same path, hopefully these
> details will make your path a little less painful, and at least demonstrate
> that there is gold at the end of the rainbow.
>

Thanks, those kind of information sharing is always welcome in my opinion.

> With the great work Per has already done, and with more examples and
> demonstrations, I believe there is a good change kawa could become a popular
> language for making or extending android apps.
>

I believe also, Kawa is a nice language and need more exposure in the
JVM language like community.

Regards,
Matt


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]