"conf" directory location hard coded in Play component

Hi!

I tried porting our SBT/Scala/Play 2.4 build to grade, but ran into some problems since we use the SBT project layout (enabled by disablePlugins(PlayLayoutPlugin)).

This means I had to update the source layout:

model {
    components {
        play {
            platform play: '2.4.3', scala: '2.11', java: '1.8'
            injectedRoutesGenerator = true

            sources {
                java {
                    source.srcDir 'src/main/java'
                }
                resources {
                    source.srcDir 'src/main/resources'
                    source.srcDir 'src/main/assets'
                }
                javaScript {
                    source.srcDir 'src/main/assets'
                }
                twirlTemplates {
                    source.srcDir 'src/main/twirl'
                }
                scala {
                    source.srcDir 'src/main/scala'
                }
                routes {
                    source.srcDir 'src/main/resources'
                }
            }
        }
    }
}

Building this seems to work except that the resources and assets are not added to the correct jar files, and running the application will fail.

PlayDistributionPlugin.java reveals that the configuration is hardcoded to the “conf” directory.

Doing ln -s src/main/resources conf works around the issue.

The same issue exists for the assets jar (PlayApplicationPlugin.java) and the assets resources (worked around by ln -s src/main/assets public)

  • While waiting for proper configurability, is there a better work-around?

  • Are there any plans on supporting play with the default SBT project layout as per Anatomy # Default SBT layout?