-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kotlin support #356
Kotlin support #356
Conversation
Problem is, Xtend sources do not see the Kotlin classes. I assume the Xtend actually integrates a Java compiler and can compile mixed codebases of Java+Xtend. The Kotlin compiler does the same. But mixing both introduces a circular dependency.
This reverts commit d279963.
We can rewrite it to kotlin automatically later
We need to port the C++ generator for that to work
Kotlin extensions are much more ergonomic.
This reverts commit 619e44c.
Where do they come from? why do I need to do this?
This reverts commit d9699f9.
6f34d41
to
0ef09e6
Compare
This makes it easier to debug LFC when you build the project with Gradle, including from within Intellij. Use with gradle :org.lflang:runLfc --args '-c example/C/src/Smokers.lf'
@@ -81,3 +81,13 @@ task generateStandaloneCompiler() { | |||
} | |||
|
|||
generateStandaloneCompiler.finalizedBy shadowJar | |||
|
|||
task runLfc(type: JavaExec) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting. Do you know that the lfc
script is capable of something similar? If you run lfc -r
, it rebuilds itself via gradle before running.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah ok I didn't know. I added the gradle task to be able to run & debug it from intellij, I'm not sure it would be possible with a bash script
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be safe to merge this now!
Since this MR does not include any Kotlin files that are actually used, no one should notice a difference. Mostly, this MR changes configurations so that Kotlin files can be compiled in Gradle, Maven and (only in theory...) in Eclipse.
When merging this, we should notify everyone to do a fresh oomph install. I would also recommend to use a fresh git clone for this. This is because we removed several xtend files, but heir generated artifacts are not under version control. If the xtend-gen artifacts are not deleted manually (or by using a fresh clone), there will likely be build errors due to duplicated class definitions. This is also important to know when switching between branches.
While testing the new oomph setup, I noticed to issues. First, messages like "Kotlin Analysis" has encountered a problem tend to appear sometimes. Second, my install always results in a state where there are errors shown for org.lflang.web
. However, triggering recompilation of the files or cleaning this project removes the error messages.
This adds support for writing code in Kotlin. The output language of Xtext is now Java, not Xtend. The gradle and maven builds are updated to make the kotlin compiler run. They're also patched to work around Xtext regenerating Java files. Namely there's a short list of those files here and here
The build process now runs like so:
This means
Many files are ported from Xtend to Kotlin or Java. Note that #345 is built on these changes.
TODO
.target
file either.. @a-sr could you take a look?closes #337