Skip to content

Instantly share code, notes, and snippets.

@snreid
Last active August 29, 2015 14:07
Show Gist options
  • Save snreid/788e9d14803eefc6dbfd to your computer and use it in GitHub Desktop.
Save snreid/788e9d14803eefc6dbfd to your computer and use it in GitHub Desktop.
ArchivesSpace include plugin in scripts/build_release

If you have to build a new release of ArchivesSpace, and have a custom plugin that you want to include in that build (so you don't have to manually copy and paste it in) here's how to do it.

In the build/ directory there is a file called build.xml. This controls a lot of stuff when you build a release, including which plugins are added to the zipped end result.

There are 'mkdir' commands that are executed and included in the release. For us this is around line 400 of this build.xml file, just after this text

...
<!-- Dist build -->
<target name="build-zip" depends="set-classpath"
description="Bundle everything up into a zip file">
...
<mkdir dir="target/archivesspace/plugins/lcnaf" />

You can add another line anywhere around there to create the directory for your plugin in the release.

<mkdir dir="target/archivesspace/plugins/your_plugin" />

So, now that you have a directory for your plugin, you have to copy in the actual contents of your plugin into that directory. This will be in a line a little further down in build.xml (for us it's around line 550).

<copy todir="target/archivesspace/plugins/lcnaf">
  <fileset dir="../plugins/lcnaf"/>
</copy>

Again, you can just copy-pasta those three lines and switch out the name of the plugin to your custom one:

<copy todir="target/archivesspace/plugins/your_plugin">
  <fileset dir="../plugins/your_plugin"/>
</copy>

Note on how we stumbled along this discovery: I don't actually know much about implementing a build.xml. We just wanted to find out how the LCNAF plugin was being included in a release and our custom one wasn't. So, we did `grep -r lcnaf .' in our archivesspace project, had a notion of what the build.xml was for, and copy-pasted swapping out plugin directory names just as the instructions above show.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment