Skip to content

Commit

Permalink
Added copyrights, updated README, increased version to 1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
metehantoksoy committed Mar 20, 2020
1 parent aa354ca commit f7ff995
Show file tree
Hide file tree
Showing 14 changed files with 65 additions and 18 deletions.
23 changes: 10 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[![Bolt](https://bolt.eu/favicon.ico)](https://bolt.eu/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
![Version](https://img.shields.io/nexus/r/eu.bolt/requiresannotation.plugin?server=https%3A%2F%2Foss.sonatype.org)
![Version Nexus](https://img.shields.io/nexus/r/eu.bolt/requiresannotation.plugin?server=https%3A%2F%2Foss.sonatype.org)
![Version Maven Centraal](https://img.shields.io/maven-central/v/eu.bolt/requiresannotation.annotation)


# Requires Annotation and Plugin
Expand All @@ -14,13 +15,13 @@ It is a developer mistake to forget some required annotation but this mistake ca
## Requires Annotation
### Using the annotation processor
To use the annotation:
- Add maven repository `maven { url "https://oss.sonatype.org/content/repositories/releases/" }` as a repository source.
- Add maven central repository `mavenCentral()`.
- Add dependency as an implementation and annotation processor:
```groovy
implementation "eu.bolt:requiresannotation.annotation:1.0"
annotationProcessor "eu.bolt:requiresannotation.processor:1.0"
implementation "eu.bolt:requiresannotation.annotation:1.2"
annotationProcessor "eu.bolt:requiresannotation.processor:1.2"
// lets declare both annotationProcessor and kapt of them https://issuetracker.google.com/issues/80270236
kapt "eu.bolt:requiresannotation.processor:1.0"
kapt "eu.bolt:requiresannotation.processor:1.2"
```

### Configuring the Annotation using the plugin
Expand Down Expand Up @@ -59,19 +60,15 @@ When we start the build, it will be failed because of the `someStringMethod` and
## Requires Annotation Plugin
### Using the plugin
The plugin of the annotation allows you to use other annotations also for the check. To use the plugin, you must first apply it and then configure the parameter described below. To apply the plugin in the
- Add maven repository `maven { url "https://oss.sonatype.org/content/repositories/releases/" }` to the `buildscript` in the root project's `build.gradle`
- Add dependency `classpath "eu.bolt:requiresannotation.plugin:1.0"` to the `buildscript` in the root project's `build.gradle`
- Add maven central repository `mavenCentral()` to the `buildscript` in the root project's `build.gradle`
- Add dependency `classpath "eu.bolt:requiresannotation.plugin:1.2"` to the `buildscript` in the root project's `build.gradle`
```groovy
buildscript {
repositories {
...
maven { url 'https://oss.sonatype.org/content/repositories/releases/' }
...
mavenCentral()
}
dependencies {
...
classpath "eu.bolt:requiresannotation.plugin:1.0"
...
classpath "eu.bolt:requiresannotation.plugin:1.2"
}
}
```
Expand Down
4 changes: 4 additions & 0 deletions annotation/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright (c) 2020 Bolt Technology OÜ. All rights reserved.
*/

plugins {
id "java-library"
id "maven-publish"
Expand Down
6 changes: 5 additions & 1 deletion annotation/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#
# Copyright (c) 2020 Bolt Technology OÜ. All rights reserved.
#

POM_ARTIFACT_ID=requiresannotation.annotation
POM_NAME=eu.bolt.requiresannotation.annotation
POM_PACKAGING=jar
POM_DESCRIPTION=Annotation that checks annotation for classes in the method parameters.
VERSION_NAME=1.1
VERSION_NAME=1.2
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright (c) 2020 Bolt Technology OÜ. All rights reserved.
*/

package eu.bolt.gradle.requiresannotation.annotation;

import java.lang.annotation.Annotation;
Expand Down
4 changes: 4 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright (c) 2020 Bolt Technology OÜ. All rights reserved.
*/

buildscript {
repositories {
jcenter()
Expand Down
4 changes: 4 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#
# Copyright (c) 2020 Bolt Technology OÜ. All rights reserved.
#

org.gradle.jvmargs=-Dfile.encoding=UTF-8

GROUP=eu.bolt
Expand Down
4 changes: 4 additions & 0 deletions plugin/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright (c) 2020 Bolt Technology OÜ. All rights reserved.
*/

plugins {
id "java-gradle-plugin"
id "groovy"
Expand Down
6 changes: 5 additions & 1 deletion plugin/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
#
# Copyright (c) 2020 Bolt Technology OÜ. All rights reserved.
#

POM_ARTIFACT_ID=requiresannotation.plugin
POM_NAME=eu.bolt.requiresannotation.plugin
POM_PACKAGING=jar
POM_DESCRIPTION=Annotation processor plugin.
VERSION_NAME=1.1
VERSION_NAME=1.2

DISPLAY_NAME="Requires Annotation Plugin"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright (c) 2020 Bolt Technology OÜ. All rights reserved.
*/

package eu.bolt.gradle.requiresannotation.plugin

import org.gradle.api.GradleException
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright (c) 2020 Bolt Technology OÜ. All rights reserved.
*/

package eu.bolt.gradle.requiresannotation.plugin

class RequiresAnnotationProcessorPluginExtension {
Expand Down
4 changes: 4 additions & 0 deletions processor/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright (c) 2020 Bolt Technology OÜ. All rights reserved.
*/

plugins {
id "java-library"
id "maven-publish"
Expand Down
6 changes: 5 additions & 1 deletion processor/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#
# Copyright (c) 2020 Bolt Technology OÜ. All rights reserved.
#

POM_ARTIFACT_ID=requiresannotation.processor
POM_NAME=eu.bolt.requiresannotation.processor
POM_PACKAGING=jar
POM_DESCRIPTION=Annotation processor that checks annotation for classes in the method parameters.
VERSION_NAME=1.1
VERSION_NAME=1.2
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright (c) 2020 Bolt Technology OÜ. All rights reserved.
*/

package eu.bolt.gradle.requiresannotation.processor;

import com.sun.tools.javac.code.Attribute;
Expand All @@ -23,7 +27,6 @@
import java.util.Set;
import java.util.HashSet;
import java.util.ArrayList;
import java.util.Collections;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

Expand Down
5 changes: 4 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/*
* Copyright (c) 2020 Bolt Technology OÜ. All rights reserved.
*/

include ':plugin', ':processor'
include 'annotation'

0 comments on commit f7ff995

Please sign in to comment.