plugins {
	id 'de.undercouch.download' version '3.3.0'
}

sourceSets.main.java.srcDir 'src'


////////////////////////////////////////////////////////////////////////
//
//  download JLex
//

import de.undercouch.gradle.tasks.download.*

def versionedArchive = 'ajaxslt-0.8.1'
def packedArchive = "${versionedArchive}.tar.gz"

task downloadJLex(type: Download) {
	src "http://www.cs.princeton.edu/~appel/modern/java/JLex/current/Main.java"
	dest 'src/JLex/Main.java'
	overwrite false
}

task verifyJLex(type: Verify, dependsOn: downloadJLex) {
	src downloadJLex.dest
	checksum 'fe0cff5db3e2f0f5d67a153cf6c783af'
}

clean {
	delete downloadJLex.dest.parent
}

compileJava.dependsOn verifyJLex
