Skip to content

#25 Cross build the project for springdoc-openapi v2.x #27

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

Merged
merged 18 commits into from
Jan 8, 2024

Conversation

jakipatryk
Copy link
Collaborator

@jakipatryk jakipatryk commented Jan 4, 2024

  • used sbt-projectmatrix to cross-build the library
  • reorganised directories structure to support sbt-projectmatrix, now library code is in /library folder
  • now library produces 4 artifacts:
    • for springdoc-openapi v1.x: springdoc-openapi-scala-1_2.12, springdoc-openapi-scala-1_2.13
    • for springdoc-openapi v2.x: springdoc-openapi-scala-2_2.12, springdoc-openapi-scala-2_2.13
  • changed version of Java in CI as it is needed for springdoc-openapi-scala-2 build now
  • changed Jacoco CI to add reports for springdoc-openapi-scala-1 and springdoc-openapi-scala-2
  • moved example project from main SBT totally to have its own build.sbt etc.
  • forked simple example into two: one for springdoc-openapi-scala-1 and one for springdoc-openapi-scala-2, they are nearly the same but have different dependencies and example for springdoc-openapi-scala-2 has more things (enum, empty endpoint)
  • updated README

Closes #25

Copy link

github-actions bot commented Jan 5, 2024

JaCoCo code coverage report - springdoc-openapi-scala-1

Overall Project 95.59% -0.9% 🍏
Files changed 26.09%

File Coverage
OpenAPISScalaCustomizer.scala 100% 🍏
OpenAPIModelRegistration.scala 97.53% 🍏
Bundle.scala 0% -44.74%

Copy link

github-actions bot commented Jan 5, 2024

JaCoCo code coverage report - springdoc-openapi-scala-2

Overall Project 95.59% -0.9% 🍏
Files changed 26.09%

File Coverage
OpenAPISScalaCustomizer.scala 100% 🍏
OpenAPIModelRegistration.scala 97.53% 🍏
Bundle.scala 0% -44.74%

@jakipatryk jakipatryk marked this pull request as ready for review January 5, 2024 11:43
Copy link
Contributor

@kevinwallimann kevinwallimann left a comment

Choose a reason for hiding this comment

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

  • read code
  • built locally
  • used locally in different project as a dependency

lazy val root = (project in file("."))
.settings(
libraryDependencies ++= Seq(
"za.co.absa" %% "springdoc-openapi-scala-1" % "0.2.0-SNAPSHOT",
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the version should be parameterized, otherwise you'll have to change it manually for every release. Also, it seems like the main build.sbt doesn't contain a version number?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In main build.sbt the sbt-ci-release takes care of the version.

I'll think how to parametrise the lib version in example projects.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I haven't managed to parametrize it the way I wanted (to have dynamic version passed by default), but I changed the code in #a5733e9221d1e70a3e25abc164c1fcc3a22c5b83 to be "good enough" in my opinion (version is not directly hardcoded).

I tried to use sbt-dynver and its dynver task (it is used in sbt-ci-release), but I always ended up with an error that "Setting cannot depend on task".

@kevinwallimann
Copy link
Contributor

In general, it would be nice to provide build and run commands for the example projects as well, but this can be a separate PR

dk1844
dk1844 previously approved these changes Jan 5, 2024
Copy link

@dk1844 dk1844 left a comment

Choose a reason for hiding this comment

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

Pretty cool, I was just thinking if the artifact name communicates well that the number is the parametrized version of OpenAPI - so e.g. if instead springdoc-openapi-scala-1_2.13, if not use one of:
springdoc-openapi-scala_1_2.13
springdoc-openapi-scala-openapi-1_2.13
(just thinking, but I am not sure if the sbt-projectmatrix plugin allows such level of customization)

@jakipatryk
Copy link
Collaborator Author

Pretty cool, I was just thinking if the artifact name communicates well that the number is the parametrized version of OpenAPI - so e.g. if instead springdoc-openapi-scala-1_2.13, if not use one of:
springdoc-openapi-scala_1_2.13
springdoc-openapi-scala-openapi-1_2.13
(just thinking, but I am not sure if the sbt-projectmatrix plugin allows such level of customization)

I think it would be possible, though it would probably have to be something like springdoc-openapi-scala_springdoc-openapi-1_2.13 as springdoc-openapi-scala-openapi-1_2.13 might suggest that its OpenAPI version 1 not springdoc-openapi version 1.

I decided to not use springdoc-openapi-scala_springdoc-openapi-1_2.13 as it is too repetitive and long.

What about springdoc-openapi-scala_1_2.13? Why do you prefer this one vs springdoc-openapi-scala-1_2.13?

@jakipatryk jakipatryk requested a review from dk1844 January 8, 2024 08:06
@dk1844
Copy link

dk1844 commented Jan 8, 2024

Pretty cool, I was just thinking if the artifact name communicates well that the number is the parametrized version of OpenAPI - so e.g. if instead springdoc-openapi-scala-1_2.13, if not use one of:
springdoc-openapi-scala_1_2.13
springdoc-openapi-scala-openapi-1_2.13
(just thinking, but I am not sure if the sbt-projectmatrix plugin allows such level of customization)

I think it would be possible, though it would probably have to be something like springdoc-openapi-scala_springdoc-openapi-1_2.13 as springdoc-openapi-scala-openapi-1_2.13 might suggest that its OpenAPI version 1 not springdoc-openapi version 1.

I decided to not use springdoc-openapi-scala_springdoc-openapi-1_2.13 as it is too repetitive and long.

What about springdoc-openapi-scala_1_2.13? Why do you prefer this one vs springdoc-openapi-scala-1_2.13?

I understand, that some of the longer options would make things more clear for the price of repetitiveness.
springdoc-openapi-scala_1_2.13 seems good for it clearly separates the base name from the version suffixes (open API version being one of them, scala version being another).

It seems that you directly configure the way the name is created in https://github.com/AbsaOSS/springdoc-openapi-scala/pull/27/files#diff-a68c8c1a39b5aef73e0465ec46ceee9a832e943120828a681e13d11d988257dbR25-R26

However, I am not strongly opposing the current outcome, it would do. I am just trying to look for possible improvements.

@jakipatryk jakipatryk merged commit 120da66 into main Jan 8, 2024
@jakipatryk jakipatryk deleted the feature/25-cross-build-for-springdoc-openapi-2 branch January 8, 2024 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cross-build the library for springdoc-openapi 2.x
3 participants