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

Update to use Daffodil SBT plugin #7

Merged
merged 1 commit into from
May 1, 2024

Conversation

stevedlawrence
Copy link
Member

Also changes the default to be namespaced, non-namespaced should only be used for testing or examples

namespaced=no
daffodil_version=maven(org.apache.daffodil, daffodil-tdml-processor_2.12)
namespaced=yes
daffodil_plugin_version=maven(org.apache.daffodil, sbt-daffodil)
Copy link
Member Author

Choose a reason for hiding this comment

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

Note that this now initializes "sbt new" projects with the latest version of the sbt-daffodil plugin available in maven (e.g. 1.0.0 once it's released) instead of the latest version of daffodil TDML processor available in maven. This way the new project will use whatever Daffodil version that plugin defaults to (current 3.7.0).

We could additionally get the latest version of daffodil and add something like daffodilVersion := $daffodil_version$ to the build.sbt template, which would pin the project to that specific daffodil version. But I kind of like the idea that updating to the latest version of the plugin automatically gets you the latest version of Daffodil. And only if your project really depends on a specific version should you pin it by manually setting daffodilVersion in build.sbt.

Thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

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

Only further alternative would be have the template include

// the daffodil version is taken from the daffodil-sbt plugin by default. 
// to fix it to a specific version, uncomment
// daffodilVersion := "3.7.0" // for the version you require

But there's lots of guidance needed about various things one might need in the build.sbt, and
we don't want to clutter the template too much.
Maybe just

// the daffodil sbt plugin provides many options
// which are documented here ... link ....

Copy link
Contributor

Choose a reason for hiding this comment

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

When this gets released, updating all existing schema projects to use this will help a lot by getting rid of the unnecessary library dependencies like log4j.

Copy link
Member Author

Choose a reason for hiding this comment

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

I like the idea of adding a link to the daffodil sbt plugin documentation, I'm afraid anything we put in here will eventually get outdated

Copy link
Member Author

Choose a reason for hiding this comment

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

When this gets released, updating all existing schema projects to use this will help a lot by getting rid of the unnecessary library dependencies like log4j.

I've already started this process, it's definitely making things a lot cleaner and regression testing different daffodil versions is much simpler. Now we can do something like sbt 'set daffodilVersion := "3.7.0"' test, so no need to manually update libraryDependency versions like we do now.

Copy link

@tuxji tuxji left a comment

Choose a reason for hiding this comment

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

+1

Copy link
Contributor

@mbeckerle mbeckerle left a comment

Choose a reason for hiding this comment

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

+1

namespaced=no
daffodil_version=maven(org.apache.daffodil, daffodil-tdml-processor_2.12)
namespaced=yes
daffodil_plugin_version=maven(org.apache.daffodil, sbt-daffodil)
Copy link
Contributor

Choose a reason for hiding this comment

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

When this gets released, updating all existing schema projects to use this will help a lot by getting rid of the unnecessary library dependencies like log4j.

Also changes the default to be namespaced, non-namespaced should only be
used for testing or examples
@stevedlawrence stevedlawrence merged commit bf6755f into apache:main May 1, 2024
3 checks passed
@stevedlawrence stevedlawrence deleted the daffodil-sbt branch May 1, 2024 11:10
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