diff options
author | Dmitry Spiridenok | 2014-03-25 13:43:47 +0000 |
---|---|---|
committer | Dmitry Spiridenok | 2014-03-25 13:43:47 +0000 |
commit | ae929a0e6d6a2c116d004e35a9f706ee8a6046c9 (patch) | |
tree | acb3c414869162ab7cb3b04f7b2252e65b0aba77 | |
parent | f15ff588b0b953bf95e424dfdd6a37c5f3ed0d79 (diff) | |
download | org.eclipse.e4.tools-ae929a0e6d6a2c116d004e35a9f706ee8a6046c9.tar.gz org.eclipse.e4.tools-ae929a0e6d6a2c116d004e35a9f706ee8a6046c9.tar.xz org.eclipse.e4.tools-ae929a0e6d6a2c116d004e35a9f706ee8a6046c9.zip |
Bug 408712 - Add include to build.properties when new fragment.e4xmiI20140325-2200
gets created.
Change-Id: I0346f764a631851a9f381ba0c923890a0b431892
Signed-off-by: Dmitry Spiridenok <d.spiridenok@gmail.com>
-rw-r--r-- | bundles/org.eclipse.e4.tools/src/org/eclipse/e4/internal/tools/wizards/model/BaseApplicationModelWizard.java | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/bundles/org.eclipse.e4.tools/src/org/eclipse/e4/internal/tools/wizards/model/BaseApplicationModelWizard.java b/bundles/org.eclipse.e4.tools/src/org/eclipse/e4/internal/tools/wizards/model/BaseApplicationModelWizard.java index 8bcf8d86..db2ba109 100644 --- a/bundles/org.eclipse.e4.tools/src/org/eclipse/e4/internal/tools/wizards/model/BaseApplicationModelWizard.java +++ b/bundles/org.eclipse.e4.tools/src/org/eclipse/e4/internal/tools/wizards/model/BaseApplicationModelWizard.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010 BestSolution.at and others. + * Copyright (c) 2010 - 2014 BestSolution.at and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -7,6 +7,7 @@ * * Contributors: * Tom Schindl <tom.schindl@bestsolution.at> - initial API and implementation + * Dmitry Spiridenok <d.spiridenok@gmail.com> - Bug 408712 ******************************************************************************/ package org.eclipse.e4.internal.tools.wizards.model; @@ -18,6 +19,7 @@ import java.util.Map; import org.eclipse.core.resources.IContainer; import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.IWorkspaceRoot; import org.eclipse.core.resources.ResourcesPlugin; @@ -44,6 +46,9 @@ import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.jface.wizard.Wizard; +import org.eclipse.pde.core.build.IBuildEntry; +import org.eclipse.pde.internal.core.build.WorkspaceBuildModel; +import org.eclipse.pde.internal.core.project.PDEProject; import org.eclipse.ui.INewWizard; import org.eclipse.ui.IWorkbench; import org.eclipse.ui.IWorkbenchPage; @@ -191,6 +196,7 @@ public abstract class BaseApplicationModelWizard extends Wizard implements INewW // Map<Object, Object> options = new HashMap<Object, Object>(); resource.save(options); + adjustBuildPropertiesFile( modelFile ); } catch (Exception exception) { throw new RuntimeException(exception); @@ -270,4 +276,18 @@ public abstract class BaseApplicationModelWizard extends Wizard implements INewW this.workbench = workbench; this.selection = selection; } + /** + * Adds other file to the build.properties file. + */ + private void adjustBuildPropertiesFile(IFile file) + throws CoreException { + IProject project = file.getProject(); + IFile buildPropertiesFile = PDEProject.getBuildProperties(project); + if (buildPropertiesFile.exists()) { + WorkspaceBuildModel model = new WorkspaceBuildModel(buildPropertiesFile); + IBuildEntry entry = model.getBuild().getEntry(IBuildEntry.BIN_INCLUDES); + entry.addToken(file.getProjectRelativePath().toString()); + model.save(); + } + } }
\ No newline at end of file |