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

compiler.groovy (revision 1804)
454 454
			return false;
455 455
		}
456 456
		
457
		CorpusBuild corpus = project.getCorpusBuild(project.getName());
457
		CorpusBuild corpus = project.getCorpusBuild(project.getName(), MainCorpus.class);
458 458
		if (corpus != null) {
459
			//println "CLEAN PREVIOUS CORPUS"
460
			corpus.delete(); // remove old files
459
			if (project.getDoUpdate()) {
460
				corpus.clean(); // remove old files
461
			} else {
462
				corpus.delete(); // remove old files and TXMResult children
463
			}
464
		} else {
465
			corpus = new MainCorpus(project);
466
			corpus.setID(project.getName());
467
			corpus.setName(project.getName());
461 468
		}
462
		
463
		// make new one
464
		corpus = new MainCorpus(project);
465
		corpus.setID(project.getName());
466
		corpus.setName(project.getName());
467 469
		corpus.setDescription("Built with the XML/w import module");
468 470
		
469 471
		File cqpFile = new File(binDir,"cqp/"+corpusname+".cqp");

Also available in: Unified diff