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

compiler.groovy (revision 1804)
151 151
			println ("Error: CWB executables not well set.")
152 152
			return false;
153 153
		}
154
		CorpusBuild corpus = project.getCorpusBuild(project.getName());
154
		CorpusBuild corpus = project.getCorpusBuild(project.getName(), MainCorpus.class);
155 155
		if (corpus != null) {
156
			//println "CLEAN PREVIOUS CORPUS"
157
			corpus.delete(); // remove old files
156
			if (project.getDoUpdate()) {
157
				corpus.clean(); // remove old files
158
			} else {
159
				corpus.delete(); // remove old files and TXMResult children
160
			}
161
		} else {
162
			corpus = new MainCorpus(project);
163
			corpus.setID(project.getName());
164
			corpus.setName(project.getName());
158 165
		}
159
			
160
		// make new one
161
		corpus = new MainCorpus(project);
162
		corpus.setID(project.getName());
163
		corpus.setName(project.getName());
164 166
		corpus.setDescription("Built with the CNR+CSV import module");
165 167
		
166 168
		File cqpFile = new File(binDir,"cqp/"+corpusname+".cqp");

Also available in: Unified diff