From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18271 invoked by alias); 22 Jul 2013 06:31:52 -0000 Mailing-List: contact kawa-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: kawa-owner@sourceware.org Received: (qmail 18248 invoked by uid 89); 22 Jul 2013 06:31:51 -0000 X-Spam-SWARE-Status: No, score=-0.4 required=5.0 tests=AWL,BAYES_50,FREEMAIL_FROM,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,RDNS_NONE,SPF_PASS autolearn=ham version=3.3.1 Received: from Unknown (HELO mail-we0-f172.google.com) (74.125.82.172) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Mon, 22 Jul 2013 06:31:49 +0000 Received: by mail-we0-f172.google.com with SMTP id t61so646613wes.31 for ; Sun, 21 Jul 2013 23:31:41 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.180.11.146 with SMTP id q18mr17469337wib.50.1374474701146; Sun, 21 Jul 2013 23:31:41 -0700 (PDT) Received: by 10.216.16.66 with HTTP; Sun, 21 Jul 2013 23:31:41 -0700 (PDT) In-Reply-To: <51E6D6AA.2000305@kjeldahl.net> References: <51E6D6AA.2000305@kjeldahl.net> Date: Mon, 22 Jul 2013 06:31:00 -0000 Message-ID: Subject: Re: Successfully mixed java and kawa-scheme in a "full" Android app From: Matthieu Vachon To: "kawa@sourceware.org" Content-Type: text/plain; charset=ISO-8859-1 X-SW-Source: 2013-q3/txt/msg00038.txt.bz2 On Wed, Jul 17, 2013 at 1:38 PM, Marius Kjeldahl 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