use of com.intellij.flex.model.bc.LinkageType in project intellij-plugins by JetBrains.
the class FlexScopeTest method testTransitiveDependency.
public void testTransitiveDependency() throws Exception {
final Module module2 = FlexTestUtils.createModule(myProject, "module2", getVirtualFile(getBasePath() + "m2"));
final Module module3 = FlexTestUtils.createModule(myProject, "module3", getVirtualFile(getBasePath() + "m3"));
FlexTestUtils.modifyConfigs(myProject, editor -> {
final ModifiableFlexBuildConfiguration bc1 = editor.getConfigurations(myModule)[0];
final ModifiableFlexBuildConfiguration bc2 = editor.getConfigurations(module2)[0];
bc2.setOutputType(OutputType.Library);
final ModifiableFlexBuildConfiguration bc3 = editor.getConfigurations(module3)[0];
bc3.setOutputType(OutputType.Library);
final ModifiableFlexBuildConfiguration bc3a = editor.createConfiguration(module3);
bc3a.setOutputType(OutputType.Library);
bc3a.setName("bc3a");
bc1.getDependencies().getModifiableEntries().add(editor.createBcEntry(bc1.getDependencies(), bc2, null));
bc2.getDependencies().getModifiableEntries().add(editor.createBcEntry(bc2.getDependencies(), bc3, null));
bc2.getDependencies().getModifiableEntries().add(editor.createBcEntry(bc2.getDependencies(), bc3a, null));
});
FlexTestUtils.addFlexLibrary(false, module2, "Flex Lib", true, FlexTestUtils.getTestDataPath("flexlib/"), "flexlib.swc", null, null);
doHighlightingTest("_1");
class Test implements ThrowableRunnable<Exception> {
private final LinkageType myLinkageType1;
private final LinkageType myLinkageType2;
private final String mySuffix;
Test(LinkageType linkageType1, LinkageType linkageType2, String suffix) {
myLinkageType1 = linkageType1;
myLinkageType2 = linkageType2;
mySuffix = suffix;
}
public void run() throws Exception {
FlexTestUtils.modifyConfigs(myProject, editor -> {
final ModifiableFlexBuildConfiguration bc = editor.getConfigurations(module2)[0];
final ModifiableDependencyEntry e1 = bc.getDependencies().getModifiableEntries().get(0);
e1.getDependencyType().setLinkageType(myLinkageType1);
final ModifiableDependencyEntry e2 = bc.getDependencies().getModifiableEntries().get(1);
e2.getDependencyType().setLinkageType(myLinkageType2);
});
doHighlightingTest(mySuffix);
}
}
new Test(LinkageType.Default, LinkageType.Default, "_1").run();
new Test(LinkageType.External, LinkageType.Default, "_1").run();
new Test(LinkageType.Include, LinkageType.Default, "_2").run();
new Test(LinkageType.LoadInRuntime, LinkageType.Default, "_1").run();
new Test(LinkageType.Merged, LinkageType.Default, "_1").run();
new Test(LinkageType.RSL, LinkageType.Default, "_1").run();
new Test(LinkageType.RSL, LinkageType.Include, "_2").run();
new Test(LinkageType.Include, LinkageType.Include, "_2").run();
FlexTestUtils.modifyConfigs(myProject, editor -> {
final ModifiableFlexBuildConfiguration bc2 = editor.getConfigurations(module2)[0];
final ModifiableDependencyEntry entry = bc2.getDependencies().getModifiableEntries().get(2);
assert entry instanceof ModifiableModuleLibraryEntry;
entry.getDependencyType().setLinkageType(LinkageType.Include);
});
new Test(LinkageType.Include, LinkageType.Include, "_3").run();
}
Aggregations