-
Notifications
You must be signed in to change notification settings - Fork 219
Generate a Versions file to be consumed at runtime #1667
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package io.javaoperatorsdk.operator.api.config; | ||
|
||
public final class Versions { | ||
|
||
private Versions() {} | ||
|
||
protected static final String JOSDK = "${project.version}"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you pls enlighten me how this supposed to work? Where are those placeholders filled? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This file is filled by the Maven Plugin as it is in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. would it be possible to write a unit test for this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done here: 52643d3 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. great, thx! |
||
protected static final String KUBERNETES_CLIENT = "${fabric8-client.version}"; | ||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package io.javaoperatorsdk.operator.api.config; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
|
||
public class VersionTest { | ||
|
||
@Test | ||
void versionShouldReturnTheSameResultFromMavenAndProperties() { | ||
String versionFromProperties = Utils.loadFromProperties().getSdkVersion(); | ||
String versionFromMaven = Version.UNKNOWN.getSdkVersion(); | ||
|
||
assertEquals(versionFromProperties, versionFromMaven); | ||
} | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To fill in the information that is available in Maven.