From f3899c0993bad3e10e3c99f9b26d61d2f87c3cad Mon Sep 17 00:00:00 2001 From: Vitalij Berdinskih Date: Sun, 3 Dec 2023 09:59:36 +0200 Subject: [PATCH 1/6] Renamve the core module to cli-builder --- changelog.md | 2 +- {core => cli-builder}/pom.xml | 2 +- .../bot_by/ijhttp_tools/cli_builder}/CommandLineBuilder.java | 2 +- .../java/uk/bot_by/ijhttp_tools/cli_builder}/LogLevel.java | 2 +- .../bot_by/ijhttp_core/core/CommandLineBuilderFastTest.java | 2 +- .../bot_by/ijhttp_core/core/CommandLineBuilderSmokeTest.java | 2 +- maven-plugin/pom.xml | 2 +- .../java/uk/bot_by/ijhttp_tools/maven_plugin/RunMojo.java | 4 ++-- .../uk/bot_by/ijhttp_tools/maven_plugin/RunMojoFastTest.java | 2 +- .../uk/bot_by/ijhttp_tools/maven_plugin/RunMojoSlowTest.java | 2 +- pom.xml | 2 +- 11 files changed, 12 insertions(+), 12 deletions(-) rename {core => cli-builder}/pom.xml (98%) rename {core/src/main/java/uk/bot_by/ijhttp_core/core => cli-builder/src/main/java/uk/bot_by/ijhttp_tools/cli_builder}/CommandLineBuilder.java (99%) rename {core/src/main/java/uk/bot_by/ijhttp_core/core => cli-builder/src/main/java/uk/bot_by/ijhttp_tools/cli_builder}/LogLevel.java (89%) rename {core => cli-builder}/src/test/java/uk/bot_by/ijhttp_core/core/CommandLineBuilderFastTest.java (99%) rename {core => cli-builder}/src/test/java/uk/bot_by/ijhttp_core/core/CommandLineBuilderSmokeTest.java (93%) diff --git a/changelog.md b/changelog.md index 8258b36..39f1d73 100644 --- a/changelog.md +++ b/changelog.md @@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - The proxy feature - The report path -- Split Maven plugin and core module +- Split Maven plugin and CLI builder modules ## 1.0.1 - 2023-11-08 ### Fixed diff --git a/core/pom.xml b/cli-builder/pom.xml similarity index 98% rename from core/pom.xml rename to cli-builder/pom.xml index 214da5c..1bc7ba7 100644 --- a/core/pom.xml +++ b/cli-builder/pom.xml @@ -17,7 +17,7 @@ - ijhttp-core + ijhttp-cli-builder diff --git a/core/src/main/java/uk/bot_by/ijhttp_core/core/CommandLineBuilder.java b/cli-builder/src/main/java/uk/bot_by/ijhttp_tools/cli_builder/CommandLineBuilder.java similarity index 99% rename from core/src/main/java/uk/bot_by/ijhttp_core/core/CommandLineBuilder.java rename to cli-builder/src/main/java/uk/bot_by/ijhttp_tools/cli_builder/CommandLineBuilder.java index 56e9fb0..8cbde51 100644 --- a/core/src/main/java/uk/bot_by/ijhttp_core/core/CommandLineBuilder.java +++ b/cli-builder/src/main/java/uk/bot_by/ijhttp_tools/cli_builder/CommandLineBuilder.java @@ -1,4 +1,4 @@ -package uk.bot_by.ijhttp_core.core; +package uk.bot_by.ijhttp_tools.cli_builder; import static java.util.Objects.isNull; import static java.util.Objects.nonNull; diff --git a/core/src/main/java/uk/bot_by/ijhttp_core/core/LogLevel.java b/cli-builder/src/main/java/uk/bot_by/ijhttp_tools/cli_builder/LogLevel.java similarity index 89% rename from core/src/main/java/uk/bot_by/ijhttp_core/core/LogLevel.java rename to cli-builder/src/main/java/uk/bot_by/ijhttp_tools/cli_builder/LogLevel.java index 66c61ff..6c78103 100644 --- a/core/src/main/java/uk/bot_by/ijhttp_core/core/LogLevel.java +++ b/cli-builder/src/main/java/uk/bot_by/ijhttp_tools/cli_builder/LogLevel.java @@ -1,4 +1,4 @@ -package uk.bot_by.ijhttp_core.core; +package uk.bot_by.ijhttp_tools.cli_builder; /** * Logging levels. diff --git a/core/src/test/java/uk/bot_by/ijhttp_core/core/CommandLineBuilderFastTest.java b/cli-builder/src/test/java/uk/bot_by/ijhttp_core/core/CommandLineBuilderFastTest.java similarity index 99% rename from core/src/test/java/uk/bot_by/ijhttp_core/core/CommandLineBuilderFastTest.java rename to cli-builder/src/test/java/uk/bot_by/ijhttp_core/core/CommandLineBuilderFastTest.java index b0f7be2..2a880ce 100644 --- a/core/src/test/java/uk/bot_by/ijhttp_core/core/CommandLineBuilderFastTest.java +++ b/cli-builder/src/test/java/uk/bot_by/ijhttp_core/core/CommandLineBuilderFastTest.java @@ -1,4 +1,4 @@ -package uk.bot_by.ijhttp_core.core; +package uk.bot_by.ijhttp_tools.cli_builder; import static java.util.Objects.isNull; import static java.util.Objects.nonNull; diff --git a/core/src/test/java/uk/bot_by/ijhttp_core/core/CommandLineBuilderSmokeTest.java b/cli-builder/src/test/java/uk/bot_by/ijhttp_core/core/CommandLineBuilderSmokeTest.java similarity index 93% rename from core/src/test/java/uk/bot_by/ijhttp_core/core/CommandLineBuilderSmokeTest.java rename to cli-builder/src/test/java/uk/bot_by/ijhttp_core/core/CommandLineBuilderSmokeTest.java index 840d7e4..eba27e4 100644 --- a/core/src/test/java/uk/bot_by/ijhttp_core/core/CommandLineBuilderSmokeTest.java +++ b/cli-builder/src/test/java/uk/bot_by/ijhttp_core/core/CommandLineBuilderSmokeTest.java @@ -1,4 +1,4 @@ -package uk.bot_by.ijhttp_core.core; +package uk.bot_by.ijhttp_tools.cli_builder; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index 4811901..a84b626 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -85,7 +85,7 @@ - ijhttp-core + ijhttp-cli-builder uk.bot-by.ijhttp-tools ${revision}${changelist}${sha1} diff --git a/maven-plugin/src/main/java/uk/bot_by/ijhttp_tools/maven_plugin/RunMojo.java b/maven-plugin/src/main/java/uk/bot_by/ijhttp_tools/maven_plugin/RunMojo.java index 9244c53..ee6967f 100644 --- a/maven-plugin/src/main/java/uk/bot_by/ijhttp_tools/maven_plugin/RunMojo.java +++ b/maven-plugin/src/main/java/uk/bot_by/ijhttp_tools/maven_plugin/RunMojo.java @@ -38,8 +38,8 @@ import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; import org.jetbrains.annotations.VisibleForTesting; -import uk.bot_by.ijhttp_core.core.CommandLineBuilder; -import uk.bot_by.ijhttp_core.core.LogLevel; +import uk.bot_by.ijhttp_tools.cli_builder.CommandLineBuilder; +import uk.bot_by.ijhttp_tools.cli_builder.LogLevel; /** * Run integration tests using IntelliJ HTTP Client. diff --git a/maven-plugin/src/test/java/uk/bot_by/ijhttp_tools/maven_plugin/RunMojoFastTest.java b/maven-plugin/src/test/java/uk/bot_by/ijhttp_tools/maven_plugin/RunMojoFastTest.java index 251779d..8dc5bef 100644 --- a/maven-plugin/src/test/java/uk/bot_by/ijhttp_tools/maven_plugin/RunMojoFastTest.java +++ b/maven-plugin/src/test/java/uk/bot_by/ijhttp_tools/maven_plugin/RunMojoFastTest.java @@ -48,7 +48,7 @@ import org.mockito.Mock; import org.mockito.Spy; import org.mockito.junit.jupiter.MockitoExtension; -import uk.bot_by.ijhttp_core.core.LogLevel; +import uk.bot_by.ijhttp_tools.cli_builder.LogLevel; @ExtendWith(MockitoExtension.class) @Tag("fast") diff --git a/maven-plugin/src/test/java/uk/bot_by/ijhttp_tools/maven_plugin/RunMojoSlowTest.java b/maven-plugin/src/test/java/uk/bot_by/ijhttp_tools/maven_plugin/RunMojoSlowTest.java index 62af80e..a8ed2f0 100644 --- a/maven-plugin/src/test/java/uk/bot_by/ijhttp_tools/maven_plugin/RunMojoSlowTest.java +++ b/maven-plugin/src/test/java/uk/bot_by/ijhttp_tools/maven_plugin/RunMojoSlowTest.java @@ -33,7 +33,7 @@ import org.mockito.Mock; import org.mockito.Spy; import org.mockito.junit.jupiter.MockitoExtension; -import uk.bot_by.ijhttp_core.core.LogLevel; +import uk.bot_by.ijhttp_tools.cli_builder.LogLevel; @ExtendWith(MockitoExtension.class) @Tag("slow") diff --git a/pom.xml b/pom.xml index c41c876..a036af7 100644 --- a/pom.xml +++ b/pom.xml @@ -296,7 +296,7 @@ 4.0.0 - core + cli-builder maven-plugin IntelliJ HTTP Client Tools From 31ddd710f075f00e6cfc5133e81c8141b92df4ce Mon Sep 17 00:00:00 2001 From: Vitalij Berdinskih Date: Sun, 3 Dec 2023 12:06:56 +0200 Subject: [PATCH 2/6] Fix GitLab CI configuration --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 71ba4c6..f61f6ed 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -57,7 +57,7 @@ coverage: codacy: stage: verify script: - - bash <(curl -Ls https://coverage.codacy.com/get.sh) report -r target/site/jacoco/jacoco.xml + - bash <(curl -Ls https://coverage.codacy.com/get.sh) report -r cli-builder/target/site/jacoco/jacoco.xml -r maven-plugin/target/site/jacoco/jacoco.xml rules: - if: $CODACY_PROJECT_TOKEN && $CI_COMMIT_TAG == null From c9fc7077cd0153652bc269d53962bb5755c5e0c5 Mon Sep 17 00:00:00 2001 From: Vitalij Berdinskih Date: Sun, 3 Dec 2023 13:20:33 +0200 Subject: [PATCH 3/6] Fix GitLab CI configuration --- .gitlab-ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f61f6ed..0bb238f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -9,7 +9,8 @@ include: cache: paths: - .m2/repository - - target + - cli-builder/target + - maven-plugin/target stages: - build From b3d801f6db7761c3605f9d1f69409021fd28079b Mon Sep 17 00:00:00 2001 From: Vitalij Berdinskih Date: Sun, 3 Dec 2023 13:20:33 +0200 Subject: [PATCH 4/6] Fix GitLab CI configuration --- .gitlab-ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f61f6ed..0bb238f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -9,7 +9,8 @@ include: cache: paths: - .m2/repository - - target + - cli-builder/target + - maven-plugin/target stages: - build From edbbe1e5d98680320775a181bf5e6d218535a0b7 Mon Sep 17 00:00:00 2001 From: Vitalij Berdinskih Date: Sun, 3 Dec 2023 13:32:43 +0200 Subject: [PATCH 5/6] Fix GitLab CI configuration --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0bb238f..1abb7e7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -50,7 +50,7 @@ spotbugs-sast: coverage: stage: verify script: - - awk -F"," '{ instructions += $4 + $5; covered += $5 } END { print covered, "/", instructions, "instructions covered"; print 100*covered/instructions, "% covered" }' target/site/jacoco/jacoco.csv + - awk -F"," '{ instructions += $4 + $5; covered += $5 } END { print covered, "/", instructions, "instructions covered"; print 100*covered/instructions, "% covered" }' cli-builder/target/site/jacoco/jacoco.csv maven-plugin/target/site/jacoco/jacoco.csv coverage: '/(\d+\.?\d*) \% covered/' rules: - if: $CI_DEFAULT_BRANCH == $CI_COMMIT_BRANCH && $CI_COMMIT_TAG == null From 5fd17fbdd0b91685a66204d6bb7f7129bf8cbad2 Mon Sep 17 00:00:00 2001 From: Vitalij Berdinskih Date: Sun, 3 Dec 2023 14:17:19 +0200 Subject: [PATCH 6/6] Fix stderr integration test --- maven-plugin/test-exit-code.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/maven-plugin/test-exit-code.sh b/maven-plugin/test-exit-code.sh index 352a158..7160df2 100755 --- a/maven-plugin/test-exit-code.sh +++ b/maven-plugin/test-exit-code.sh @@ -1,3 +1,5 @@ #!/bin/bash +[ ${1:-0} -gt 0 ] && echo "error output" >&2 || echo "standard output" + exit "${1:-0}" \ No newline at end of file