sourceSets.test.resources.srcDirs = ['examples-src']

task downloadAjaxslt(type: VerifiedDownload) {
	def version = '0.8.1'
	def versionedArchive = "ajaxslt-${version}.tar.gz"
	src "https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/ajaxslt/$versionedArchive"
	dest "$temporaryDir/$versionedArchive"
	checksum 'c995abe3310a401bb4db7f28a6409756'
}

task unpackAjaxslt(type: Sync, dependsOn: downloadAjaxslt) {
	from(tarTree(downloadAjaxslt.dest)) {
		eachFile {
			def newSegments = relativePath.segments[1 .. -1] as String[]
			relativePath new RelativePath(!directory, newSegments)
		}
	}
	into 'examples-src/ajaxslt'
}

clean.dependsOn cleanUnpackAjaxslt

processTestResources.dependsOn(unpackAjaxslt)
