Using both #AutoMatter and #AutoValue in a same project - code-generation

Recently I ran into the situation that I had to use both #AutoMatter and #AutoValue to generate code in a project. However this did not work as code was not generated for one of the class annotated (#Automatter). If this is a compiler plugin, why didn't it work?

Related

Testing code generated by a Swift Package

I am developing a Swift Package that also includes a code generator. Is there a way to test the generated code using XCT? The important part is that tests use the generated code.
I thought I could add a test target and only build it after the code generation step. I can't find a way to add a build step to Swift package, though. Is this possible?
Another "solution" that I've considered is creating a workspace that references a project with generated code and the package itself. Then, I would create two targets and add a code generation build step to the test project. The problem with this idea is that we don't get test coverage and I am not sure how to add Swift Package to a workspace. Is there any tutorial on this?
Thank you for your help!

Play Framework + Intellij: Super slow compilation times

Is there a way to fix the horrible slow compile times of Play and Scala.
It compiles constantly hudrends of java classes.
Has anyone faced this and solved it?
Thanks
If you run your application with sbt-run, or run as play application in paid version of intellij, instead of running NettyServer or ProdServerStart, then play will use multiple class loaders to only recompile modified files instead of all classes.
I removed completely the enhancer plugin, and the compilation times are now normal.
IMO this is a huge issue of the play framework.
I got the idea from this post, however I did not simply disable the plugin and I did not create any getters and setters. I only commented out the plugin locally. When the app is deployed the plugin is there generating the setters and getters.

Include AspectJ support to VS Code

In my current project I'm working with Java, Spring Boot and .aj files. However, the main problem about work with AspectJ is that there are not a lot of IDEs that supports this feature.
Eclipse (and i think that netbeans too) supports the AspectJ language because I've used it in the past. However, I've worked with IntelliJ and Visual Studio Code IDEs during the last years and I don't really want to come back to Eclipse (or Netbeans). :)
Also, I know that the Ultimate Version of IntelliJ has support to AspectJ. The problem is that you must have an IntelliJ license to use it.
https://www.jetbrains.com/help/idea/enabling-aspectj-support-plugins.html
I started to create a new language server for the Visual Studio Code to manage the .aj files. I'm following this guide.
https://code.visualstudio.com/docs/extensions/example-language-server
The .aj files are now correct colored and shows a valid syntax!
However, I'm getting errors in the Java code. Check this schema about the AspectJ description:
As you could see, I have a .java file called Point and I want to have some methods divided in some .aj files. When the project is compiled, I'll have just one Point.class that includes the methods clone(), compareTo(), etc.
Also, another possible use is that if my .java class implements some interface, I'm able to implements the methods in a .aj file.
Problem: I'm not able to see my Java project without errors because the .java files and the .aj files are not "synchronized", so the .java class says that needs to implements some methods although they're defined in the .aj file.
Someone could help me with tips about language server development?
Regards,
I can't help you with VS Code <> AspectJ integration, but I could recommend a work-around with your issue. If my understanding is correct, you get errors because the methods declared through inter-type declarations by your aspects are not visible to your java code.
In that case you might try to create Java 8 interfaces with default methods that declare and implement those methods. I would try to get rid of the aspects altogether and work with just interfaces with default methods, but if - for some reason unknown to me - you really need to use aspects to implement those methods, you can still leave your default methods empty and move the implementation into the aspects. This way you don't need to use inter-type declarations anymore, so VS Code integration might work better.

groovy scripts and classloader - content assist in eclipse - what to do?

Goal:
I want to define groovy classes in .groovy files as part of a package, but without ever needing to compile them. Then, I want to define groovy scripts in the same package, import the class definitions from the nearby .groovy files, and execute the script... all without compilation.
Problem,
This appears to be possible using GroovyClassLoader() (and several people have posted how-tos). However, the problem I have that nobody else seems to reference is that this strategy means that content assist will never be able to identify your classes and methods, and your code will be full of underlines, and receive no error checking.
You might say "Thats just a side effect of using such a dynamic feature, how would eclipse be able to know?", but consider the following:
As I was building my project, I was creating the scripts and the classes in the package just like normal a program. When I add my import statements for my custom classes, Eclipse recognizes everything and content assist is happy. However, despite content assist being satisfied, it hits a snag when I try to execute a script because eclipse returns: unable to resolve class (presumably because it's still only a groovy file, and not compiled to a class file).
So, I looked around and it looks like I have to comment out the import statement, and then use groovyclassloader to parse the groovy file instead. However, this has the negative side effect of breaking content assist.
Question: Are my conclusions above all basically correct?
Suggestion: Is there any known way to have content-assist work along-side with GroovyClassLoader? Maybe some way to tell it to ignore failed imports or something?
It turns out this was a problem with the way I had configured my classpath. Once I had my folder structure consistent with the package structure, eclipse found my class files and was able to import the classes.

How to get Scala imports working in IntelliJ IDEA with the Play framework?

I'm using the Scala plugin for IDEA and normally, it works (almost) perfectly.
However, it seems to have problem with the import statements for the Play framework: I often get the error "Cannot resolve symbol x". Now that doesn't stop the program from working, but it makes autocompletion completely useless.
Example: import org.scalatest.junit._
I already added /opt/play/framework/src and /opt/play/framework/play-1.2.2RC2.jar to classes and sources of my project. (using "Project Structure")
Any ideas on how to solve this? Or is this simply a bug?
(I am using Scala 2.9.0.1, IDEA 10.5 and Scala Plugin 0.4.1084)
Try to add tmp/generated to your sources as well. Eclipse also has this issue, since the Play Framework generate the source files from the templates. See Errors in Eclipse for Scala project generated by Play Framework.