<commit_before>= Gipsy
:author: <NAME>
:version: 0.4.1
:project-name: gipsy

image::media/gipsy-logo.png[]

image:http://img.shields.io/travis/aalmiray/{project-name}/master.svg["Build Status", link="https://travis-ci.org/aalmiray/{project-name}"]
image:http://img.shields.io/coveralls/aalmiray/{project-name}/master.svg["Coverage Status", link="https://coveralls.io/r/aalmiray/{project-name}"]
image:http://img.shields.io/:semver-{version}-blue.svg["Semantic Versioning", link="http://semver.org"]
image:http://img.shields.io/badge/license-ASF2-blue.svg["Apache License 2", link="http://www.apache.org/licenses/LICENSE-2.0.txt"]
image:http://img.shields.io/badge/download-latest-bb00bb.svg[link="https://bintray.com/aalmiray/kordamp/{project-name}/_latestVersion"]

Groovy version of https://github.com/aalmiray/jipsy[Jipsy], a configurable AST Transformation to simplify the use of
the Service Provider Interface.

== Introduction

Gipsy delivers the same functionality that https://github.com/aalmiray/jipsy[Jipsy] does but uses Groovy's AST Transformations
instead of JDK6' Annotation Processor.

As explained at the http://docs.oracle.com/javase/6/docs/api/java/util/ServiceLoader.html[service loader documentation],
services must follow certain rules in order to be considered as such; they also must be registered using an standard location
based on a naming convention. The following rules apply to classes that may be considered services

. The class must implement at least one target interface (the service interface).
. The class must provide a no-args constructor.
. The class must be public.
. The class name should be added to a file named `META-INF/services/<target_interface_name>`

This library provides a mechanism for enforcing those rules by simply adding an annotation on each service implementation, for
example say there exists the following `Calculator` service interface

[source,groovy]
----
package com.acme

interface Calculator {
    double add(double a, double b)
}
----

A basic implementation of such service may be as follows

[source,groovy]
----
package com.acme

@org.kordamp.jipsy.ServiceProviderFor(Calculator)
class BasicCalculator implements Calculator {
    double add(double a, double b) { a + b }
}
----

Notice that Gipsy reuses the same annotations from Jipsy. Compile your code. If you look closely at your
project's output you'll see a file named `META-INF/services/com.acme.Calculator` whose contents should look similar to

[source]
[subs="verbatim,attributes"]
----
# Generated by org.kordamp.gipsy.transform.service.ServiceProviderProcessor ({version})
# Wed, 25 Dec 2013 22:28:50 +0100
com.acme.BasicCalculator
----

Et voilà! There are no additional sources to be touched nor files to be created; Jipsy will take care of the boiler plate.

== Installing

Gipsy requires the following dependencies

 - jipsy-{version}
 - groovy-all-2.2.2

Gipsy can be downloaded directly from https://bintray.com/aalmiray/kordamp/gipsy[Bintray] or configure it via Maven or Gradle.

.Maven
[subs="verbatim,attributes"]
----
<dependency>
  <groupId>org.kordamp.gipsy</groupId>
  <artifactId>gipsy</artifactId>
  <version>{version}</version>
  <scope>provided</scope>
</dependency>
----

.Gradle
[subs="verbatim,attributes"]
----
configurations {
    compileOnly
}
dependencies {
    compileOnly "org.kordamp.gipsy:gipsy:{version}"
}
sourceSets {
    main {
        compileClasspath += configurations.compileOnly
    }
}
// if using the idea plugin
idea {
    module {
        scopes.PROVIDED.plus += configurations.compileOnly
    }
}
----

Use the `provided` scope in order to mark Gipsy as a compile-only dependency; this also avoids exposing Gipsy to
consumers of your library.

== Creating Your Own AST Transformations

TBD

<commit_msg>Update readme [ci skip]<commit_after>= Gipsy
:author: <NAME>
:version: 0.4.1
:project-name: gipsy

image::media/gipsy-logo.png[]

image:http://img.shields.io/travis/aalmiray/{project-name}/master.svg["Build Status", link="https://travis-ci.org/aalmiray/{project-name}"]
image:http://img.shields.io/coveralls/aalmiray/{project-name}/master.svg["Coverage Status", link="https://coveralls.io/r/aalmiray/{project-name}"]
image:http://img.shields.io/:semver-{version}-blue.svg["Semantic Versioning", link="http://semver.org"]
image:http://img.shields.io/badge/license-ASF2-blue.svg["Apache License 2", link="http://www.apache.org/licenses/LICENSE-2.0.txt"]
image:http://img.shields.io/badge/download-latest-bb00bb.svg[link="https://bintray.com/aalmiray/kordamp/{project-name}/_latestVersion"]
image:https://img.shields.io/badge/donations-Patreon-orange.svg[link="https://www.patreon.com/user?u=6609318"]

Groovy version of https://github.com/aalmiray/jipsy[Jipsy], a configurable AST Transformation to simplify the use of
the Service Provider Interface.

== Introduction

Gipsy delivers the same functionality that https://github.com/aalmiray/jipsy[Jipsy] does but uses Groovy's AST Transformations
instead of JDK6' Annotation Processor.

As explained at the http://docs.oracle.com/javase/6/docs/api/java/util/ServiceLoader.html[service loader documentation],
services must follow certain rules in order to be considered as such; they also must be registered using an standard location
based on a naming convention. The following rules apply to classes that may be considered services

. The class must implement at least one target interface (the service interface).
. The class must provide a no-args constructor.
. The class must be public.
. The class name should be added to a file named `META-INF/services/<target_interface_name>`

This library provides a mechanism for enforcing those rules by simply adding an annotation on each service implementation, for
example say there exists the following `Calculator` service interface

[source,groovy]
----
package com.acme

interface Calculator {
    double add(double a, double b)
}
----

A basic implementation of such service may be as follows

[source,groovy]
----
package com.acme

@org.kordamp.jipsy.ServiceProviderFor(Calculator)
class BasicCalculator implements Calculator {
    double add(double a, double b) { a + b }
}
----

Notice that Gipsy reuses the same annotations from Jipsy. Compile your code. If you look closely at your
project's output you'll see a file named `META-INF/services/com.acme.Calculator` whose contents should look similar to

[source]
[subs="verbatim,attributes"]
----
# Generated by org.kordamp.gipsy.transform.service.ServiceProviderProcessor ({version})
# Wed, 25 Dec 2013 22:28:50 +0100
com.acme.BasicCalculator
----

Et voilà! There are no additional sources to be touched nor files to be created; Jipsy will take care of the boiler plate.

== Installing

Gipsy requires the following dependencies

 - jipsy-{version}
 - groovy-all-2.4.11

Gipsy can be downloaded directly from https://bintray.com/aalmiray/kordamp/gipsy[Bintray] or configure it via Maven or Gradle.

.Maven
[subs="verbatim,attributes"]
----
<dependency>
  <groupId>org.kordamp.gipsy</groupId>
  <artifactId>gipsy</artifactId>
  <version>{version}</version>
  <scope>provided</scope>
</dependency>
----

.Gradle
[subs="verbatim,attributes"]
----
dependencies {
    compileOnly "org.kordamp.gipsy:gipsy:{version}"
}
----

== Creating Your Own AST Transformations

TBD


{'fraction_non_alphanumeric': 0.11934776651137298, 'fraction_numerical': 0.009317621266100301, 'mean_word_length': 4.601688411358404, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, 'https://': 14, 'lorem ipsum': 0, 'www.': 3, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3978919', 'n_tokens_mistral': 2408, 'n_tokens_neox': 2254, 'n_words': 662}