Unconstant Conjunction latest posts

Building Libnoise on OS X

    29 September 2013 // tagged

Although it is very old (and unmaintained since 2007), Libnoise is a great library for procedural generation of pseudorandom noise. It provides a wonderfully intuitive way of chaining together various layers and styles of noise that I’ve never seen matched, even in newer implementations. It also supports seeds (which I require), and is largely feature-complete. I’ve used some of the Java and XNA ports in the past, but in the last few days started getting interested in using the original C++ code, partly because I’m wondering if it can be converted into a Python extension.

Continue Reading →

Logic in Maven Archetypes

Time for a real first post. Recently, I’ve been working on creating a Maven archetype for a certain open-source project, and discovered to my delight that archetypes actually support a limited kind of logic. If it’s not immediately obvious why that would be useful, consider that you can make use of this logic to, for example, optionally add a dependency based on a custom parameter.

Making use of the fact that Maven builds its archetypes using Apache’s Velocity template engine, you can embed statements reminiscent of C-style preprocessor directives in any file in the archetype. To add an optional dependency, try embedding the logic below in the pom.xml file

<dependencies>
	...
#if (${includeNetty} == 'true' || ${includeNetty} == 'yes' || ${includeNetty} == 'y')
	<dependency>
		<groupId>io.netty</groupId>
		<artifactId>netty</artifactId>
		<version>3.4.6.Final</version>
		<scope>compile</scope>
	</dependency>
#end
</dependencies>
Continue Reading →