Scala support in Gradle-Plugin

35 views
Skip to first unread message

Marc Schlegel

unread,
Mar 14, 2017, 7:26:54 PM3/14/17
to bndtools-users
Hello everyone

I am currently trying to get a Bnd Workspace running with Scala, including a Gradle build [1]. Getting Bndtools working with Scala within Eclipse is one thing (Scala builder must run before Bndtools builder) but I need some way to run the build from Gradle for the CI.
Following this Answer on SO [2], I was able to compile my Scala files by Gradle but right now, they are not packaged in the generated jar. 


Another challenge is the need to maintain dependencies in an additional "gradle.build" file, next to the bnd-file because otherwise scala cannot resolve any dependency.
Is this even something that can be adressed by the gradle-bnd-plugin? I fear that the dependency-issue will be some kind of chicken-egg-problem because the scala-plugin needs the dependecies from the bnd-plugin and the bnd-plugin needs the scala-plugin in some way.

Are you planning to improve the Scala support?

regards
Marc


BJ Hargrave

unread,
Mar 15, 2017, 6:02:55 AM3/15/17
to bndtool...@googlegroups.com
I made a PR [1] against your example to show how to configure scala and bnd for gradle.

However the scala compile files for reasons I have no idea since I am not a scala user.

Caused by: java.lang.IllegalArgumentException: requirement failed: package config
        at scala.reflect.internal.Types$ModuleTypeRef.<init>(Types.scala:1879)


--
You received this message because you are subscribed to the Google Groups "bndtools-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bndtools-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
BJ

BJ Hargrave

unread,
Mar 15, 2017, 6:23:51 AM3/15/17
to bndtool...@googlegroups.com
I fixed the compile error by adding additional jars to the maven repo and the project's -buildpath.
--
BJ

Marc Schlegel

unread,
Mar 15, 2017, 11:18:53 AM3/15/17
to bndtools-users
Awesome. Thank you very much BJ.

Maybe I should write an AppNote for this which could be shared in the Bndtools documentation. Will try to find some time...

BJ Hargrave

unread,
Mar 15, 2017, 11:36:17 AM3/15/17
to bndtool...@googlegroups.com
I was thinking of adding it to the readme for the plugin. 

I think I also did something similar for Kotlin. I have certainly done it for Groovy in the Bnd build. 
Reply all
Reply to author
Forward
0 new messages