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]

Making friends; Android simplified view construction with the kawa runtime (kawart.jar instead of kawa.jar)


As I've mentioned before, the example on the Kawa site for "Android simplified view" construction does NOT work out of the box when using the "kawart" jar file (Kawa "runtime").

As an experiment I decided to figure out what it would take to get it working, and what the net benefit would be to the result jar/apk file.

Mission accomplished. The net benefit wasn't big; after optimization (Proguard) the apk size went from 189kb to 185kb, just under 4k.

Here's what I had to do to get it working.

1. Modify the classes-to-skip-for-runtime as follows (patch style):

Index: classes-to-skip-for-runtime
===================================================================
--- classes-to-skip-for-runtime (revision 7525)
+++ classes-to-skip-for-runtime (working copy)
@@ -54,7 +54,6 @@
 gnu/expr/KawaCompiledScript.class
 gnu/expr/KawaScriptBindings.class
 gnu/expr/LangExp.class
-gnu/expr/LetExp.class
 gnu/expr/LitTable.class
 gnu/expr/ObjectExp.class
 gnu/expr/ProcInitializer.class
@@ -104,20 +103,9 @@
 kawa/lang/Lambda.class
 kawa/lang/ListPat.class
 kawa/lang/ListRepeatPat.class
-kawa/lang/Macro.class
 kawa/lang/PairPat.class
-kawa/lang/Pattern.class
-kawa/lang/Quote.class
 kawa/lang/CompileFile.class
 kawa/lang/PatternScope.class
-kawa/lang/Syntax.class
-kawa/lang/SyntaxForm.class
-kawa/lang/SyntaxForms.*.class
-kawa/lang/SyntaxPattern.class
-kawa/lang/SyntaxRule.class
-kawa/lang/SyntaxRules.class
-kawa/lang/SyntaxTemplate.class
-kawa/lang/TemplateScope.class
 kawa/lang/VarListPat.class
 kawa/lib/misc_syntax.*.class
 kawa/lib/prim_syntax.*.class
@@ -152,11 +140,6 @@
 kawa/standard/SchemeCompilation.class

2. Add the following to the proguard configuration:

-dontwarn gnu.**
-dontwarn kawa.**

-keep class gnu.expr.Language
-keep class gnu.mapping.Location
-keep class gnu.mapping.Symbol
-keep class gnu.mapping.Procedure
-keep class gnu.mapping.Environment
-keep class gnu.mapping.CallContext
-keep class gnu.mapping.Values
-keep class gnu.lists.LList
-keep class kawa.lang.Pattern
-keep class kawa.lang.SyntaxPattern
-keep class kawa.lang.TemplateScope

I am not sure what the real idea with the kawa runtime really is, but if the stuff that the "android simplified view" construction is supposed to work with the kawa runtime (kawart), I propose that this gets fixed so that it works.

A final word; I figured this out by a lot of trial and error, using the new build system I have running. As such, I can not explain why these changes should or should not go in; I just wanted to share how I got it working in case it is important.

At least from the point of view of shrinkage, I do not believe the 4k is worth anything, so an alternative "fix" to make sure the android samples always work with kawa is to state that you need to use the "full" kawa jar file, not the kawa runtime file (kawart).

Thanks,

Marius Kjeldahl


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