Commit 02365249 authored by Marco Konersmann's avatar Marco Konersmann

Adds a warning when no activation transformation for a profile exists.

parent 970ef36b
......@@ -6,14 +6,18 @@ import org.codeling.interprofile.IInterprofileTransformation;
import org.codeling.lang.base.modeltrans.henshin.HenshinTransformation;
import org.codeling.languageregistry.LanguageDefinition;
import org.codeling.transformationmanager.TransformationResult;
import org.codeling.utils.CodelingLogger;
import org.codeling.utils.IDRegistry;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
public class InterProfileTransformation implements IInterprofileTransformation {
CodelingLogger log = new CodelingLogger(this.getClass());
@Override
public TransformationResult transform(LanguageDefinition sourceLanguage, LanguageDefinition targetLanguage,
List<EObject> priorModelRoots, IDRegistry priorIdRegistry, String taskName,
......@@ -42,6 +46,12 @@ public class InterProfileTransformation implements IInterprofileTransformation {
monitor.setWorkRemaining(sourceToTargetTransformationURIs.size());
for (final URI transformationURI : sourceToTargetTransformationURIs) {
monitor.setTaskName("Executing " + transformationURI);
if(!new ResourceSetImpl().getURIConverter().exists(transformationURI, null)) {
// No activation file exists.
log.warning("No profile activation transformation exists at the uri "+transformationURI+". I will just ignore that.");
continue;
}
final HenshinTransformation task = new HenshinTransformation(transformationURI, taskName,
intermediateIDRegistry, intermediateModelRoots, monitor);
// Execute task
......
......@@ -30,6 +30,10 @@ public class CodelingLogger {
public void warning(String message, Throwable t) {
addLogEntry(IStatus.WARNING, message, t);
}
public void warning(String message) {
addLogEntry(IStatus.WARNING, message, null);
}
public void error(String message, Throwable t) {
addLogEntry(IStatus.ERROR, message, t);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment