====== UDK extension packages ======
This page describes what is considered best practice. It was written for Pogamut 3.2.5, but should apply seamlessly to future versions. While this approach could be extended to all pogamut variants, it is currently fully implemented only for UDK.
This article was written by Martin Černý
In most cases your Pogamut-UDK project depends on some extension to the UDK, at least on Gamebots for UDK. It is desirable for your Java project to reflect this dependency and allow to install such extensions upon building the project. To achieve this we introduce the concept of **UDK extension packages**.
UDK extension package is simply a zip-packaged Maven artifact, that contains files for the extension, such that they may be extracted directly into the UDK folder. Best practices for installing extensions upon build of your project may be found at [[guidelines:gamebots_maven|Gamebots - Maven article]].
The benefit of this packaging is that you may declare explicit dependency of your project on a concrete version of GameBots or other extension package and let Maven manage such a dependency for you.
===== Creating packages =====
Packages are created as pom-packaged artifacts that employ maven-assembly-plugin to build the zip file.
They follow typical maven project directory structure:
/-|
|-src
|-main
|-assembly //contains the assembly descriptor
|-udk //contains the actual UDK files
|-target //compilation output
|-pom.xml
In order to take advantage of all Maven capabilities (filtering, adding version numbers,...), udk resources are copied to target directory before being added to assembly.
Here is an example of a pom.xml for UDK extension for project SpyVsSpy:
4.0.0
cz.cuni.amis
amis-pom
0.0.1-SNAPSHOT
../AmisPom/pom.xml
cz.cuni.amis.pogamut.spyvsspy
spyvsspy-udk
3.2.5-SNAPSHOT
pom
SpyVsSpy UDK package
http://pogamut.cuni.cz
${basedir}/src/main/udk
${project.build.directory}/udk
org.apache.maven.plugins
maven-resources-plugin
resources
process-resources
org.apache.maven.plugins
maven-assembly-plugin
${basedir}/src/main/assembly/assembly.xml
zip
package
single
Note that if you inherit from amis-pom, you need to add empyt files called : skip.default-jar and skip.source-jars,
otherwise amis-pom will force the creation of binary and source JARS eventhough this is a POM. Project.
A typical content of /src/main/assembly/assembly.xml follows:
false
zip
${project.build.directory}/udk
/