Package: org.gradle.play

## [Java] Interface PlayApplicationSpec

- org.gradle.platform.base.ApplicationSpec

- All Superinterfaces:
    PlayPlatformAwareComponentSpec, GeneralComponentSpec, Named, PlatformAwareComponentSpec, ComponentSpec, SourceComponentSpec, VariantComponentSpec, ApplicationSpec

  Definition of a Play Framework software component that is built by Gradle.

- - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `boolean` | `getInjectedRoutesGenerator()` Will an injected router be generated for this application?
    `void` | `platform(Object platformRequirements)` Specifies a PlayPlatform with a given set of requirements that this component should be built be for.
    `void` | `setInjectedRoutesGenerator(boolean injectedRoutesGenerator)` Configures the style of router to use with this application.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `interface PlayPlatformAwareComponentSpec` | `platform`
    `interface PlatformAwareComponentSpec` | `targetPlatform`
    `interface VariantComponentSpec` | `getBinaries`
    `interface ComponentSpec` | `getDisplayName, getProjectPath`
    `interface Named` | `getName`

- - ### Method Detail

    - #### public boolean getInjectedRoutesGenerator()

      Will an injected router be generated for this application?

      Returns:
        false if a static router will be generated for the application, true if an injected router will be generated.

    - #### @Override public void platform(Object platformRequirements)

      Specifies a PlayPlatform with a given set of requirements that this component should be built be for. Can accept a map of play, scala and/or java requirements or a string representation of the desired play platform.

               model {
                    components {
                        play {
                            platform 'play-2.3.9'
                            platform play: '2.3.2'
                            platform play: '2.3.6', scala: '2.10'
                            platform play: '2.3.7', scala: '2.11', java: '1.8'
                        }
                    }
                }

      Parameters:
        `platformRequirements` - Map of Play requirements or the name of an Play platform.

    - #### public void setInjectedRoutesGenerator(boolean injectedRoutesGenerator)

      Configures the style of router to use with this application.

      By default, a static routes generator is used to generate a singleton router. This requires that all the actions that the router invokes on the application's controllers are either Scala singleton objects, or Java static methods.

      In Play 2.4+, a injected routes generator is recommended. This requires that the router declares its dependencies to the application's controllers in its constructor. The controllers methods need to be instance methods.

      Parameters:
        `injectedRoutesGenerator` - false if a static router should be generated (default). true if an injected router should be generated.