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

compiler.groovy (revision 1804)
177 177
		File txmDir = new File(binDir, "txm/"+corpusname)
178 178
		
179 179
		if (!(CwbEncode.isExecutableAvailable() && CwbMakeAll.isExecutableAvailable())) {
180
			println ("Error: CWB executables rights are not well setted.")
180
			println ("Error: CWB executable rights are not well setted.")
181 181
			return false;
182 182
		}
183 183
		
184
		CorpusBuild corpus = project.getCorpusBuild(project.getName());
184
		CorpusBuild corpus = project.getCorpusBuild(project.getName(), MainCorpus.class);
185 185
		if (corpus != null) {
186
			//println "CLEAN PREVIOUS CORPUS"
187
			corpus.delete(); // remove old files
186
			if (project.getDoUpdate()) {
187
				corpus.clean(); // remove old files
188
			} else {
189
				corpus.delete(); // remove old files and TXMResult children
190
			}
191
		} else {
192
			corpus = new MainCorpus(project);
193
			corpus.setID(project.getName());
194
			corpus.setName(project.getName());
188 195
		}
189
			
190
		// make new one
191
		corpus = new MainCorpus(project);
192
		corpus.setID(project.getName());
193
		corpus.setName(project.getName());
194 196
		corpus.setDescription("Built with the TXT+CSV import module");
195 197
		
196 198
		File cqpFile = new File(binDir,"cqp/"+corpusname+".cqp");

Also available in: Unified diff