Skip to content

Commit fc386e9

Browse files
authored
IGNITE-27347 Add separate codestyle build on Java 17 (#7231)
1 parent a9d9bb4 commit fc386e9

File tree

4 files changed

+59
-0
lines changed

4 files changed

+59
-0
lines changed

.teamcity/org/apache/ignite/teamcity/ApacheIgnite3CustomBuildType.kt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,15 @@ class ApacheIgnite3CustomBuildType(override val buildType: BuildType) : CustomBu
2222
root(AbsoluteId("GitHubApacheIgnite3"), "+:. => %VCSROOT__IGNITE3%")
2323
}
2424
}
25+
26+
/**
27+
* Set JAVA_HOME to JDK 17
28+
*/
29+
fun ignite3Java17() = apply {
30+
buildType.params {
31+
hiddenText("env.JAVA_HOME", "%env.JDK_ORA_17%")
32+
}
33+
}
2534

2635
/**
2736
* Send build status to Apache Ignite 3 GitHub repository

.teamcity/test/build_types/RunSanityCheck.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ object RunSanityCheck : BuildType({
1414
dependencies {
1515
snapshot(AssembleTestClasses) {}
1616
snapshot(CodeStyle) {}
17+
snapshot(CodeStyleJava17) {}
1718
snapshot(Javadoc) {}
1819
snapshot(MentionTicket) {}
1920
snapshot(PMD) {}

.teamcity/test/sanity_check/Project.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,11 @@ object Project : Project({
2424
.build().buildType
2525
)
2626
}
27+
28+
buildType(
29+
ApacheIgnite3CustomBuildType.Builder(CodeStyleJava17)
30+
.ignite3VCS().ignite3Java17().ignite3BuildDependency()
31+
.defaultBuildTypeSettings().requireLinux()
32+
.build().buildType
33+
)
2734
})
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
package test.sanity_check.build_types
2+
3+
import jetbrains.buildServer.configs.kotlin.BuildType
4+
import jetbrains.buildServer.configs.kotlin.failureConditions.BuildFailureOnText
5+
import jetbrains.buildServer.configs.kotlin.failureConditions.failOnText
6+
import org.apache.ignite.teamcity.CustomBuildSteps.Companion.customGradle
7+
import org.apache.ignite.teamcity.Teamcity.Companion.getId
8+
import org.apache.ignite.teamcity.Teamcity.Companion.hiddenText
9+
10+
11+
object CodeStyleJava17 : BuildType({
12+
id(getId(this::class))
13+
name = "Code Style (Java 17)"
14+
description = "Runs code style checks that are missed by Java 11 code style build"
15+
16+
artifactRules = """
17+
%VCSROOT__IGNITE3%/build/reports/checkstyle/*.html
18+
""".trimIndent()
19+
20+
params {
21+
hiddenText("env.JAVA_HOME", "%env.JDK_ORA_17%")
22+
}
23+
24+
steps {
25+
customGradle {
26+
name = "Check code style by Checkstyle Gradle Plugin"
27+
tasks = "java-records-tests:checkstyle"
28+
gradleParams = "--continue"
29+
workingDir = "%VCSROOT__IGNITE3%"
30+
}
31+
}
32+
33+
failureConditions {
34+
executionTimeoutMin = 10
35+
failOnText {
36+
conditionType = BuildFailureOnText.ConditionType.REGEXP
37+
pattern = "There.*[0-9]+ error(s)? reported by Checkstyle"
38+
failureMessage = "CheckStyle errors"
39+
reverse = false
40+
}
41+
}
42+
})

0 commit comments

Comments
 (0)