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

Produce Maven packages for shared Javascript components #207

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from
Open

Produce Maven packages for shared Javascript components #207

wants to merge 7 commits into from

Conversation

io7m
Copy link

@io7m io7m commented Sep 1, 2015

This change simply adds a Maven POM file that will produce a standard Java jar file that can be deployed to any Maven repository. This allows anyone using Maven (or a build system that uses Maven packages such as Gradle) to add the readium-shared-js components to their application without having to import any sources directly, or use git submodules.

The change is entirely opt-in: If you don't run Maven, you won't see anything new.

@danielweck
Copy link
Member

Thanks @io7m
Would it make sense to also include build-output/_multiple-bundles/* in addition to build-output/_single-bundle/*? (just in case other developers need / want to use distinct RequireJS bundles, without the built-in lightweight Almond AMD loader)
Also, the version specified in pom.xml will have to be kept up to date with the JSON (well, CSON) NPM package definition:
https://github.com/readium/readium-shared-js/blob/develop/package.json#L8
https://github.com/readium/readium-shared-js/blob/develop/package.cson#L36
(we have a build task in readium-js-viewer that maintains the Chrome app version, so we could use something similar in readium-shared-js)

@io7m
Copy link
Author

io7m commented Sep 1, 2015

Yep, there's no technical reason for not adding multiple-bundles, I just sort of assumed that _single-bundle would be the one that everyone used. I think I would add a second pom.xml for those, so the user would pick which one they wanted at compile time.

@io7m
Copy link
Author

io7m commented Sep 1, 2015

Updating the version of the pom.xml file can be achieved with: $ mvn versions:set -DnewVersion=0.21.0.

@danielweck
Copy link
Member

Re. version updating:
in readium-js-viewer, package.cson contains the "master" version that is used to generate / maintain the version in the Chrome app. See:
https://github.com/readium/readium-js-viewer/blob/develop/src/chrome-app/manifest.json#L5
https://github.com/readium/readium-js-viewer/blob/develop/build-config/updateChromeManifest.js

Perhaps mvn versions:set -DnewVersion=x.y.z could be automated in a similar fashion when generating the build-output/* contents of readium-shared-js (i.e. when invoking npm run build).

@rkwright
Copy link
Contributor

Note: Need to review this with respect to updating the versions in the various deliverables

@rkwright
Copy link
Contributor

ACTION: Mark is the owner. He will work with Daniel to ensure we are not introducing conflicts.

Note that there is a dependency on other PRs in SDK, SDK readium/readium-sdk#193

@io7m
Copy link
Author

io7m commented Sep 24, 2015

Ok, I've pushed the changes that were necessary. Currently, the version number is manually set to 0.20.0-alpha to match what's already in readium-shared-js. The POM itself had some metadata updates, as Central has some requirements for artifacts:

http://central.sonatype.org/pages/requirements.html

@io7m
Copy link
Author

io7m commented Sep 24, 2015

I suspect I'll be the one actually pushing the packages to Central, as I'm already set up to do so (have PGP keys, have a Sonatype account, etc).

@danielweck
Copy link
Member

Note that no Readium NPM packages have been published yet to:
https://www.npmjs.com/~readium
(just placeholders at v0.0.0)

More specifically, the POM / Maven build artifacts (single RequireJS / AMD bundles) would eventually match the NPM ones (same "semantic versioning" strings):
https://www.npmjs.com/package/readium-shared-js
...although the NPM ones would include both single and multiple bundles, as per the files directive in package.json:
https://github.com/readium/readium-shared-js/blob/develop/package.cson#L72

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