use of com.intellij.flex.model.bc.BuildConfigurationNature in project intellij-plugins by JetBrains.
the class AppTestBase method doSetupFlexSdk.
private void doSetupFlexSdk(final Module module, final String flexSdkRootPath, final TargetPlatform targetPlatform, final String sdkVersion) {
final String sdkName = generateSdkName(sdkVersion);
Sdk sdk = ProjectJdkTable.getInstance().findJdk(sdkName);
if (sdk == null) {
ApplicationManager.getApplication().runWriteAction(() -> {
FlexSdkType2 sdkType = FlexSdkType2.getInstance();
Sdk sdk1 = new ProjectJdkImpl(sdkName, sdkType, flexSdkRootPath, "");
ProjectJdkTable.getInstance().addJdk(sdk1);
Disposer.register(getSdkParentDisposable(), new Disposable() {
@Override
public void dispose() {
ApplicationManager.getApplication().runWriteAction(() -> {
ProjectJdkTable sdkTable = ProjectJdkTable.getInstance();
sdkTable.removeJdk(sdkTable.findJdk(sdkName));
});
}
});
final SdkModificator modificator = sdk1.getSdkModificator();
modificator.setVersionString(FlexSdkType2.getInstance().getVersionString(sdk1.getHomePath()));
modifySdk(sdk1, modificator);
modificator.commitChanges();
});
}
FlexTestUtils.modifyBuildConfiguration(module, bc -> {
bc.setNature(new BuildConfigurationNature(targetPlatform, false, getOutputType()));
bc.getDependencies().setSdkEntry(Factory.createSdkEntry(sdkName));
});
}
Aggregations