Revision 1804 tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/xmltxm/compiler.groovy

compiler.groovy (revision 1804)
354 354
			println ("Error: CWB executables not well set.")
355 355
			return false;
356 356
		}
357
		CorpusBuild corpus = project.getCorpusBuild(project.getName());
357
		CorpusBuild corpus = project.getCorpusBuild(project.getName(), MainCorpus.class);
358 358
		if (corpus != null) {
359
			//println "CLEAN PREVIOUS CORPUS"
360
			corpus.delete(); // remove old files
359
			if (project.getDoUpdate()) {
360
				corpus.clean(); // remove old files
361
			} else {
362
				corpus.delete(); // remove old files and TXMResult children
363
			}
364
		} else {
365
			corpus = new MainCorpus(project);
366
			corpus.setID(project.getName());
367
			corpus.setName(project.getName());
361 368
		}
362
			
363
		// make new one
364
		corpus = new MainCorpus(project);
365
		corpus.setID(project.getName());
366
		corpus.setName(project.getName());
367 369
		corpus.setDescription("Built with the XML-TXM import module");
368 370
		
369 371
		File cqpFile = new File(binDir,"cqp/"+corpusname+".cqp");

Also available in: Unified diff