Skip to content

Conversation

jabrena
Copy link
Contributor

@jabrena jabrena commented May 15, 2025

Features added in the PR:

  • Gradle wrapper upgrade
  • Gradle build update
  • Increase the minimum java version from Java 11 to Java 17
  • Transitive Dependency update
  • Improved CLI support with Picocli
  • Removed non used code
  • Improved a bit the Unit testing support
  • CI Pipeline update
image

Copy link

codecov bot commented May 15, 2025

Codecov Report

Attention: Patch coverage is 92.30769% with 7 lines in your changes missing coverage. Please review.

Project coverage is 92.3%. Comparing base (f07c612) to head (7af957d).
Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
...in/java/org/contextmapper/cli/ValidateCommand.java 87.5% 2 Missing and 1 partial ⚠️
...n/java/org/contextmapper/cli/ContextMapperCLI.java 60.0% 2 Missing ⚠️
...in/java/org/contextmapper/cli/GenerateCommand.java 95.2% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             master     #20     +/-   ##
==========================================
+ Coverage      83.0%   92.3%   +9.2%     
- Complexity       42      47      +5     
==========================================
  Files             5       5             
  Lines           142     104     -38     
  Branches         20      13      -7     
==========================================
- Hits            118      96     -22     
+ Misses           12       5      -7     
+ Partials         12       3      -9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jabrena
Copy link
Contributor Author

jabrena commented May 16, 2025

image Latest Gradle version doesn´t recommend to compile lower version to Java 17

@stefan-ka
Copy link
Member

I see. I guess we could go from 11 to 17 now.

@jabrena
Copy link
Contributor Author

jabrena commented May 16, 2025

Hi @stefan-ka , this block is never executed:

    public static void main(String[] args) {
        int javaVersion = Runtime.version().feature();

        if (Runtime.version().feature() >= REQUIRED_JAVA_VERSION) {
            new ContextMapperCLI().run(args);
        } else {
            System.out.printf("Invalid Java version '%s' (>=%s is required).", javaVersion, REQUIRED_JAVA_VERSION);
            System.exit(1);
        }
    }

If you have a lower java version and you try to execute the jar, you will receive the following message:

sdk use java 11.0.27-tem
Using java version 11.0.27-tem in this shell.

java -jar build/libs/context-mapper-cli-0.1.0-SNAPSHOT.jar
Error: Se ha producido un error de enlace al cargar la clase principal org.contextmapper.cli.ContextMapperCLI
        java.lang.UnsupportedClassVersionError: org/contextmapper/cli/ContextMapperCLI has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0

The message about "Invalid Java version" will be not reached in any case. The issue is raised at JVM level.
Can I remove that logic? (The java version check)

Note: I am trying to simplify the code to increase the Code Coverage BTW :)

Juan Antonio

@stefan-ka
Copy link
Member

Hi Juan Antonio

Yes, I guess you are right. I just tried to remember why we introduced that... I think we once checked an lower and upper boundary there because Xtext did not support Java versions >17 for some time: #10

But then I removed the upper boundary check and did not realize that the lower boundary check does not make sense. At least when we compile with same source and target version; what we currently do.

So, yes, feel free to remove it.

Best regards,
Stefan

@jabrena
Copy link
Contributor Author

jabrena commented May 16, 2025

Hi @stefan-ka ,

The cli development has few classes, can i move all classes to the main package?

image

Conceptually, the main class has 2 commands and later a bit of logic, but everything could be in the same package:

package org.contextmapper.cli

Can I flat a bit the structure?

After that change, we could merge IMHO. :)

Juan Antonio

@stefan-ka
Copy link
Member

Hi @stefan-ka ,

The cli development has few classes, can i move all classes to the main package?
image

Conceptually, the main class has 2 commands and later a bit of logic, but everything could be in the same package:

package org.contextmapper.cli

Can I flat a bit the structure?

After that change, we could merge IMHO. :)

Juan Antonio

Sure @jabrena, fine for me. Looks good!

Stefan

@jabrena jabrena marked this pull request as ready for review May 20, 2025 15:16
@jabrena
Copy link
Contributor Author

jabrena commented May 20, 2025

Hi @stefan-ka ,
I did this small change, it is your turn to review the whole changes and merge, this small is tiny.

  • Do you like the evolution?
  • Do you feel confortable to maintain it later?

Cheers

Juan Antonio

@stefan-ka stefan-ka merged commit b819362 into ContextMapper:master Jun 13, 2025
5 checks passed
@jabrena jabrena deleted the feature/picocli2 branch June 16, 2025 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants