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

Add missing input for CopyJsp and missing onlyIf config for WriteDependenciesFile #213

Merged
merged 4 commits into from
Jul 18, 2024

Conversation

labkey-susanh
Copy link
Contributor

Rationale

The previous PR failed to configure the CopyJsp task properly so changes to individual Jsp files were not being picked up (not sure this change to requiring the use of FileSystem injection is altogether a good thing...).

The previous PR also failed to prevent the WriteDependenciesFile task from running when a module, such as a file-based module, has no dependencies to write about.

Related Pull Requests

Changes

  • Add InputDirectory for CopyJsp task
  • Add onlyIf config for WriteDependenciesFile task

Copy link
Member

@labkey-tchad labkey-tchad left a comment

Choose a reason for hiding this comment

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

One question

Comment on lines 44 to 50
task.externalDependencies.set(project.extensions.findByType(ModuleExtension.class).getExternalDependencies())
task.onlyIf {
return !task.externalDependencies.get().isEmpty()
}
} catch (UnknownDomainObjectException ignore) {

}
Copy link
Member

Choose a reason for hiding this comment

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

Would an UnknownDomainObjectException cause this task to run when it shouldn't since task.onlyIf {...} won't be reached?
Should the onlyIf just be baked into WriteDependenciesFile, similar to InstallRPackage?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Technically, that's two questions. 😄, but they are both good questions, so I'll let it slide.

Effectively, it won't happen anymore that the exception is thrown since the configuration is created more broadly, but still a good idea to check. I had assumed Gradle wouldn't like the onlyIf inside the class, but that's cleaner, so I'll try it.

Copy link
Member

Choose a reason for hiding this comment

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

There is no escape from off-by-one errors 😰

@labkey-susanh labkey-susanh merged commit 5c80c1d into develop Jul 18, 2024
1 check passed
@labkey-susanh labkey-susanh deleted the fb_fixCopyJsp branch July 18, 2024 19:41
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.

2 participants