if (!packs.isEmpty()) {
removeFromResource(packs);
proxifyExternalReferences(packs);
XtextResourceSet resourceSet = getNsUriMappingResourceSet();
Resource ePackages = createResourceForEPackages(copiedGrammar, ctx, packs, resourceSet);
<BUG>List<GenPackage> genPackages = getGenPackagesForPackages(getReferencedEPackages(packs));</BUG>
if (!skipGenerate) {
<BUG>GenModel genModel = getSaveAndReconcileGenModel(resourceSet, copiedGrammar, ctx, packs, genPackages);
genModel.reconcile();</BUG>
doGenerate(genModel);

if (!packs.isEmpty()) {
removeFromResource(packs);
proxifyExternalReferences(packs);
XtextResourceSet resourceSet = getNsUriMappingResourceSet();
Resource ePackages = createResourceForEPackages(copiedGrammar, ctx, packs, resourceSet);
if (!skipGenerate) {
GenModel genModel = getSaveAndReconcileGenModel(resourceSet, copiedGrammar, ctx, packs);
genModel.reconcile();
doGenerate(genModel);
