-
Notifications
You must be signed in to change notification settings - Fork 4
How to develop
The project needs some specific settings because it uses automatic source generation. This generation is done by java annotations. This tutorial shows how to enable this source generation.
Using IntelliJ IDEA:
-
Firstly, the annotation processing must be turned on: Settings -> Build, Execution, Deployment -> Compiler -> Annotation Processors. Check the Enable annotation processing checkbox.
-
The Production sources directory shall be src-gen and the Store generated sources relative to shall be Module content root. This is the directory where the generated source files will be located. It may be different but then it will be needed to update the classpath to use that directory.
-
The processors are in the truffle-dsl-processor.jar and truffle-dsl-processor-internal.jar which are included in the /lib directory which shall be in the classpath. Therefore the IntelliJ is able to get the processors automatically when choosing Obtain processors from project classpath radio button.
-
Then it is needed to specify the names of the processors in the Annotation Processors table below. These processors are: com.oracle.truffle.dsl.processor.InstrumentableProcessor com.oracle.truffle.dsl.processor.InstrumentRegistrationProcessor com.oracle.truffle.dsl.processor.interop.InteropDSLProcessor com.oracle.truffle.dsl.processor.LanguageRegistrationProcessor com.oracle.truffle.dsl.processor.TruffleProcessor com.oracle.truffle.dsl.processor.verify.VerifyTruffleProcessor com.oracle.truffle.object.dsl.processor.LayoutProcessor
-
It may be needed to rebuild the project after these changes to generate the sources, however, afterwards, the InetlliJ will automatically update these generated files when needed.