Gradle Frege plugin and frege-java-frege dependency

18 views
Skip to first unread message

gulp21

unread,
Sep 2, 2017, 7:09:33 AM9/2/17
to Frege Programming Language
Hi,

I’m trying to port my Frege projects from using makefiles to gradle,
using the Frege gradle plugin. It works well for pure Frege projects and
mixed Java and Frege projects in which the Frege code depends on the
Java code. But now I have a project where Frege code depends on Java
code and this Java code depends on another Frege file (see [1] for a
minimal example). I couldn’t figure out how to make this work with the
Frege gradle plugin, which always wants to compile the Java code first
(which of course fails because the classes from the Frege code are
missing). Do you have any advice on how to get this working?

Regards
Markus

[1] https://github.com/mabre/gradle_frege_test

signature.asc

Dierk König

unread,
Sep 2, 2017, 10:40:24 AM9/2/17
to frege-program...@googlegroups.com
Hi Markus,

bi-directional dependencies are always a bit difficult with alternative JVM languages but there are two ways to address this:

a) shared interface
The trick is to extract a shared Java interface and compile this in an extra (gradle) project, say "shared".
Then you let your core project depend on "shared". You can even split up your core project into
"java" and "frege" and let either depend on "shared".
Granted, this is a bit of setup work, but it somewhat models the dependencies nicely
and Gradle supports multi-project builds really well.

b) inline Java
You can inline your Java code right inside your Frege module files and they will be compiled together
in the same fashion that the Java compiler resolves bidirectional dependencies between two Java files.

Please let me know if that works for you.

Cheers
Dierk
> --
> You received this message because you are subscribed to the Google Groups "Frege Programming Language" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to frege-programming-l...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

support...@googlemail.com

unread,
Sep 8, 2017, 5:56:09 AM9/8/17
to Frege Programming Language
Hi Dierk,

Inline Java did the trick for me. Thank you.

Regards
Markus
> To unsubscribe from this group and stop receiving emails from it, send an email to frege-programming-language+unsub...@googlegroups.com.

Dierk König

unread,
Sep 8, 2017, 8:29:02 AM9/8/17
to frege-program...@googlegroups.com
cool.

Keep us posted about your progress :-)

cheers
Dierk
> > To unsubscribe from this group and stop receiving emails from it, send an email to frege-programming-l...@googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to the Google Groups "Frege Programming Language" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to frege-programming-l...@googlegroups.com.

Mark Perry

unread,
Sep 10, 2017, 6:46:36 PM9/10/17
to Frege Programming Language


This example of a multi module Gradle Frege build that I put together might help, https://github.com/mperry/frege-gradle-example.  It is probably quite old now though.
Reply all
Reply to author
Forward
0 new messages