Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2.2.0] #49

Merged
merged 2 commits into from
Aug 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Java CI
name: CI Master

on:
push:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# DummyMapper 🗎

![Java CI](https://github.com/GoodforGod/DummyMapper/workflows/Java%20CI/badge.svg)
![Java CI](https://github.com/GoodforGod/DummyMapper/workflows/CI%20Master/badge.svg)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=GoodforGod_DummyMapper&metric=alert_status)](https://sonarcloud.io/dashboard?id=GoodforGod_DummyMapper)
[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=GoodforGod_DummyMapper&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=GoodforGod_micronaut-arangodb)
[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=GoodforGod_DummyMapper&metric=reliability_rating)](https://sonarcloud.io/dashboard?id=GoodforGod_DummyMapper)
Expand Down
27 changes: 15 additions & 12 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@ plugins {
id "java-library"
id "maven-publish"

id "org.jetbrains.intellij" version "1.11.0"
id "org.sonarqube" version "3.5.0.2730"
id "com.diffplug.spotless" version "6.12.0"
id "org.jetbrains.intellij" version "1.15.0"
id "org.sonarqube" version "4.2.0.3129"
id "com.diffplug.spotless" version "6.19.0"
}

repositories {
mavenLocal()
mavenCentral()
}

prepareKotlinBuildScriptModel.enabled = false

group = groupId
version = artifactVersion

Expand All @@ -21,7 +23,7 @@ targetCompatibility = JavaVersion.VERSION_17

intellij {
plugins = ["java", "Kotlin"]
version = "2023.1"
version = "2023.2"
downloadSources = false
}

Expand All @@ -38,7 +40,7 @@ spotless {
encoding("UTF-8")
importOrder()
removeUnusedImports()
eclipse("4.21.0").configFile("${rootDir}/config/codestyle.xml")
eclipse("4.21").configFile("${rootDir}/config/codestyle.xml")
}
}

Expand Down Expand Up @@ -66,16 +68,17 @@ configurations {
}

dependencies {
implementation "com.github.goodforgod:dummymaker:3.3.1"
implementation "com.github.goodforgod:dummymaker:4.0.0"
implementation "org.javassist:javassist:3.29.2-GA"
implementation "io.goodforgod:jackson-datetime-configuration:1.0.0"
implementation "io.goodforgod:jackson-datetime-configuration:2.0.0"

implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-avro:$jacksonVersion"
implementation "com.github.victools:jsonschema-generator:4.28.0"
implementation "org.apache.avro:avro-compiler:1.9.2"
implementation "io.leangen.graphql:spqr:0.11.2"
implementation "org.apache.avro:avro-compiler:1.11.2"
implementation "io.leangen.graphql:spqr:0.12.3"
}


test {
useJUnitPlatform()
testLogging {
Expand All @@ -85,8 +88,8 @@ test {
}

reports {
html.enabled(false)
junitXml.enabled(false)
html.required = false
junitXml.required = false
}
}

Expand All @@ -99,7 +102,7 @@ tasks.withType(JavaCompile) {
check.dependsOn jacocoTestReport
jacocoTestReport {
reports {
xml.enabled true
xml.required = true
html.destination file("${buildDir}/jacocoHtml")
}
}
Expand Down
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=2.1.1
artifactVersion=2.2.0


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


##### FRAMEWORKS #####
jacksonVersion=2.12.0
jacksonVersion=2.15.2
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
18 changes: 14 additions & 4 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand All @@ -80,10 +80,10 @@ do
esac
done

APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

APP_NAME="Gradle"
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
Expand Down Expand Up @@ -143,12 +143,16 @@ fi
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -205,6 +209,12 @@ set -- \
org.gradle.wrapper.GradleWrapperMain \
"$@"

# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi

# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
Expand Down
15 changes: 9 additions & 6 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
@rem limitations under the License.
@rem

@if "%DEBUG%" == "" @echo off
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
Expand All @@ -25,7 +25,8 @@
if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

Expand All @@ -40,7 +41,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto execute
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Expand Down Expand Up @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
if %ERRORLEVEL% equ 0 goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%

:mainEnd
if "%OS%"=="Windows_NT" endlocal
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/io/goodforgod/dummymapper/MapperAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import com.intellij.openapi.ui.MessageType;
import com.intellij.openapi.ui.popup.util.PopupUtil;
import com.intellij.psi.PsiClass;
import io.dummymaker.util.StringUtils;
import io.goodforgod.dummymaker.util.StringUtils;
import io.goodforgod.dummymapper.error.MapperException;
import io.goodforgod.dummymapper.error.PsiKindException;
import io.goodforgod.dummymapper.error.UnsupportedPsiFileException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
package io.goodforgod.dummymapper.marker;

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

/**
Expand Down Expand Up @@ -118,7 +115,7 @@ public Builder ofInternal() {

public Builder withAttribute(@NotNull String name, Object value) {
if (this.attributes.isEmpty())
this.attributes = new HashMap<>(2);
this.attributes = new LinkedHashMap<>(2);
this.attributes.put(name, value);
return this;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.goodforgod.dummymapper.marker;

import io.dummymaker.util.CollectionUtils;
import io.goodforgod.dummymaker.util.CollectionUtils;
import java.util.*;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/io/goodforgod/dummymapper/marker/Marker.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package io.goodforgod.dummymapper.marker;

import io.dummymaker.util.CollectionUtils;
import io.dummymaker.util.StringUtils;
import io.goodforgod.dummymaker.util.CollectionUtils;
import io.goodforgod.dummymaker.util.StringUtils;
import java.util.*;
import java.util.stream.Collectors;
import org.jetbrains.annotations.NotNull;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/io/goodforgod/dummymapper/marker/RawMarker.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package io.goodforgod.dummymapper.marker;

import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.ConcurrentHashMap;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

Expand All @@ -25,7 +25,7 @@ public RawMarker(@NotNull String root,
super(root, source);
this.structure = (structure == null || structure.isEmpty())
? Collections.emptyMap()
: new ConcurrentHashMap<>(structure);
: new LinkedHashMap<>(structure);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import io.goodforgod.dummymapper.marker.AnnotationMarker;
import io.goodforgod.dummymapper.marker.RawMarker;
import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.function.Predicate;
import org.apache.avro.reflect.AvroIgnore;
Expand Down Expand Up @@ -37,7 +37,7 @@ public RawMarker filter(@NotNull RawMarker marker) {
.findFirst()
.orElseGet(Collections::emptyMap);

final Map<String, Object> attrs = new HashMap<>(annotationAttrs);
final Map<String, Object> attrs = new LinkedHashMap<>(annotationAttrs);
attrs.put(REQUIRED_PROPERTY, false);

v.addAnnotation(AnnotationMarker.builder()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.goodforgod.dummymapper.marker.filter;

import io.dummymaker.annotation.complex.GenEnum;
import io.goodforgod.dummymaker.annotation.parameterized.GenEnum;
import io.goodforgod.dummymapper.marker.AnnotationMarker;
import java.util.function.Predicate;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import io.goodforgod.dummymapper.marker.AnnotationMarker;
import io.goodforgod.dummymapper.marker.RawMarker;
import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import org.jetbrains.annotations.NotNull;

Expand All @@ -28,7 +28,7 @@ public RawMarker filter(@NotNull RawMarker marker) {
.findFirst()
.orElseGet(Collections::emptyMap);

final Map<String, Object> attrs = new HashMap<>(annotationAttrs);
final Map<String, Object> attrs = new LinkedHashMap<>(annotationAttrs);
attrs.put(REQUIRED_PROPERTY, true);

v.addAnnotation(AnnotationMarker.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.intellij.psi.PsiJavaFile;
import io.dummymaker.factory.impl.GenFactory;
import io.goodforgod.dummymaker.GenFactory;
import io.goodforgod.dummymapper.error.ParseException;
import io.goodforgod.dummymapper.marker.MarkerFilter;
import io.goodforgod.dummymapper.marker.MarkerMapper;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.intellij.psi.PsiJavaFile;
import io.dummymaker.factory.impl.GenFactory;
import io.goodforgod.dummymaker.GenFactory;
import io.goodforgod.dummymapper.error.ParseException;
import io.goodforgod.dummymapper.marker.MarkerFilter;
import io.goodforgod.dummymapper.marker.MarkerMapper;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
package io.goodforgod.dummymapper.marker.mapper;

import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.MapperFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.datatype.jdk8.Jdk8Module;
import com.fasterxml.jackson.module.paramnames.ParameterNamesModule;
import com.intellij.psi.PsiJavaFile;
import io.goodforgod.jackson.module.datetime.configuration.DateTimeFormatters;
import io.goodforgod.jackson.module.datetime.configuration.JavaTimeModule;
import io.goodforgod.jackson.module.datetime.configuration.JavaTimeModuleConfiguration;
import java.text.SimpleDateFormat;
Expand All @@ -27,20 +25,18 @@ static ObjectMapper getConfigured() {
}

static ObjectMapper configure(ObjectMapper mapper) {
final JavaTimeModule javaTimeModule = JavaTimeModuleConfiguration.ofISO().getModule();
final JavaTimeModule javaTimeModule = new JavaTimeModuleConfiguration().getModule();

mapper.setDateFormat(new SimpleDateFormat(DateTimeFormatters.ISO_DATE));
mapper.setDateFormat(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX"));
mapper.registerModule(new ParameterNamesModule())
.registerModule(new Jdk8Module())
.registerModule(javaTimeModule);

mapper.setConfig(mapper.getDeserializationConfig()
.with(MapperFeature.SORT_PROPERTIES_ALPHABETICALLY)
.with(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE));

mapper.setConfig(mapper.getSerializationConfig()
.with(SerializationFeature.INDENT_OUTPUT)
.with(MapperFeature.SORT_PROPERTIES_ALPHABETICALLY)
.with(SerializationFeature.ORDER_MAP_ENTRIES_BY_KEYS)
.without(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS));

Expand Down
Loading
Loading