<commit_before># gradle-animalsniffer-plugin
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](http://www.opensource.org/licenses/MIT)
[![Build Status](https://img.shields.io/travis/xvik/gradle-animalsniffer-plugin.svg)](https://travis-ci.org/xvik/gradle-animalsniffer-plugin)
[![Appveyor build status](https://ci.appveyor.com/api/projects/status/github/xvik/gradle-animalsniffer-plugin?svg=true)](https://ci.appveyor.com/project/xvik/gradle-animalsniffer-plugin)
[![codecov](https://codecov.io/gh/xvik/gradle-animalsniffer-plugin/branch/master/graph/badge.svg)](https://codecov.io/gh/xvik/gradle-animalsniffer-plugin)

### About

Gradle [AnimalSniffer](http://www.mojohaus.org/animal-sniffer/) plugin for Java or Groovy projects.
AnimalSniffer is used to check compatibility with lower Java versions (when compiling with a newer Java version) or Android (SDK version).

It is implemented the same way as core Gradle quality plugins (Checkstyle, PMD etc):
A task is registered for each source set (animalsnifferMain, animalsnifferTest) and attached to the `check` task.

Advanced features:
* [Signature build task](https://github.com/xvik/gradle-animalsniffer-plugin/wiki/Buid-project-signature)
* [Check task classpath caching](https://github.com/xvik/gradle-animalsniffer-plugin/wiki/Check-task-performance) to speed-up subsequent checks (useful when check runs often without clean)
* [Merging check signatures](https://github.com/xvik/gradle-animalsniffer-plugin/wiki/Library-signatures) (when small 3rd party lib signatures are used)
* [Viewing signature content task](https://github.com/xvik/gradle-animalsniffer-plugin/wiki/View-signature-content)

#### Applicability

If you're using JDK 9 or above then you can use the [--release](https://docs.oracle.com/en/java/javase/11/tools/javac.html#GUID-AEEC9F07-CB49-4E96-8BC7-BCC2C7F725C9)
flag instead of the plugin:

```groovy
compileJava {
  options.compilerArgs.addAll(['--release', '7'])
}
```    

Direct `release` option support [available in gradle 6.6](https://docs.gradle.org/6.6/release-notes.html#javacompile-release)
([feature discussion](https://github.com/gradle/gradle/issues/2510)).

The plugin could still be useful:

* For Android projects to check API compatibility (because Android API signatures are published).
* To check strong compatibility with some library: you'll need to generate signatures for this library and
will be able to use them to check project compatibility (on API level, ofc) with older library versions.
  
##### Summary

* Configuration extensions: 
    - `animalsniffer` - check configuration
    - `animalsnifferSignature` - signature [build configuration](https://github.com/xvik/gradle-animalsniffer-plugin/wiki/Buid-project-signature) (optional)
* Tasks:
    - `check[Main]` - check source set task 
    - `animalsnifferSignature` - build signature (active when `animalsnifferSignature` configuration declared)
    - `type:BuildSignatureTask` - custom signature build task may be used to [merge signatures](https://github.com/xvik/gradle-animalsniffer-plugin/wiki/Library-signatures)
    - `type:SignatureInfoTask` - view signature ["contents"](https://github.com/xvik/gradle-animalsniffer-plugin/wiki/View-signature-content)  
* Dependencies configuration: `signature` - signatures for check    

### Setup

[![JCenter](https://img.shields.io/bintray/v/vyarus/xvik/gradle-animalsniffer-plugin.svg?label=jcenter)](https://bintray.com/vyarus/xvik/gradle-animalsniffer-plugin/_latestVersion)
[![Maven Central](https://img.shields.io/maven-central/v/ru.vyarus/gradle-animalsniffer-plugin.svg)](https://maven-badges.herokuapp.com/maven-central/ru.vyarus/gradle-animalsniffer-plugin)
[![Gradle Plugin Portal](https://img.shields.io/maven-metadata/v/https/plugins.gradle.org/m2/ru/vyarus/animalsniffer/ru.vyarus.animalsniffer.gradle.plugin/maven-metadata.xml.svg?colorB=007ec6&label=plugins%20portal)](https://plugins.gradle.org/plugin/ru.vyarus.animalsniffer)


```groovy
buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'ru.vyarus:gradle-animalsniffer-plugin:1.5.3'
    }
}
apply plugin: 'ru.vyarus.animalsniffer'
```

OR 
<commit_msg>update to travis com, remove jcenter badge<commit_after># gradle-animalsniffer-plugin
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](http://www.opensource.org/licenses/MIT)
[![Build Status](https://travis-ci.com/xvik/gradle-animalsniffer-plugin.svg?branch=master)](https://travis-ci.com/xvik/gradle-animalsniffer-plugin)
[![Appveyor build status](https://ci.appveyor.com/api/projects/status/github/xvik/gradle-animalsniffer-plugin?svg=true)](https://ci.appveyor.com/project/xvik/gradle-animalsniffer-plugin)
[![codecov](https://codecov.io/gh/xvik/gradle-animalsniffer-plugin/branch/master/graph/badge.svg)](https://codecov.io/gh/xvik/gradle-animalsniffer-plugin)

### About

Gradle [AnimalSniffer](http://www.mojohaus.org/animal-sniffer/) plugin for Java or Groovy projects.
AnimalSniffer is used to check compatibility with lower Java versions (when compiling with a newer Java version) or Android (SDK version).

It is implemented the same way as core Gradle quality plugins (Checkstyle, PMD etc):
A task is registered for each source set (animalsnifferMain, animalsnifferTest) and attached to the `check` task.

Advanced features:
* [Signature build task](https://github.com/xvik/gradle-animalsniffer-plugin/wiki/Buid-project-signature)
* [Check task classpath caching](https://github.com/xvik/gradle-animalsniffer-plugin/wiki/Check-task-performance) to speed-up subsequent checks (useful when check runs often without clean)
* [Merging check signatures](https://github.com/xvik/gradle-animalsniffer-plugin/wiki/Library-signatures) (when small 3rd party lib signatures are used)
* [Viewing signature content task](https://github.com/xvik/gradle-animalsniffer-plugin/wiki/View-signature-content)

#### Applicability

If you're using JDK 9 or above then you can use the [--release](https://docs.oracle.com/en/java/javase/11/tools/javac.html#GUID-AEEC9F07-CB49-4E96-8BC7-BCC2C7F725C9)
flag instead of the plugin:

```groovy
compileJava {
  options.compilerArgs.addAll(['--release', '7'])
}
```    

Direct `release` option support [available in gradle 6.6](https://docs.gradle.org/6.6/release-notes.html#javacompile-release)
([feature discussion](https://github.com/gradle/gradle/issues/2510)).

The plugin could still be useful:

* For Android projects to check API compatibility (because Android API signatures are published).
* To check strong compatibility with some library: you'll need to generate signatures for this library and
will be able to use them to check project compatibility (on API level, ofc) with older library versions.
  
##### Summary

* Configuration extensions: 
    - `animalsniffer` - check configuration
    - `animalsnifferSignature` - signature [build configuration](https://github.com/xvik/gradle-animalsniffer-plugin/wiki/Buid-project-signature) (optional)
* Tasks:
    - `check[Main]` - check source set task 
    - `animalsnifferSignature` - build signature (active when `animalsnifferSignature` configuration declared)
    - `type:BuildSignatureTask` - custom signature build task may be used to [merge signatures](https://github.com/xvik/gradle-animalsniffer-plugin/wiki/Library-signatures)
    - `type:SignatureInfoTask` - view signature ["contents"](https://github.com/xvik/gradle-animalsniffer-plugin/wiki/View-signature-content)  
* Dependencies configuration: `signature` - signatures for check    

### Setup

[![Maven Central](https://img.shields.io/maven-central/v/ru.vyarus/gradle-animalsniffer-plugin.svg)](https://maven-badges.herokuapp.com/maven-central/ru.vyarus/gradle-animalsniffer-plugin)
[![Gradle Plugin Portal](https://img.shields.io/maven-metadata/v/https/plugins.gradle.org/m2/ru/vyarus/animalsniffer/ru.vyarus.animalsniffer.gradle.plugin/maven-metadata.xml.svg?colorB=007ec6&label=plugins%20portal)](https://plugins.gradle.org/plugin/ru.vyarus.animalsniffer)


```groovy
buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'ru.vyarus:gradle-animalsniffer-plugin:1.5.3'
    }
}
apply plugin: 'ru.vyarus.animalsniffer'
```

OR 

{'fraction_non_alphanumeric': 0.13540402814850763, 'fraction_numerical': 0.00946372239747634, 'mean_word_length': 5.09689349112426, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 44, 'lorem ipsum': 0, 'www.': 4, 'xml': 2}, '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': '1930360', 'n_tokens_mistral': 2760, 'n_tokens_neox': 2514, 'n_words': 513}