Skip to content
Open
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
File renamed without changes.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ jobs:
timezoneMacos: "Europe/Berlin"
timezoneWindows: "W. Europe Standard Time"

- name: Set up JDK 21
- name: Set up JDK 17
uses: actions/setup-java@v5.2.0
with:
java-version: '21'
java-version: '17'
distribution: 'temurin'
cache: 'gradle'

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ jobs:
echo "gradle.properties criado:"
cat gradle.properties

- name: Set up JDK 21
- name: Set up JDK 17
uses: actions/setup-java@v5.2.0
with:
java-version: '21'
java-version: '17'
distribution: 'temurin'
cache: 'gradle'

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,4 @@ bin/

### Mac OS ###
.DS_Store
/.idea/
8 changes: 0 additions & 8 deletions .idea/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion .idea/.name

This file was deleted.

11 changes: 0 additions & 11 deletions .idea/aws.xml

This file was deleted.

7 changes: 0 additions & 7 deletions .idea/dictionaries/project.xml

This file was deleted.

17 changes: 0 additions & 17 deletions .idea/gradle.xml

This file was deleted.

10 changes: 0 additions & 10 deletions .idea/misc.xml

This file was deleted.

11 changes: 0 additions & 11 deletions .idea/sonarlint.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/vcs.xml

This file was deleted.

112 changes: 111 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ plugins {
id 'maven-publish'
id 'signing'
id 'jacoco'
id 'com.github.spotbugs' version '6.0.15'
id 'pmd'
id 'checkstyle'
id 'info.solidsoft.pitest' version '1.19.0-rc.3'
}

group = 'dev.toonformat'
Expand Down Expand Up @@ -35,13 +39,105 @@ jacoco {
reportsDirectory = layout.buildDirectory.dir('customJacocoReportDir')
}

pitest {
pitestVersion = '1.17.4'
targetClasses = ['dev.toonformat.jtoon.*']
targetTests = ['dev.toonformat.jtoon.*']
outputFormats = ['XML', 'HTML']
mutationThreshold = 70
coverageThreshold = 70
}

spotbugs {
toolVersion = '4.9.8'
excludeFilter = file('spotbugs-exclude.xml')
effort = "max"
reportLevel = "low"
reportsDir = layout.buildDirectory.dir('spotbugs')
}

tasks.spotbugsMain {
reports {
html {
required = true
outputLocation = file("${spotbugs.reportsDir.get()}/spotbugs-main.html")
}
xml {
required = true
outputLocation = file("${spotbugs.reportsDir.get()}/spotbugs-main.xml")
}
}
}

tasks.spotbugsTest {
reports {
html {
required = true
outputLocation = file("${spotbugs.reportsDir.get()}/spotbugs-test.html")
}
xml {
required = true
outputLocation = file("${spotbugs.reportsDir.get()}/spotbugs-test.xml")
}
}
ignoreFailures = true
}

pmd {
toolVersion = '7.0.0'
ruleSetFiles = files('pmd-rules.xml')
ruleSets = [] // Disable default rulesets, use custom file only
consoleOutput = true
ignoreFailures = true
}

tasks.pmdMain {
reports {
html.required = true
xml.required = true
}
}

tasks.pmdTest {
ruleSetFiles = files('pmd-rules-test.xml')
ignoreFailures = true
reports {
html.required = true
xml.required = true
}
}

checkstyle {
toolVersion = '10.12.5'
configFile = file('checkstyle.xml')
showViolations = true
ignoreFailures = true
}

tasks.checkstyleMain {
reports {
xml.required = true
html.required = true
}
}

tasks.checkstyleTest {
enabled = false
ignoreFailures = true
}

dependencies {
implementation 'tools.jackson.core:jackson-databind:3.0.4'
implementation 'tools.jackson.module:jackson-module-afterburner:3.0.4'
compileOnly 'com.github.spotbugs:spotbugs-annotations:4.9.8'
testImplementation platform('org.junit:junit-bom:6.0.2')
testImplementation 'org.junit.jupiter:junit-jupiter'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
testImplementation 'org.awaitility:awaitility:4.2.1'
testImplementation 'org.awaitility:awaitility:4.3.0'
testImplementation 'org.pitest:pitest-junit5-plugin:1.2.3'
testImplementation 'org.openjdk.jmh:jmh-core:1.37'
testImplementation 'org.openjdk.jmh:jmh-generator-annprocess:1.37'
testAnnotationProcessor 'org.openjdk.jmh:jmh-generator-annprocess:1.37'
}

test {
Expand Down Expand Up @@ -79,6 +175,9 @@ jacocoTestCoverageVerification {
}
}
check.dependsOn jacocoTestReport
check.dependsOn spotbugsMain
check.dependsOn pmdMain
check.dependsOn checkstyleMain

tasks.register('generateJavadoc', Javadoc) {
description = 'Generates Javadoc HTML documentation in the docs/javadoc folder'
Expand All @@ -100,3 +199,14 @@ tasks.register('specsValidation', Test) {
include '**/ConformanceTest.class'
}

tasks.register('jmh', JavaExec) {
group = 'verification'
description = 'Run JMH benchmarks'
classpath = configurations.testRuntimeClasspath + sourceSets.test.runtimeClasspath
mainClass = 'dev.toonformat.jtoon.JToonBenchmark'
workingDir = projectDir
doFirst {
file('build/jmh-results').mkdirs()
}
}

83 changes: 83 additions & 0 deletions checkstyle.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
"https://checkstyle.org/dtds/configuration_1_3.dtd">

<module name="Checker">
<property name="charset" value="UTF-8"/>
<property name="severity" value="warning"/>
<property name="fileExtensions" value="java"/>

<!-- Size Violations -->
<module name="FileLength">
<property name="max" value="2000"/>
</module>
<module name="LineLength">
<property name="max" value="120"/>
</module>

<!-- TreeWalker for detailed checks -->
<module name="TreeWalker">
<!-- Basic checks -->
<module name="OuterTypeFilename"/>
<module name="IllegalTokenText"/>
<module name="AvoidEscapedUnicodeCharacters"/>

<!-- Naming Conventions -->
<module name="PackageName"/>
<module name="TypeName"/>
<module name="MemberName"/>
<module name="ParameterName"/>
<module name="LocalVariableName"/>
<module name="ClassTypeParameterName"/>
<module name="MethodTypeParameterName"/>
<module name="InterfaceTypeParameterName"/>

<!-- Code blocks -->
<module name="EmptyBlock"/>
<module name="NeedBraces"/>
<module name="LeftCurly"/>
<module name="RightCurly"/>

<!-- Whitespace -->
<module name="WhitespaceAround"/>
<module name="OneStatementPerLine"/>
<module name="MultipleVariableDeclarations"/>
<module name="ArrayTypeStyle"/>

<!-- Code Quality -->
<module name="NoFinalizer"/>
<module name="GenericWhitespace"/>
<module name="Indentation">
<property name="basicOffset" value="4"/>
</module>
<module name="AbbreviationAsWordInName">
<property name="ignoreFinal" value="true"/>
<property name="allowedAbbreviationLength" value="1"/>
</module>
<module name="OverloadMethodsDeclarationOrder"/>
<module name="VariableDeclarationUsageDistance"/>
<module name="CustomImportOrder"/>

<module name="FinalParameters">
<property name="ignorePrimitiveTypes" value="false"/>
</module>

<!-- Javadoc -->
<module name="JavadocMethod">
<property name="allowMissingParamTags" value="true"/>
<property name="allowMissingReturnTag" value="true"/>
</module>
<module name="JavadocType"/>
<module name="JavadocStyle"/>

<!-- Error Prevention -->
<module name="EmptyStatement"/>
<module name="EqualsHashCode"/>
<module name="HiddenField"/>
<module name="FinalLocalVariable"/>
<module name="MagicNumber">
<property name="ignoreNumbers" value="-1, 0, 1, 2"/>
</module>
</module>
</module>
Loading
Loading