]> gerrit.simantics Code Review - simantics/platform.git/blob - tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/InitialRepository.java
(refs #7307) Added features field to SCL module header
[simantics/platform.git] / tests / org.simantics.scl.compiler.tests / src / org / simantics / scl / compiler / tests / InitialRepository.java
1 package org.simantics.scl.compiler.tests;
2
3 import org.simantics.scl.compiler.module.repository.ModuleRepository;
4 import org.simantics.scl.compiler.source.repository.CompositeModuleSourceRepository;
5 import org.simantics.scl.compiler.source.repository.SourceRepositories;
6 import org.simantics.scl.osgi.SCLOsgi;
7
8 public class InitialRepository {
9     public static final boolean NO_PRELUDE = false;
10     
11     private static ModuleRepository MODULE_REPOSITORY1 = new ModuleRepository(
12             new CompositeModuleSourceRepository(
13                     SourceRepositories.BUILTIN_SOURCE_REPOSITORY,
14                     SourceRepositories.PRELUDE_SOURCE_REPOSITORY
15                     ));
16     
17     public static ModuleRepository getInitialRepository() {
18         if(NO_PRELUDE)
19             return new ModuleRepository(SourceRepositories.BUILTIN_SOURCE_REPOSITORY);
20         else if(MODULE_REPOSITORY1.getModule("Prelude").didSucceed())
21             return MODULE_REPOSITORY1;
22         else
23             return SCLOsgi.MODULE_REPOSITORY;
24     }
25 }