Search in sources :

Example 41 with JpsLibrary

use of org.jetbrains.jps.model.library.JpsLibrary in project intellij-elixir by KronicDeth.

the class Builder method prependCodePaths.

private static void prependCodePaths(@NotNull GeneralCommandLine commandLine, @NotNull JpsSdk sdk) {
    JpsLibrary jpsLibrary = sdk.getParent();
    List<JpsLibraryRoot> compiledRoots = jpsLibrary.getRoots(JpsOrderRootType.COMPILED);
    for (JpsLibraryRoot compiledRoot : compiledRoots) {
        String url = compiledRoot.getUrl();
        assert url.startsWith(URL_PREFIX);
        String path = url.substring(URL_PREFIX.length(), url.length());
        commandLine.addParameters("-pa", path);
    }
}
Also used : JpsLibrary(org.jetbrains.jps.model.library.JpsLibrary) JpsLibraryRoot(org.jetbrains.jps.model.library.JpsLibraryRoot)

Aggregations

JpsLibrary (org.jetbrains.jps.model.library.JpsLibrary)41 JpsModule (org.jetbrains.jps.model.module.JpsModule)11 File (java.io.File)10 Element (org.jdom.Element)8 NotNull (org.jetbrains.annotations.NotNull)7 JpsSimpleElement (org.jetbrains.jps.model.JpsSimpleElement)7 JpsLibraryRoot (org.jetbrains.jps.model.library.JpsLibraryRoot)6 JpsAndroidModuleExtensionImpl (org.jetbrains.jps.android.model.impl.JpsAndroidModuleExtensionImpl)5 JpsAndroidModuleProperties (org.jetbrains.jps.android.model.impl.JpsAndroidModuleProperties)5 JpsElement (org.jetbrains.jps.model.JpsElement)5 JpsDummyElement (org.jetbrains.jps.model.JpsDummyElement)4 IOException (java.io.IOException)3 ArrayList (java.util.ArrayList)3 Nullable (org.jetbrains.annotations.Nullable)3 JpsDependencyElement (org.jetbrains.jps.model.module.JpsDependencyElement)3 JpsLibraryDependency (org.jetbrains.jps.model.module.JpsLibraryDependency)3 Logger (com.intellij.openapi.diagnostic.Logger)2 SystemInfo (com.intellij.openapi.util.SystemInfo)2 JpsElementFactory (org.jetbrains.jps.model.JpsElementFactory)2 JpsSdkReference (org.jetbrains.jps.model.library.sdk.JpsSdkReference)2