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

feat: Bump the catalog service to JAVA 21 and update dependencies #21

Merged
merged 16 commits into from
May 27, 2024
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
6 changes: 3 additions & 3 deletions .github/workflows/run_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: 'true'
- name: Set up JDK 11
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '11'
java-version: '21'
distribution: 'temurin'
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v3
Expand All @@ -42,7 +42,7 @@ jobs:
dependency-graph: generate-and-submit
add-job-summary-as-pr-comment: always
- name: Run tests
run: ./gradlew build test
run: ./gradlew build test --stacktrace
- name: Test report
env:
NODE_OPTIONS: '--max-old-space-size=6144'
Expand Down
2 changes: 1 addition & 1 deletion BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ machine.
**Tools**

Required for building:
* OpenJDK / JDK version 11
* OpenJDK / JDK version 21
* Gradle
* Docker

Expand Down
22 changes: 6 additions & 16 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ plugins {
alias (libs.plugins.sonarqube)
id 'idea'
id 'jacoco'
id 'checkstyle'
}

repositories {
Expand All @@ -11,38 +12,27 @@ repositories {

idea {
project {
jdkName = '11'
languageLevel = '11'
jdkName = '21'
languageLevel = '21'
}
module {
downloadSources = true
excludeDirs -= file(buildDir)
// FIXME: This might be wrong with the switch to WSDL2JAVA or even not needed
buildDir.listFiles({ d, f -> f != 'generated-sources/wsimport' } as FilenameFilter).each { excludeDirs += it }
}
}

wrapper {
gradleVersion = '7.6'
gradleVersion = '8.7'
}

ext {
project_version='3.0.4'
project_version='4.0.0'
}


allprojects {
group = 'fi.vrk.xroad'
version = project_version
}

subprojects {
apply plugin: 'com.github.hierynomus.license'

license {
header rootProject.file('LICENSE.txt')
include "**/*.java"
exclude "**/wsimport/*"
}
}


3 changes: 3 additions & 0 deletions buildSrc/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
plugins {
id 'groovy-gradle-plugin'
}
38 changes: 38 additions & 0 deletions buildSrc/src/main/groovy/catalogservice.java-checks.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
plugins {
id 'com.github.hierynomus.license'
id 'checkstyle'
}

license {
header rootProject.file('LICENSE.txt')
include "**/*.java"
}

licenseMain.source = fileTree('src/main')
licenseTest.source = fileTree('src/test')
licenseFormatMain.source = fileTree('src/main')
licenseFormatTest.source = fileTree('src/test')

checkstyle {
toolVersion = "10.12.6"
configDirectory = file("${project.rootDir}/config/checkstyle")
ignoreFailures = false
showViolations = false
enableExternalDtdLoad = true
}

checkstyleMain {
source = fileTree('src/main/java')
configFile = file("${project.rootDir}/config/checkstyle/checkstyle.xml")
}

checkstyleTest {
source = fileTree('src/test/java')
configFile = file("${project.rootDir}/config/checkstyle/checkstyle-test.xml")
}

configurations.checkstyle {
resolutionStrategy.capabilitiesResolution.withCapability("com.google.collections:google-collections") {
select("com.google.guava:guava:0")
}
}
141 changes: 141 additions & 0 deletions config/checkstyle/checkstyle-common.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
<module name="SuppressWarningsFilter" />
<!-- Checks that property files contain the same keys. -->
<!-- See http://checkstyle.sf.net/config_misc.html#Translation -->
<module name="Translation"/>

<!-- Checks for Size Violations. -->
<!-- See http://checkstyle.sf.net/config_sizes.html -->
<module name="FileLength"/>

<!-- Checks for whitespace -->
<!-- See http://checkstyle.sf.net/config_whitespace.html -->
<module name="FileTabCharacter"/>

<!-- Miscellaneous other checks. -->
<!-- See http://checkstyle.sf.net/config_misc.html -->
<module name="RegexpSingleline">
<property name="format" value="^(?!\s*(?:\*\s+)?$)(.*?)\s+$"/>
<property name="minimum" value="0"/>
<property name="maximum" value="0"/>
<property name="message" value="Line has trailing spaces."/>
</module>

<module name="SuppressWarningsFilter" />

<module name="TreeWalker">
<module name="SuppressWarningsHolder" />
<module name="SuppressionCommentFilter">
<property name="offCommentFormat" value="CHECKSTYLE.OFF\: ([\w\|]+)"/>
<property name="onCommentFormat" value="CHECKSTYLE.ON\: ([\w\|]+)"/>
<property name="checkFormat" value="$1"/>
</module>

<!-- Checks for Javadoc comments. -->
<!-- See http://checkstyle.sf.net/config_javadoc.html -->

<module name="JavadocMethod">
<property name="accessModifiers" value="public"/>
<property name="allowMissingParamTags" value="true"/>
<property name="allowMissingReturnTag" value="true"/>
<property name="allowedAnnotations" value="Override, Test, Before, After, BeforeClass, AfterClass"/>
</module>

<module name="JavadocType">
<property name="scope" value="public"/>
</module>

<module name="JavadocStyle">
<property name="checkFirstSentence" value="false"/>
</module>

<!-- Checks for Naming Conventions. -->
<!-- See http://checkstyle.sf.net/config_naming.html -->
<module name="ConstantName"/>
<module name="LocalFinalVariableName"/>
<module name="LocalVariableName"/>
<module name="MemberName"/>
<module name="MethodName"/>
<module name="PackageName"/>
<module name="ParameterName"/>
<module name="StaticVariableName"/>
<module name="TypeName"/>
<!-- Checks for imports -->
<!-- http://checkstyle.sourceforge.net/config_imports.html -->
<module name="IllegalImport"/>
<!-- defaults to sun.* packages -->
<module name="RedundantImport"/>
<module name="UnusedImports"/>
<!-- Checks for Size Violations. -->
<!-- See http://checkstyle.sf.net/config_sizes.html -->
<module name="MethodLength"/>
<module name="ParameterNumber">
<property name="max" value="12"/>
</module>
<!-- Checks for whitespace -->
<!-- See http://checkstyle.sf.net/config_whitespace.html -->
<module name="GenericWhitespace"/>
<module name="MethodParamPad"/>
<module name="NoWhitespaceAfter"/>
<module name="NoWhitespaceBefore"/>
<module name="OperatorWrap">
<property name="severity" value="warning"/>
</module>
<module name="ParenPad"/>
<module name="TypecastParenPad"/>
<module name="WhitespaceAfter">
<property name="tokens" value="COMMA, SEMI"/>
</module>
<module name="WhitespaceAround"/>

<!-- Modifier Checks -->
<!-- See http://checkstyle.sf.net/config_modifier.html -->
<module name="ModifierOrder"/>
<module name="RedundantModifier"/>

<!-- Checks for blocks. You know, those {}'s -->
<!-- See http://checkstyle.sf.net/config_blocks.html -->
<module name="AvoidNestedBlocks"/>
<module name="EmptyBlock"/>
<module name="LeftCurly"/>
<module name="NeedBraces">
<property name="tokens" value="LITERAL_DO, LITERAL_WHILE, LITERAL_FOR"/>
</module>
<module name="RightCurly"/>

<!-- Checks for common coding problems -->
<!-- See http://checkstyle.sf.net/config_coding.html -->
<module name="EmptyStatement"/>
<module name="EqualsHashCode"/>
<module name="HiddenField">
<property name="ignoreConstructorParameter" value="true"/>
<property name="ignoreSetter" value="true"/>
</module>
<module name="InnerAssignment"/>
<module name="MagicNumber">
<property name="ignoreNumbers" value="-1, 0, 1, 2, 100"/>
<property name="ignoreAnnotation" value="true"/>
</module>
<module name="MissingSwitchDefault"/>
<!-- Checks for class design -->
<!-- See http://checkstyle.sf.net/config_design.html -->
<module name="FinalClass"/>
<module name="HideUtilityClassConstructor"/>
<module name="SuppressionXpathSingleFilter">
<property name="checks" value="HideUtilityClassConstructor"/>
<property name="query" value="//*[MODIFIERS//*[@text = 'UtilityClass' or @text='NoArgsConstructor' or @text = 'SpringBootApplication']]/descendant-or-self::node()"/>
</module>
<module name="InterfaceIsType"/>
<!-- Miscellaneous other checks. -->
<!-- See http://checkstyle.sf.net/config_misc.html -->
<module name="TodoComment"/>
<module name="UpperEll"/>
<module name="Indentation">
<property name="severity" value="info"/>
<property name="basicOffset" value="4"/>
<property name="lineWrappingIndentation" value="8"/>
</module>
</module>
<!-- Some checks are disabled for specific source sets (i.e. tests)-->
<module name="SuppressionFilter">
<property name="file" value="${config_loc}/suppressions.xml" default="suppressions.xml"/>
</module>
23 changes: 23 additions & 0 deletions config/checkstyle/checkstyle-test.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
"https://checkstyle.org/dtds/configuration_1_3.dtd" [
<!ENTITY common SYSTEM "checkstyle-common.xml">
]>
<module name="Checker">

&common;

<module name="TreeWalker">
<module name="AvoidStarImport">
<property name="allowStaticMemberImports" value="true"/>
</module>
</module>

<module name="LineLength">
<property name="max" value="140"/>
<property name="severity" value="warning"/>
<property name="ignorePattern" value="^ *\* *.*$"/>
</module>

</module>
Loading
Loading