Skip to content

Commit

Permalink
Merge pull request #41 from GoodforGod/dev
Browse files Browse the repository at this point in the history
[1.3.0]
  • Loading branch information
GoodforGod authored Dec 5, 2021
2 parents 4afdb41 + 00cfab9 commit 0245a9c
Show file tree
Hide file tree
Showing 51 changed files with 126 additions and 154 deletions.
37 changes: 23 additions & 14 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
name: Java CI

on:
push:
branches:
- master
pull_request:
branches:
- master
- dev
- master
- dev

jobs:
build:
Expand All @@ -15,18 +18,24 @@ jobs:
name: Java ${{ matrix.java }} setup

steps:
- uses: actions/checkout@v1
- name: Set up JDK
uses: actions/setup-java@v1
- uses: actions/checkout@v1
- name: Set up JDK
uses: actions/setup-java@v1

with:
java-version: ${{ matrix.java }}

- name: Build
run: ./gradlew classes

with:
java-version: ${{ matrix.java }}
- name: Codestyle
run: ./gradlew spotlessCheck

- name: Build with Gradle
run: ./gradlew build jacocoTestReport
- name: Test
run: ./gradlew test jacocoTestReport

- name: Analyze with SonarQube
run: ./gradlew sonarqube
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: SonarQube
run: ./gradlew sonarqube
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
74 changes: 41 additions & 33 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
plugins {
id 'jacoco'
id 'java-library'
id 'maven-publish'
id "jacoco"
id "java-library"
id "maven-publish"

id 'org.jetbrains.intellij' version '1.1.4'
id 'org.sonarqube' version '3.3'
id 'com.diffplug.spotless' version '5.11.0'
id "org.jetbrains.intellij" version "1.3.0"
id "org.sonarqube" version "3.3"
id "com.diffplug.spotless" version "5.14.3"
}

repositories {
Expand All @@ -16,12 +16,12 @@ repositories {
group = groupId
version = artifactVersion

sourceCompatibility = 1.8
targetCompatibility = 1.8
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

intellij {
plugins = ['java']
version = '2021.2'
plugins = ["java"]
version = "2021.3"
downloadSources = false
}

Expand All @@ -30,28 +30,29 @@ runIde {
}

patchPluginXml {
sinceBuild = '202'
sinceBuild = "202"
}

spotless {
java {
encoding 'UTF-8'
encoding("UTF-8")
importOrder()
removeUnusedImports()
eclipse().configFile "${projectDir}/config/codestyle.xml"
eclipse().configFile("${projectDir}/config/codestyle.xml")
}
}

sonarqube {
properties {
property 'sonar.host.url', 'https://sonarcloud.io'
property 'sonar.organization', 'goodforgod'
property 'sonar.projectKey', 'GoodforGod_DummyMapper'
property "sonar.host.url", "https://sonarcloud.io"
property "sonar.organization", "goodforgod"
property "sonar.projectKey", "GoodforGod_DummyMapper"
}
}

configurations {
all {
exclude module: 'slf4j-api'
exclude module: "slf4j-api"
resolutionStrategy {
force "com.fasterxml.jackson.core:jackson-core:$jacksonVersion"
force "com.fasterxml.jackson.core:jackson-databind:$jacksonVersion"
Expand All @@ -65,39 +66,46 @@ configurations {
}

dependencies {
compile 'com.github.goodforgod:dummymaker:3.0.2'
compile 'org.javassist:javassist:3.27.0-GA'
implementation "com.github.goodforgod:dummymaker:3.1.0"
implementation "org.javassist:javassist:3.28.0-GA"

compile "com.fasterxml.jackson.dataformat:jackson-dataformat-avro:$jacksonVersion"
compile 'com.github.victools:jsonschema-generator:4.12.2'
compile 'org.apache.avro:avro-compiler:1.9.2'
compile 'io.leangen.graphql:spqr:0.11.2'
implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-avro:$jacksonVersion"
implementation "com.github.victools:jsonschema-generator:4.21.0"
implementation "org.apache.avro:avro-compiler:1.9.2"
implementation "io.leangen.graphql:spqr:0.11.2"
}

test {
useJUnitPlatform()
testLogging {
events "passed", "skipped", "failed"
exceptionFormat "full"
events("passed", "skipped", "failed")
exceptionFormat("full")
showStandardStreams(false)
}
}

jacocoTestReport {
reports {
xml.enabled = true
html.enabled = true
html.destination file("${buildDir}/jacocoHtml")
html.enabled(false)
junitXml.enabled(false)
}
}

tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
options.incremental = true
options.encoding("UTF-8")
options.incremental(true)
options.fork = true
}

check.dependsOn jacocoTestReport
jacocoTestReport {
reports {
xml.enabled true
html.destination file("${buildDir}/jacocoHtml")
}
}

javadoc {
options.encoding = "UTF-8"
if (JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
options.addBooleanOption("html5", true)
}
}
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
groupId=com.github.goodforgod
artifactId=dummymapper
artifactVersion=1.2.0
artifactVersion=1.3.0


##### GRADLE #####
Expand All @@ -12,4 +12,4 @@ org.gradle.jvmargs=-Dfile.encoding=UTF-8


##### FRAMEWORKS #####
jacksonVersion=2.11.0
jacksonVersion=2.12.0
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ case "`uname`" in
Darwin* )
darwin=true
;;
MINGW* )
MSYS* | MINGW* )
msys=true
;;
NONSTOP* )
Expand Down
7 changes: 3 additions & 4 deletions src/main/java/io/goodforgod/dummymapper/MapperAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,13 @@
import io.goodforgod.dummymapper.ui.ConfigDialog;
import io.goodforgod.dummymapper.ui.config.IConfig;
import io.goodforgod.dummymapper.util.IdeaUtils;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import javax.swing.*;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.Collection;
import java.util.StringJoiner;
import javax.swing.*;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

/**
* Mapper entry point base implementation class
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import io.leangen.graphql.execution.GlobalEnvironment;
import io.leangen.graphql.metadata.strategy.value.jackson.JacksonValueMapper;
import io.leangen.graphql.metadata.strategy.value.jackson.JacksonValueMapperFactory;

import java.lang.reflect.Constructor;
import java.util.List;
import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
import io.goodforgod.dummymapper.marker.Marker;
import io.goodforgod.dummymapper.marker.RawMarker;
import io.goodforgod.dummymapper.model.AnnotationMarker;
import org.jetbrains.annotations.NotNull;

import java.util.Map;
import java.util.Set;
import java.util.function.Predicate;
import java.util.stream.Collectors;
import org.jetbrains.annotations.NotNull;

/**
* Filters out {@link AnnotationMarker} from {@link Marker} which are not qualified to {@link #allowed()}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@
import io.goodforgod.dummymapper.marker.RawMarker;
import io.goodforgod.dummymapper.model.AnnotationMarker;
import io.goodforgod.dummymapper.model.AnnotationMarkerBuilder;
import org.apache.avro.reflect.AvroIgnore;
import org.apache.avro.reflect.Nullable;
import org.jetbrains.annotations.NotNull;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.function.Predicate;
import org.apache.avro.reflect.AvroIgnore;
import org.apache.avro.reflect.Nullable;
import org.jetbrains.annotations.NotNull;

/**
* Filter structure for fields that should be ignored during AVRO schema generation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@
import io.goodforgod.dummymapper.model.AnnotationMarker;
import io.goodforgod.dummymapper.model.AnnotationMarkerBuilder;
import io.goodforgod.dummymapper.util.MarkerUtils;
import org.jetbrains.annotations.NotNull;

import java.util.Map;
import java.util.function.Predicate;
import org.jetbrains.annotations.NotNull;

/**
* Allow recursion filter for all {@link RawMarker} or {@link CollectionMarker} with such raw markers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
import io.goodforgod.dummymapper.marker.MapMarker;
import io.goodforgod.dummymapper.marker.Marker;
import io.goodforgod.dummymapper.marker.RawMarker;
import org.jetbrains.annotations.NotNull;

import java.util.Map;
import org.jetbrains.annotations.NotNull;

/**
* Filters out empty {@link RawMarker} or if any {@link CollectionMarker} or {@link MapMarker} have empty {@link RawMarker}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package io.goodforgod.dummymapper.filter.impl;

import io.goodforgod.dummymapper.model.AnnotationMarker;

import java.util.function.Predicate;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import io.dummymaker.annotation.complex.GenEnum;
import io.goodforgod.dummymapper.model.AnnotationMarker;

import java.util.function.Predicate;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@
import io.goodforgod.dummymapper.marker.RawMarker;
import io.goodforgod.dummymapper.model.AnnotationMarker;
import io.goodforgod.dummymapper.model.AnnotationMarkerBuilder;
import org.jetbrains.annotations.NotNull;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import org.jetbrains.annotations.NotNull;

/**
* Add {@link JsonProperty#required()} true if such annotation is not present on field
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
import io.goodforgod.dummymapper.marker.Marker;
import io.goodforgod.dummymapper.marker.RawMarker;
import io.goodforgod.dummymapper.model.AnnotationMarker;
import org.jetbrains.annotations.NotNull;

import java.util.Map;
import java.util.function.Predicate;
import org.jetbrains.annotations.NotNull;

/**
* Filters out {@link Marker} from structure if any annotations is qualified by {@link #predicate()}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@

import com.fasterxml.jackson.annotation.*;
import io.goodforgod.dummymapper.model.AnnotationMarker;
import org.apache.avro.reflect.*;

import java.lang.annotation.RetentionPolicy;
import java.util.Set;
import java.util.function.Predicate;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.apache.avro.reflect.*;

/**
* Filters all unsupported {@link AnnotationMarker} from {@link io.goodforgod.dummymapper.marker.Marker}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import io.goodforgod.dummymapper.filter.impl.EmptyMarkerFilter;
import io.goodforgod.dummymapper.filter.impl.ExcludeSetterAnnotationFilter;
import io.goodforgod.dummymapper.filter.impl.GenEnumAnnotationFilter;

import java.text.SimpleDateFormat;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@
import io.goodforgod.dummymapper.marker.RawMarker;
import io.goodforgod.dummymapper.service.ClassFactory;
import io.goodforgod.dummymapper.ui.config.IConfig;
import java.util.Optional;
import org.apache.avro.Schema;
import org.apache.avro.reflect.ReflectData;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.Optional;

/**
* Maps instance of {@link PsiJavaFile} to apache {@link Schema} AVRO format
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@
import io.goodforgod.dummymapper.marker.RawMarker;
import io.goodforgod.dummymapper.service.ClassFactory;
import io.goodforgod.dummymapper.ui.config.AvroJacksonConfig;
import java.util.Optional;
import org.apache.avro.Schema;
import org.jetbrains.annotations.NotNull;

import java.util.Optional;

/**
* Maps instance of {@link PsiJavaFile} to Jackson {@link AvroSchema} AVRO format
*
Expand Down
Loading

0 comments on commit 0245a9c

Please sign in to comment.