File tree Expand file tree Collapse file tree 4 files changed +24
-113
lines changed
src/main/java/hexlet/code/games Expand file tree Collapse file tree 4 files changed +24
-113
lines changed Original file line number Diff line number Diff line change 11plugins {
2- id(" java" )
3- id(" application" )
4- id(" checkstyle" )
2+ application
3+ java
4+ checkstyle
5+ id(" org.jetbrains.kotlin.jvm" ) version " 1.8.10"
6+ id(" jacoco" )
57}
68
79group = " hexlet.code"
@@ -12,7 +14,7 @@ repositories {
1214}
1315
1416application {
15- mainClass = " hexlet.code.App"
17+ mainClass.set( " hexlet.code.App" )
1618}
1719
1820dependencies {
@@ -22,15 +24,27 @@ dependencies {
2224
2325tasks.test {
2426 useJUnitPlatform()
27+ finalizedBy(" jacocoTestReport" ) // Ссылаемся на задачу по имени, чтобы она выполнялась после тестов
2528}
2629
27- tasks.getByName(" run" , JavaExec ::class ) {
28- standardInput = System .`in `
30+ tasks.named<JacocoReport >(" jacocoTestReport" ) {
31+ dependsOn(tasks.test) // Задаем зависимость от задачи тестирования
32+ reports {
33+ xml.required.set(true ) // Генерация XML отчета
34+ html.required.set(true ) // Генерация HTML отчета
35+ }
36+ }
2937
38+ jacoco {
39+ toolVersion = " 0.8.7"
40+ }
41+
42+ tasks.getByName<JavaExec >(" run" ) {
43+ standardInput = System .`in `
3044}
3145
3246checkstyle {
33- toolVersion = " 10.12.4" // Устанавливаем версию Checkstyle
47+ toolVersion = " 10.12.4"
3448}
3549
3650tasks.withType<Checkstyle >().configureEach {
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -20,9 +20,9 @@ public static int calc() {
2020 int randomNumber1 = random .nextInt (19 ) + 1 ;
2121 int randomNumber2 = random .nextInt (9 ) + 1 ;
2222
23- String plus = randomNumber1 + "+ " + randomNumber2 ;
24- String minus = randomNumber1 + "- " + randomNumber2 ;
25- String mult = randomNumber1 + "* " + randomNumber2 ;
23+ String plus = randomNumber1 + " + " + randomNumber2 ;
24+ String minus = randomNumber1 + " - " + randomNumber2 ;
25+ String mult = randomNumber1 + " * " + randomNumber2 ;
2626
2727 List <String > randomExpression = Arrays .asList (plus , minus , mult );
2828 Random rand = new Random ();
You can’t perform that action at this time.
0 commit comments