Skip to content
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

Condense packaged JSON resources during the build phase #2860

Closed
wants to merge 2 commits into from

Conversation

lmsurpre
Copy link
Member

@lmsurpre lmsurpre commented Oct 15, 2021

In the past, we kept these resources in their condensed / non-pretty
format, but that made it hard to review changes and so we recently
converted them to their pretty-printed flavor instead.

The problem there is that the extra whitespace leads to a noticable size
difference for the jars.

On my system, removing this excess whitespace during the build
reduces the size between 16% and 18% for the IGs and almost 10% for the
fhir-registry that contains the base resources.

carin-bb: 933,281 to 766,640
us-core: 1,443,884 to 1,212,573
fhir-registry: 19,585,400 to 17,758,332

Signed-off-by: Lee Surprenant [email protected]

@lmsurpre lmsurpre requested a review from prb112 October 15, 2021 19:30
@lmsurpre lmsurpre force-pushed the c4bb-ig-patch branch 4 times, most recently from 7c455e1 to a274aa7 Compare October 15, 2021 20:51
<artifactId>jakarta.json</artifactId>
<version>2.0.1</version>
<version>1.0.0</version>
</dependency>
Copy link
Contributor

Choose a reason for hiding this comment

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

what about javadocs? no automation update done for that?

In the past, we kept these resources in their condensed / non-pretty
format, but that made it hard to review changes and so we recently
converted them to their pretty-printed flavor instead.

The problem there is that the extra whitespace leads to a noticable size
difference for the jars.

On my system, removing this excess whitespace during the build
reduces the size between 10 and 18%:

carin-bb:          933,281 to 766,640
us-core:         1,443,884 to 1,212,573
fhir-registry:  19,585,400 to 17,758,332

Signed-off-by: Lee Surprenant <[email protected]>
we don't actually publish the javadoc for fhir-tools, but we still need to build it (at least until
its usage is hidden behind a profile)

Signed-off-by: Lee Surprenant <[email protected]>
Copy link
Collaborator

@punktilious punktilious left a comment

Choose a reason for hiding this comment

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

LGTM

lmsurpre added a commit that referenced this pull request Oct 18, 2021
In #2860 I added the condense-json action to the build section
of each project where we want it.

The problem with that is it requires everyone to have a built copy of the fhir-tools project
in order for our fhir-parent build to be successful.

This PR updates the approach by introducing a build profile in fhir-parent (and fhir-examples)
for controlling whether to strip the formatting of **all** JSON resources across all modules.

Additionally, this PR adds this new profile to a select few of the CI actions *and* our release action
(so that the release jars will benefit from the savings).

Signed-off-by: Lee Surprenant <[email protected]>
lmsurpre added a commit that referenced this pull request Oct 18, 2021
In #2860 I added the condense-json action to the build section
of each project where we want it.

The problem with that is it requires everyone to have a built copy of the fhir-tools project
in order for our fhir-parent build to be successful.

This PR updates the approach by introducing a build profile in fhir-parent (and fhir-examples)
for controlling whether to strip the formatting of **all** JSON resources across all modules.

Additionally, this PR adds this new profile to a select few of the CI actions *and* our release action
(so that the release jars will benefit from the savings).

Signed-off-by: Lee Surprenant <[email protected]>
@lmsurpre
Copy link
Member Author

I'm closing this in favor of #2864. By moving the condense-json action to a parent-level profile of the same name:

  1. our builds can continue to work without forcing us to release fhir-tools (and without making everyone build+install fhir-tools before they can execute our main build)
  2. we can still benefit from the size savings across the board
  3. we won't need to define the build action/profile in each and every ig project as we update them to the new standard of keeping the source pretty-printed

@lmsurpre lmsurpre closed this Oct 18, 2021
@prb112 prb112 deleted the c4bb-ig-patch branch January 27, 2022 15:56
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.

3 participants