EDU-608 Execute "tests.py" action doesn't create Run Study Tests configuration
[idea/community.git] / python / educational-core / course-creator / src / com / jetbrains / edu / coursecreator / CCVirtualFileListener.java
index 36b36d02e09674a524569fadc31db11aed8e181f..eaa45861f1ca2371115a12a5c2d8603fbe57846b 100644 (file)
@@ -14,6 +14,8 @@ import com.jetbrains.edu.learning.courseFormat.Task;
 import com.jetbrains.edu.learning.courseFormat.TaskFile;
 import org.jetbrains.annotations.NotNull;
 
+import java.io.File;
+
 public class CCVirtualFileListener extends VirtualFileAdapter {
 
   @Override
@@ -33,6 +35,12 @@ public class CCVirtualFileListener extends VirtualFileAdapter {
     }
 
     String name = createdFile.getName();
+
+    CCLanguageManager manager = CCUtils.getStudyLanguageManager(course);
+    if (manager != null && manager.doNotPackFile(new File(createdFile.getPath()))) {
+      return;
+    }
+
     if (CCUtils.isTestsFile(project, createdFile)
         || StudyUtils.isTaskDescriptionFile(name)
         || name.contains(EduNames.WINDOW_POSTFIX)