All Downloads are FREE. Search and download functionalities are using the official Maven repository.

astaddgradle.1.10.2.source-code.ModuleDefinitions.groovy Maven / Gradle / Ivy

There is a newer version: 1.13.3
Show newest version
/** Delegate object for JastAdd module definitions. */
class ModuleDefinitions {
	def project
	String directory = ""
	final ModuleLoader loader

	ModuleDefinitions(ModuleLoader loader, project, dir) {
		this.loader = loader
		this.project = project
		this.directory = dir
	}

	/* Declares a module. */
	def module(name, closure) {
		def module = new JastAddModule(name)
		module.basedir = directory
		module.loader = loader
		loader.addModule module
		closure.delegate = module
		closure.resolveStrategy = Closure.DELEGATE_ONLY
		closure()
		module
	}

	/* Includes modules from another directory. */
	def include(moduleDir) {
		loader.load(project, "${directory}/${moduleDir}")
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy