Differences
This shows you the differences between two versions of the page.
— |
guidelines:udk_extension_packages [2012/02/08 12:04] (current) martin.cerny created |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== 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: | ||
+ | |||
+ | 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 | ||
+ | |-udk //contains the actual UDK files | ||
+ | |-target | ||
+ | |-pom.xml | ||
+ | </ | ||
+ | |||
+ | In order to take advantage of all Maven capabilities (filtering, adding version numbers, | ||
+ | |||
+ | Here is an example of a pom.xml for UDK extension for project SpyVsSpy: | ||
+ | |||
+ | <code xml> | ||
+ | |||
+ | |||
+ | <project xmlns=" | ||
+ | xsi: | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | |||
+ | < | ||
+ | < | ||
+ | |||
+ | |||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | < | ||
+ | <!-- The project is pom packaged in order to get rid of JAR output. But we need to | ||
+ | explicitly call resources plugin--> | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | | ||
+ | <!-- Create the zip package --> | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | </ | ||
+ | |||
+ | 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 / | ||
+ | |||
+ | <code xml> | ||
+ | < | ||
+ | xsi: | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ |