Search in sources :

Example 11 with ProjectFileSystem

use of com.developmentontheedge.be5.metadata.serialization.ProjectFileSystem in project be5 by DevelopmentOnTheEdge.

the class YamlSerializer method serialize.

public void serialize(final LanguageLocalizations languageLocalizations) throws WriteException {
    this.fileSystem = new ProjectFileSystem(languageLocalizations.getProject());
    new LocalizationSerializer().serialize(languageLocalizations);
}
Also used : ProjectFileSystem(com.developmentontheedge.be5.metadata.serialization.ProjectFileSystem)

Example 12 with ProjectFileSystem

use of com.developmentontheedge.be5.metadata.serialization.ProjectFileSystem in project be5 by DevelopmentOnTheEdge.

the class ProjectFileSystemTest method testPathsMap.

@Test
public void testPathsMap() throws IOException {
    Project prj = new Project("test");
    Path root = tmp.newFolder().toPath();
    prj.setLocation(root);
    ProjectFileSystem pfs = new ProjectFileSystem(prj);
    Map<Path, Boolean> map = EntryStream.of(pfs.getPaths()).mapKeys(root::relativize).toSortedMap();
    assertTrue(StreamEx.of("", "src", "src/js/extenders", "src/js/forms", "src/js/operations", "src/js/queries", "src/l10n", "src/meta/data", "src/meta/entities").map(Paths::get).noneMatch(map::get));
    assertTrue(StreamEx.of("src/ftl", "src/include", "src/meta/modules", "src/groovy/operations", "src/pages").map(Paths::get).allMatch(map::get));
}
Also used : Path(java.nio.file.Path) Project(com.developmentontheedge.be5.metadata.model.Project) Paths(java.nio.file.Paths) Test(org.junit.Test)

Example 13 with ProjectFileSystem

use of com.developmentontheedge.be5.metadata.serialization.ProjectFileSystem in project be5 by DevelopmentOnTheEdge.

the class ModuleLoader2 method getFileSystem.

/**
 * Returns BeanExplorerProjectFileSystem for given module if possible
 */
public static ProjectFileSystem getFileSystem(Project app, String moduleName) {
    if (app.getProjectOrigin().equals(moduleName)) {
        return new ProjectFileSystem(app);
    }
    Path modulePath = ModuleLoader2.getModulePath(moduleName);
    if (modulePath != null) {
        Project project = new Project(moduleName);
        project.setLocation(modulePath);
        project.setProjectFileStructure(new ProjectFileStructure(project));
        return new ProjectFileSystem(project);
    }
    return null;
}
Also used : Path(java.nio.file.Path) Project(com.developmentontheedge.be5.metadata.model.Project) ProjectFileStructure(com.developmentontheedge.be5.metadata.model.ProjectFileStructure)

Aggregations

ProjectFileSystem (com.developmentontheedge.be5.metadata.serialization.ProjectFileSystem)10 Project (com.developmentontheedge.be5.metadata.model.Project)3 Path (java.nio.file.Path)3 IOException (java.io.IOException)2 WriteException (com.developmentontheedge.be5.metadata.exception.WriteException)1 Entity (com.developmentontheedge.be5.metadata.model.Entity)1 ProjectFileStructure (com.developmentontheedge.be5.metadata.model.ProjectFileStructure)1 BeModelCollection (com.developmentontheedge.be5.metadata.model.base.BeModelCollection)1 BeModelElement (com.developmentontheedge.be5.metadata.model.base.BeModelElement)1 JULLogger (com.developmentontheedge.be5.metadata.util.JULLogger)1 ProcessController (com.developmentontheedge.be5.metadata.util.ProcessController)1 FileSystems (java.nio.file.FileSystems)1 FileVisitResult (java.nio.file.FileVisitResult)1 Files (java.nio.file.Files)1 LinkOption (java.nio.file.LinkOption)1 Paths (java.nio.file.Paths)1 SimpleFileVisitor (java.nio.file.SimpleFileVisitor)1 StandardWatchEventKinds (java.nio.file.StandardWatchEventKinds)1 WatchEvent (java.nio.file.WatchEvent)1 WatchKey (java.nio.file.WatchKey)1