Giter Site home page Giter Site logo

Comments (5)

sormuras avatar sormuras commented on July 17, 2024 2

Looks very good to me!

java -jar junit-platform-console-standalone-1.11.0-20240516.144734-223.jar --version

JUnit Platform Console Launcher 1.11.0-SNAPSHOT
JVM: 23-ea (Oracle Corporation OpenJDK 64-Bit Server VM 23-ea+21-1723)
OS: Windows 11 10.0 amd64

from junit5.

sbrannen avatar sbrannen commented on July 17, 2024 1

@sormuras, can you please create a new issue to address that in 5.11 M3?

from junit5.

marcphilipp avatar marcphilipp commented on July 17, 2024

There's support for version options in Picocli: https://picocli.info/#_version_help

from junit5.

sormuras avatar sormuras commented on July 17, 2024

Related option already in place: --list-engines

from junit5.

sormuras avatar sormuras commented on July 17, 2024

However, running junit on the module path does not look so good to me.

org.junit.platform.console/[email protected] --version

JUnit Platform Console Launcher null
JVM: 22.0.1 (Oracle Corporation OpenJDK 64-Bit Server VM 22.0.1+8-16)
OS: Windows 11 10.0 amd64

This

return ManifestVersionProvider.class.getPackage().getImplementationVersion();

returns null.

We should fist try a ModuleVersionProvider on Java 9+, like we do here:

default Optional<String> getVersion() {
Optional<String> standalone = PackageUtils.getAttribute(getClass(), "Engine-Version-" + getId());
if (standalone.isPresent()) {
return standalone;
}
String fallback = "DEVELOPMENT";
Optional<String> moduleVersion = ModuleUtils.getModuleVersion(getClass());
if (moduleVersion.isPresent()) {
return moduleVersion;
}
return Optional.of(PackageUtils.getAttribute(getClass(), Package::getImplementationVersion).orElse(fallback));
}

And resort to a non-null fallback value.

from junit5.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.