Comments (9)
for mixed single targets we need this:
http://www.codecommit.com/blog/scala/joint-compilation-of-scala-and-java-sources
from rules_scala.
any plans for this?
I work with @barlevalon (who opened the issue in bazel) and I'll probably be trying to tackle it in the next few days following the link @johnynek added here.
If there are objections or tips I'd love to hear them
from rules_scala.
I'm happy to review and merge code here, but I really don't need joint scala/java targets.
(I find that scalac by itself is slow enough that I really try to keep targets very small, that said, old projects might be easier to build with this if we have this capability).
from rules_scala.
Awesome, thanks!
For us it's really mandatory since our codebase has really evolved side by
side and many of our core projects still contain Java "pockets".
Any tips?
My current direction is to add a joint_scala_java method similar to
scala_library which will be similar to the existing scala_library but will
run scalac and javac like in the article above.
Does that sound good? If so I'll drill down.
On יום ב׳, 23 במאי 2016 at 7:18 P. Oscar Boykin [email protected]
wrote:
I'm happy to review and merge code here, but I really don't need joint
scala/java targets.(I find that scalac by itself is slow enough that I really try to keep
targets very small, that said, old projects might be easier to build with
this if we have this capability).—
You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#26 (comment)
from rules_scala.
I think ideally, we would just use scala_library
and scala_binary
and use a filetype filter to select the .java
and .scala
sources. Then the work flow is identical except that we also accept some java files. I would error if there is not at least one .scala
file in the sources, however.
As a test, you might first make a totally separate rule as you suggest, but my guess is there will be a lot of duplication.
from rules_scala.
👍🏽
On יום ב׳, 23 במאי 2016 at 20:39 P. Oscar Boykin [email protected]
wrote:
I think ideally, we would just use scala_library and scala_binary and use
a filetype filter to select the .java and .scala sources. Then the work
flow is identical except that we also accept some java files. I would error
if there is not at least one .scala file in the sources, however.As a test, you might first make a totally separate rule as you suggest,
but my guess is there will be a lot of duplication.—
You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#26 (comment)
from rules_scala.
@johnynek I've started fiddling around and indeed got the scala compiler to compile with very small changes like you suggested.
I'm a bit stuck on how to invoke the java compiler so that the resulting jar will contain all the needed .class files.
I've asked in bazel-discuss but I'll use this platform also if that's ok to ask you: It seems to me that I need to run the javac in _compile
after scalac
runs but I don't know how to invoke multiple actions in the same rule. Any pointers? Thanks!
from rules_scala.
update: brian silverman helped me in discuss by pointing me to macros.
Current direction (which I don't really like) is to have a macro which will call:
scala_library(java+scala) and then scala_export_to_java and then native.java_library(java)
Problem is I'm getting syntax error at 'scala_export_to_java': expected newline.
and I have no idea how to resolve it. I've tried fiddling with the line endings and the indentation but no dice.
from rules_scala.
I think this issue is closed now. Please reopen if the current solution has issues.
from rules_scala.
Related Issues (20)
- Upgrade CI tests to use Bazel 6 HOT 2
- rules_scala cause IJ plugin failures with Bazel@HEAD
- Support for specifying test classes and/or test cases when using junit tests HOT 4
- warning: [path] bad path element
- [Scala 2.13.12] Issue with scala.tools.nsc.reporters.Reporter when compiling
- FYI - Discussion for SIP-51: drop 2.13 library forwards binary compatibility
- rules_scala support for JDK 21 HOT 42
- Add add_opens and add_exports support HOT 1
- Scalafmt fails with Build without the bytes HOT 20
- Support Scala 3.3.1
- SemanticdbInfo.plugin_jar should be File not string HOT 2
- coverage creates the offline.jar into same directory for tests with different directories
- Bazel 7 - scala_proto_aspect rule must declare '@@bazel_tools//tools/jdk:toolchain_type' toolchain in order to use java_common HOT 1
- Can't run a bazel executable within bazel on Windows HOT 10
- javacopts order differs from java_library
- strict_deps_mode = error complains about dependencies that aren't referenced HOT 3
- use newer version of scalafmt
- How to set JVM version? rules_scala keeps insisting on using Java 11 HOT 1
- Unreadable test result HOT 2
- test_scala_proto_server test is flaky on MacOS CI
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rules_scala.