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

[question] Switch from maven to gulp-exist? #4

Closed
line-o opened this issue Feb 6, 2021 · 16 comments · Fixed by #16
Closed

[question] Switch from maven to gulp-exist? #4

line-o opened this issue Feb 6, 2021 · 16 comments · Fixed by #16
Labels
enhancement New feature or request

Comments

@line-o
Copy link
Member

line-o commented Feb 6, 2021

Library development in existdb can be a tad more comfortable when using gulp-exist as
packaging an installation can be automated. So in combination with file watchers this is a
powerful combination. That would also allow to run the tests from the command line with
npm test or gulp test.

With that setup we could also setup CI/CD for this project.

Libraries already using the setup described above:

  • existsolutions/jwt
  • e-editiones/roaster
  • line-o/xbow
@line-o line-o added the enhancement New feature or request label Feb 6, 2021
@joewiz
Copy link
Member

joewiz commented Feb 6, 2021

I'm agnostic/pragmatic about build machinery, but test integration would be an improvement for us, as we have tests in this repository, but mvn test currently reports:

No tests to run.

@duncdrum mentioned this in #1. I had to run the tests manually in eXide before submitting my PR.

I should note that https://github.com/eXist-db/generator-exist now generates the files needed for GitHub Actions to automatically run tests. (I just used it for the first time on a new project, https://github.com/joewiz/airtable.xq, and GitHub Actions ran on every commit; though I don't have any tests in source control yet, as noted in joewiz/airtable.xq#1.)

@duncdrum
Copy link
Contributor

duncdrum commented Feb 6, 2021

We could hook up mvn Test in the same way as we did for the documentation app. But that relies on node, which would be an extra dependency over here, as opposed to the documentation app.

@line-o
Copy link
Member Author

line-o commented Feb 8, 2021

So I see one vote by reaction emoji. @adamretter care to elaborate why you are against a setup that is more comfortable to develop with?

@adamretter
Copy link
Contributor

adamretter commented Feb 8, 2021

@line-o eXist-db is a Java project. Whilst there is no Java or JavaScript in this project, the mvn approach reuses the existing build tools of eXist-db. Switching this to Gulp/Node, only makes the build tool different, it involves adding more tools like node and gulp into a stack. Node and Gulp are only comfortable (easier) to those that already use them for other projects.

Not all the core-developers are JavaScript developers, but they are all Java developers and familiar with mvn (as that is already used by eXist-db itself).

@line-o
Copy link
Member Author

line-o commented Feb 8, 2021

Thanks for your answer. I do differentiate between exist-db, where I agree it is a java project, and anything built on top of it. A library or application that is purely XQuery does not need to have maven but can freely choose. Especially in situations where switching does offer more features.
I do not see any plus in sticking with maven other than familiarity and that could have and was the slowing factor in migrating from ant.

@line-o
Copy link
Member Author

line-o commented Feb 8, 2021

There is two key-features missing with maven:

  • test-integration
  • instant update on library content change

@adamretter
Copy link
Contributor

Both can be added without switching the build tool

@line-o
Copy link
Member Author

line-o commented Feb 8, 2021

Sure it can, but is there a working example setup?

@adamretter
Copy link
Contributor

Yes. I think @duncdrum named one on the last CC

@line-o
Copy link
Member Author

line-o commented Feb 8, 2021

This is not a particularly good example since it is not a library, the test-integration is using node and not maven or ant or any java and does not syncing to the database while developing, as far as I can tell.

@joewiz
Copy link
Member

joewiz commented Oct 25, 2021

With #7 local and CI test integration is added via maven. I don't think we have "instant library update on content change" yet, but if we find a representative maven project that could serve as a model, perhaps we could incorporate that here.

@adamretter
Copy link
Contributor

instant library update on content change

Sorry @joewiz but... what does that mean?

@line-o
Copy link
Member Author

line-o commented Oct 25, 2021

When developing a package or library it is very convenient to immediately be able to see the changes in a running exist-db instance. gulp-exist does offer this feature even for libraries, which otherwise is only possible by re-installing the package.

@adamretter
Copy link
Contributor

@line-o Okay how does Gulp Exist do that? I ask because I could likely do the same process (if it makes sense) from Maven

@line-o
Copy link
Member Author

line-o commented Oct 25, 2021

Watch for filechanges, then rebuild and install.

@adamretter
Copy link
Contributor

Note to self - gulp-exist requires you to have an instance of eXist-db up and running somewhere else which it then communicates with using XML-RPC. This isn't ideal as the user has to (1) setup and prepare a separate version of eXist-db, and then (2) also provide the connection URL and credentials.

With Maven we could instead do one of two things:

  1. Produce an existdb-maven-plugin which is similar in principle to jetty-maven-plugin, that allows eXist-db to be started/stopped from Maven with custom execution ids.
  2. Use the docker-maven-plugin that starts an eXist-db image in using a custom execution id and mounts a pre-prepared data/expathrepo/semver-${version} folder. There should also be a custom execution id to stop the image.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants