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
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,13 @@

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

# gradle files
.gradle
build

# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar

# IDEA project files
.idea
34 changes: 34 additions & 0 deletions PMDRuleSet.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0"?>

<ruleset name="Custom Rules"
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 https://pmd.sourceforge.io/ruleset_2_0_0.xsd">

<description>
My custom rules
</description>


<rule ref="category/java/bestpractices.xml">
<exclude name="SystemPrintln"/>
</rule>
<rule ref="category/java/codestyle.xml">
<exclude name="AtLeastOneConstructor"/>
</rule>
<rule ref="category/java/design.xml" />
<rule ref="category/java/errorprone.xml" />

<rule ref="category/java/codestyle.xml/LongVariable">
<properties>
<property name="minimum" value="30" />
</properties>
</rule>

<rule ref="category/java/bestpractices.xml/JUnitTestContainsTooManyAsserts">
<properties>
<property name="maximumAsserts" value="5" />
</properties>
</rule>

</ruleset>
53 changes: 53 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
apply plugin: 'java'
apply plugin: 'application'
apply plugin: 'pmd'

group 'com.github.aravij'
version '0.1.0'

repositories {
mavenCentral()
}

dependencies {
implementation 'net.sourceforge.pmdpmd-java:6.29.0'
implementation 'info.picocli:picocli:4.5.2'

testImplementation(platform('org.junit:junit-bom:5.7.0'))
testImplementation('org.junit.jupiter:junit-jupiter')

testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.7.0")
}

pmd {
consoleOutput = true
ruleSetFiles = files("PMDRuleSet.xml")
}

test {
useJUnitPlatform()
}

application {
mainClassName = 'com.github.emcat.Emcat'
applicationDefaultJvmArgs = ["--enable-preview"]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better not to use preview features

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In further PRs I get rid of preview mode and migrate to java 11.
We can keep it here and further PRs will fix this problem.

}

run{
standardInput = System.in
}

sourceCompatibility = 14
targetCompatibility = 14

tasks.withType(JavaCompile) {
options.compilerArgs += '--enable-preview'
}

tasks.withType(Test) {
jvmArgs += "--enable-preview"
}

tasks.withType(JavaExec) {
jvmArgs += '--enable-preview'
}
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 5 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
185 changes: 185 additions & 0 deletions gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

104 changes: 104 additions & 0 deletions gradlew.bat

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading