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

compiler.groovy (revision 1804)
480 480
			//String lang = langs.get(langGroups.get(group)[0]);
481 481
			cqpName = basename+"_"+corpusIDS.get(group);
482 482
			
483
			CorpusBuild corpus = project.getCorpusBuild(cqpName);
484
			if (corpus != null) {
485
				//println "CLEAN PREVIOUS CORPUS"
486
				corpus.delete(); // remove old files
483
		CorpusBuild corpus = project.getCorpusBuild(project.getName(), MainCorpus.class);
484
		if (corpus != null) {
485
			if (project.getDoUpdate()) {
486
				corpus.clean(); // remove old files
487
			} else {
488
				corpus.delete(); // remove old files and TXMResult children
487 489
			}
488
				
489
			// make new one
490
		} else {
490 491
			corpus = new MainCorpus(project);
491
			corpus.setID(cqpName);
492
			corpus.setName(cqpName);
492
			corpus.setID(project.getName());
493
			corpus.setName(project.getName());
494
		}
493 495
			corpus.setDescription("Built with the TMX import module");
494 496
			
495 497
			File cqpFile = new File(binDir,"cqp/"+cqpName+".cqp");

Also available in: Unified diff