<commit_before>/**
 * Copyright (c) 2013-2014 the original author or authors
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package io.werval.gradle

import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.plugins.JavaPlugin

/**
 * Werval Gradle Plugin.
 *
 * Apply the 'java' plugin on the project if absent.
 * <p>
 * Create {@literal secret}, {@literal start} and {@literal devshell} tasks.
 * <p>
 * Define 'devshell' configuration and 'dev' SourceSet for dev mode classpath enrichment.
 */
class WervalPlugin implements Plugin<Project>
{
    void apply( Project project )
    {
        // Java 8
        project.plugins.apply( JavaPlugin )
        project.sourceCompatibility = '1.8'
        project.targetCompatibility = '1.8'
        project.compileJava*.options*.encoding = 'UTF-8'
        project.compileTestJava*.options*.encoding = 'UTF-8'

        // Extensions
        project.extensions.create( "werval", WervalDependencies, project.dependencies )

        // Repositories
        project.repositories { 
            if( project.hasProperty( 'wervalLocalRepository' ) ) {
                maven { url project.wervalLocalRepository }
            }
            jcenter()
        }

        // Secret Generation Task
        project.task(
            "secret",
            type: SecretTask,
            group:"Werval",
            description: 'Generate a new Application Secret.'
        )

        // Production Mode Task
        project.task(
            "start",
            type: StartTask,
            group: "Werval",
            description: "Start the Application in production mode.",
            dependsOn: project.tasks.getByName( "classes" )
        )

        // DevShell Task
        project.configurations.create( "devshell" )
        project.configurations.devshell {
            description = "Werval DevShell Configuration"
            // visible = false
        }
        project.dependencies {
            devshell group: "io.werval", name: "io.werval.doc", version: BuildVersion.VERSION, transitive: false
        }

        project.sourceSets {<commit_msg>Restore sitemesh deps in gradle plugin devshell configuration, fix #232<commit_after>/**
 * Copyright (c) 2013-2014 the original author or authors
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package io.werval.gradle

import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.plugins.JavaPlugin

/**
 * Werval Gradle Plugin.
 *
 * Apply the 'java' plugin on the project if absent.
 * <p>
 * Create {@literal secret}, {@literal start} and {@literal devshell} tasks.
 * <p>
 * Define 'devshell' configuration and 'dev' SourceSet for dev mode classpath enrichment.
 */
class WervalPlugin implements Plugin<Project>
{
    void apply( Project project )
    {
        // Java 8
        project.plugins.apply( JavaPlugin )
        project.sourceCompatibility = '1.8'
        project.targetCompatibility = '1.8'
        project.compileJava*.options*.encoding = 'UTF-8'
        project.compileTestJava*.options*.encoding = 'UTF-8'

        // Extensions
        project.extensions.create( "werval", WervalDependencies, project.dependencies )

        // Repositories
        project.repositories { 
            if( project.hasProperty( 'wervalLocalRepository' ) ) {
                maven { url project.wervalLocalRepository }
            }
            jcenter()
        }

        // Secret Generation Task
        project.task(
            "secret",
            type: SecretTask,
            group:"Werval",
            description: 'Generate a new Application Secret.'
        )

        // Production Mode Task
        project.task(
            "start",
            type: StartTask,
            group: "Werval",
            description: "Start the Application in production mode.",
            dependsOn: project.tasks.getByName( "classes" )
        )

        // DevShell Task
        project.configurations.create( "devshell" )
        project.configurations.devshell {
            description = "Werval DevShell Configuration"
            // visible = false
        }
        project.dependencies {
            devshell( group: "io.werval", name: "io.werval.doc", version: BuildVersion.VERSION ) {
                exclude module: "io.werval.api"
            }
        }

        project.sourceSets {
{'fraction_non_alphanumeric': 0.09411106969809914, 'fraction_numerical': 0.007640700708162505, 'mean_word_length': 2.308877928483354, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '533953', 'n_tokens_mistral': 1436, 'n_tokens_neox': 1376, 'n_words': 446}