exposed the project version as a system property so we can use it in the tests & generation of the kdoc

This commit is contained in:
James Strachan
2012-03-09 07:30:15 +00:00
parent b5108912ee
commit 8936f45054
5 changed files with 20 additions and 9 deletions
@@ -10,8 +10,8 @@ class GenerateSiteTest : TestCase() {
val srcDir = findTemplateDir()
val siteOutputDir = File(srcDir, "../../../target/site")
// TODO find version from environment?
val versionDir = "snapshot"
val version = System.getProperty("project.version") ?: "SNAPSHOT"
val versionDir = if (version.contains("SNAPSHOT")) "snapshot" else version
fun testGenerateSite(): Unit {
val generator = SiteGenerator(srcDir, siteOutputDir)
@@ -28,7 +28,8 @@ class GenerateSiteTest : TestCase() {
args.setDocOutputDir(outDir.toString())
args.setOutputDir("target/classes-stdlib")
val config = args.docConfig
config.title = "Kotlin API"
config.title = "Kotlin API ($version)"
config.version = version
val compiler = KDocCompiler()
compiler.exec(System.out, args)