<commit_before>
== Gradle Plugin

=== Overview

=== Development mode

[discrete]
==== Build logic

The QiWeb Gradle plugin:

- declare a `devshell` task that depend on the `classes` task.
- declare a `devshell_rebuild` task that depend on the `classes` task too.

When running the `devshell` task it will run `classes` and other dependents tasks and then the QiWeb DevShell, embedded.
The application is now running in development mode.

Once a source code change is detected, the first request received by the application summon a gradle daemon to run
the `devshell_rebuild` task on the application project.

You add dependent tasks to the `devshell` and `devshell_rebuild` that way;

[source]
----
devshell.dependsOn gulp_bower, gulp_dev
devshell_rebuild.dependsOn gulp_dev
----

This example is from an application that use `bower` and `gulp` for client javascript build,
thanks to the `gradle-gulp-plugin`.

Configuring theses tasks in your build allow you to fine tune the work needed to get your app in dev mode and what
should be done when the source has changed.

[discrete]
==== Watch extra files or directories

The `devshell` task has an `extraWatch` property that allow one to add files or directories to watch for changes in
dev mode:

[source]
----
devshell.extraWatch += "path/to/dir"
devshell.extraWatch += [ "path/to/elsewhere", "and/anywhere" ]
----

Thanks to Gradle's incredible incremental build behaviour, handling complex build scenarios is both confy and
productive.

=== Packaging

TIP: If you need RPM or DEB packaging, use the
https://github.com/nebula-plugins/gradle-ospackage-plugin[gradle-ospackage-plugin]
<commit_msg>Documentation for #187 ( #192 )<commit_after>
== Gradle Plugin

=== Overview

=== Development mode

[discrete]
==== Build logic

The QiWeb Gradle plugin:

- declare a `devshell` task that depend on the `classes` task.
- declare a `devshell_rebuild` task that depend on the `classes` task too.

When running the `devshell` task it will run `classes` and other dependents tasks and then the QiWeb DevShell, embedded.
The application is now running in development mode.

Once a source code change is detected, the first request received by the application summon a gradle daemon to run
the `devshell_rebuild` task on the application project.

You add dependent tasks to the `devshell` and `devshell_rebuild` that way;

[source]
----
devshell.dependsOn gulp_bower, gulp_dev
devshell_rebuild.dependsOn gulp_dev
----

This example is from an application that use `bower` and `gulp` for client javascript build,
thanks to the `gradle-gulp-plugin`.

Configuring theses tasks in your build allow you to fine tune the work needed to get your app in dev mode and what
should be done when the source has changed.

[discrete]
==== Watch extra files or directories

The `devshell` task has an `extraWatch` property that allow one to add files or directories to watch for changes in
dev mode:

[source]
----
devshell.extraWatch += "path/to/dir"
devshell.extraWatch += [ "path/to/elsewhere", "and/anywhere" ]
----

Thanks to Gradle's incredible incremental build behaviour, handling complex build scenarios is both confy and
productive.


=== Override config location

["source","groovy"]
----
devshell {
  // Only one of theses three can be set
  configResource = "application-dev.conf"
  configFile = file( "path/to/file.conf" )
  configUrl = new URL( "http://url.to/file.conf" )
}

start {
  // Only one of theses three can be set
  configResource = "application-dev.conf"
  configFile = file( "path/to/file.conf" )
  configUrl = new URL( "http://url.to/file.conf" )
}

// Sample custom start task
task customStart( type: org.qiweb.gradle.StartTask )
{
  configResource = "application-custom.conf"
}
----

=== Packaging

TIP: If you need RPM or DEB packaging, use the
https://github.com/nebula-plugins/gradle-ospackage-plugin[gradle-ospackage-plugin]

{'fraction_non_alphanumeric': 0.09184461023925906, 'fraction_numerical': 0.0015436068947774634, 'mean_word_length': 4.282608695652174, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6647597', 'n_tokens_mistral': 1168, 'n_tokens_neox': 1127, 'n_words': 488}