Play framework. no need to compile

前端 未结 3 1881
野性不改
野性不改 2021-02-09 16:07

I was introduced to the Play framework, and one of the amazing things I found about it is that there is no need to compile the project. You only need to save the edited files an

3条回答
  •  孤独总比滥情好
    2021-02-09 16:25

    When running in DEV mode, Play works by checking the last modified date of the java files, and cross referencing them with the .class files that are generated at run time. If it recognises something has changed, then it recompiles them, at runtime.

    In Play 1.x - the recompilation is done using the eclipse jdt compiler (org.eclipse.jdt.internal.compiler.Compiler). If you want to see the code from Play 1.x, just look at the following class - https://github.com/playframework/play/blob/master/framework/src/play/classloading/ApplicationCompiler.java

    In Play 2.x, it looks as though Play does it by interlinking with the SBT tool. Check this out - https://github.com/playframework/Play20/blob/master/framework/src/play/src/main/scala/play/core/system/ApplicationProvider.scala

提交回复
热议问题