Skip to content

[EWT-567] Version info management simplification#293

Merged
dili91 merged 4 commits intomainfrom
version-info-loader-simplification
Jun 13, 2024
Merged

[EWT-567] Version info management simplification#293
dili91 merged 4 commits intomainfrom
version-info-loader-simplification

Conversation

@dili91
Copy link
Contributor

@dili91 dili91 commented Jun 13, 2024

We recently had an incompatibility issue with Kotlin projects because of the way we load the file used to propagate library-version related informations to Java code. It turns out that the relying on getResourceAsStream abstracts away the underlying file system details and works uniformly across different environments.

@swarmia
Copy link

swarmia bot commented Jun 13, 2024

✅  Linked to Bug EWT-567 · Java lib - compatibility issue with Kotlin

@dili91 dili91 force-pushed the version-info-loader-simplification branch from c136af0 to fe8c5f5 Compare June 13, 2024 09:26
task createProperties(dependsOn: processResources) {
doLast {
new File("$buildDir/resources/main/truelayer-java.version.properties").withWriter { w ->
file("${layout.buildDirectory.get()}/resources/main/truelayer-java.version.properties").withWriter { w ->
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this helps us getting rid of a deprecation warning

.getClassLoader()
.getResource(CONFIG_FILE_PREXIF + "." + "version" + ".properties"))
.getPath())));
versionInfoProps.load(getClass()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method directly returns an InputStream, which is suitable for reading resources from the classpath, including resources inside JAR files. This approach abstracts away the underlying file system details and works uniformly across different environments.

@dili91 dili91 marked this pull request as ready for review June 13, 2024 13:51
@dili91 dili91 requested a review from a team as a code owner June 13, 2024 13:51
@dili91 dili91 requested a review from a team June 13, 2024 13:51
@dili91 dili91 merged commit ae59b84 into main Jun 13, 2024
@dili91 dili91 deleted the version-info-loader-simplification branch June 13, 2024 14:56
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