Search in sources :

Example 1 with PerlProjectManager

use of com.perl5.lang.perl.idea.project.PerlProjectManager in project Perl5-IDEA by Camelcade.

the class PerlLightTestCase method setUpLibrary.

protected void setUpLibrary() {
    Application application = ApplicationManager.getApplication();
    application.invokeAndWait(() -> application.runWriteAction(() -> {
        VirtualFile libdir = LocalFileSystem.getInstance().refreshAndFindFileByPath("testData/testlib");
        assert libdir != null;
        PerlProjectManager perlProjectManager = PerlProjectManager.getInstance(getProject());
        perlProjectManager.setProjectSdk(new ProjectJdkImpl("test", PerlSdkType.INSTANCE));
        perlProjectManager.addExternalLibrary(libdir);
        CodeInsightTestFixtureImpl.ensureIndexesUpToDate(getProject());
    }));
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) ProjectJdkImpl(com.intellij.openapi.projectRoots.impl.ProjectJdkImpl) Application(com.intellij.openapi.application.Application) PerlProjectManager(com.perl5.lang.perl.idea.project.PerlProjectManager)

Example 2 with PerlProjectManager

use of com.perl5.lang.perl.idea.project.PerlProjectManager in project Perl5-IDEA by Camelcade.

the class PerlLightTestCase method addTestLibrary.

/**
 * Adds a library from testData/testLibSets as external dependency
 *
 * @param testLibraryName library name
 */
protected void addTestLibrary(@NotNull String testLibraryName) {
    Application application = ApplicationManager.getApplication();
    application.invokeAndWait(() -> application.runWriteAction(() -> {
        VirtualFile libdir = LocalFileSystem.getInstance().refreshAndFindFileByPath(FileUtil.join("testData", "testLibSets", testLibraryName));
        assert libdir != null;
        PerlProjectManager perlProjectManager = PerlProjectManager.getInstance(getProject());
        perlProjectManager.addExternalLibrary(libdir);
        CodeInsightTestFixtureImpl.ensureIndexesUpToDate(getProject());
    }));
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) Application(com.intellij.openapi.application.Application) PerlProjectManager(com.perl5.lang.perl.idea.project.PerlProjectManager)

Aggregations

Application (com.intellij.openapi.application.Application)2 VirtualFile (com.intellij.openapi.vfs.VirtualFile)2 PerlProjectManager (com.perl5.lang.perl.idea.project.PerlProjectManager)2 ProjectJdkImpl (com.intellij.openapi.projectRoots.impl.ProjectJdkImpl)1