All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC v1 0/5][eclipse-poky] Enable target profiles for projects
@ 2013-02-08 13:28 Timo Mueller
  2013-02-08 13:28 ` [RFC v1 1/5] plugins/sdk.ide: Allow storage of yocto settings in project preferences Timo Mueller
  2013-02-08 22:56 ` [RFC v1 0/5][eclipse-poky] Enable target profiles for projects Zhang, Jessica
  0 siblings, 2 replies; 8+ messages in thread
From: Timo Mueller @ 2013-02-08 13:28 UTC (permalink / raw)
  To: yocto; +Cc: Timo Mueller

From: Timo Mueller <timo.mueller@bmw-carit.de>

Hi,

this patch set enables projects to make use of the target profiles
proposed in "[RFC v4 00/17][eclipse-poky] Storing yocto settings as
target profiles".

Currently the target profiles are only used to determine the
default settings when creating a new project. Changing the used
profile on an already created projects is not possible, also if the
target profile is changed the projects are not affected.
This patch set enables the use of target profiles in the projects. You
can select the used global profile within the projet properties or use
a project specific configuration. If a global target profile is used
and its values are changed in the eclipse preferences, the projects
using this profile are updated accordingly.

Best regards
Timo

Timo Mueller (5):
  plugins/sdk.ide: Allow storage of yocto settings in project
    preferences
  plugins/sdk.ide: Store profile configuration on project setup
  plugins/sdk.ide: Enable project specific yocto settings
  plugins/sdk.ide: Update projects affected by changes of a target
    profile
  plugins/sdk.ide: Enable the usage of profiles in the project
    properties

 .../src/org/yocto/sdk/ide/YoctoProfileSetting.java |   3 +
 .../yocto/sdk/ide/YoctoProjectSpecificSetting.java |  89 ++++++++++++
 .../org/yocto/sdk/ide/YoctoSDKMessages.properties  |   5 +-
 .../org/yocto/sdk/ide/YoctoSDKProjectNature.java   |   1 +
 .../src/org/yocto/sdk/ide/YoctoSDKUtils.java       | 149 +++++++++++++++++++++
 .../sdk/ide/preferences/PreferenceConstants.java   |   2 +
 .../ide/preferences/YoctoSDKPreferencePage.java    |  91 ++++++++++++-
 .../preferences/YoctoSDKProjectPropertyPage.java   |  94 ++++++++++---
 8 files changed, 410 insertions(+), 24 deletions(-)
 create mode 100644 plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProjectSpecificSetting.java

-- 
1.7.11.7



^ permalink raw reply	[flat|nested] 8+ messages in thread

* [RFC v1 1/5] plugins/sdk.ide: Allow storage of yocto settings in project preferences
  2013-02-08 13:28 [RFC v1 0/5][eclipse-poky] Enable target profiles for projects Timo Mueller
@ 2013-02-08 13:28 ` Timo Mueller
  2013-02-08 13:28   ` [RFC v1 2/5] plugins/sdk.ide: Store profile configuration on project setup Timo Mueller
  2013-02-08 22:56 ` [RFC v1 0/5][eclipse-poky] Enable target profiles for projects Zhang, Jessica
  1 sibling, 1 reply; 8+ messages in thread
From: Timo Mueller @ 2013-02-08 13:28 UTC (permalink / raw)
  To: yocto; +Cc: Timo Mueller

From: Timo Mueller <timo.mueller@bmw-carit.de>

The added functions allow storing the yocto settings in the
preferences store of a project. Project-specific yocto settings as
well as the used profiles can be stored.

Signed-off-by: Timo Mueller <timo.mueller@bmw-carit.de>
---
 .../src/org/yocto/sdk/ide/YoctoSDKUtils.java       | 110 +++++++++++++++++++++
 1 file changed, 110 insertions(+)

diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKUtils.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKUtils.java
index 12af7e3..857928c 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKUtils.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKUtils.java
@@ -32,9 +32,13 @@ import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
 import org.eclipse.cdt.core.settings.model.ICProjectDescription;
 import org.eclipse.core.resources.IProject;
 import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.resources.ProjectScope;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.core.runtime.preferences.IScopeContext;
 import org.eclipse.jface.preference.IPreferenceStore;
+import org.osgi.service.prefs.BackingStoreException;
 import org.yocto.sdk.ide.preferences.PreferenceConstants;
 
 public class YoctoSDKUtils {
@@ -62,6 +66,7 @@ public class YoctoSDKUtils {
 		Other
 	};
 
+	private static final String PROJECT_SCOPE = "org.yocto.sdk.ide";
 	private static final String POKY_DEVICE_EMPTY = "Poky.SDK.Device.Empty";
 	private static final String TOOLCHAIN_LOCATION_EMPTY     = "Poky.SDK.Location.Empty";
 	private static final String SDK_TARGET_EMPTY      = "Poky.SDK.Target.Empty";
@@ -397,6 +402,74 @@ public class YoctoSDKUtils {
 
 	}
 
+	/* Get POKY Preference settings from project's preference store */
+	public static YoctoUIElement getElemFromProjectPreferences(IProject project)
+	{
+		IScopeContext projectScope = new ProjectScope(project);
+		IEclipsePreferences projectNode = projectScope.getNode(PROJECT_SCOPE);
+		if (projectNode == null)
+		{
+			return getElemFromProjectEnv(project);
+		}
+
+		YoctoUIElement elem = new YoctoUIElement();
+		elem.setStrToolChainRoot(projectNode.get(PreferenceConstants.TOOLCHAIN_ROOT,""));
+		elem.setStrTarget(projectNode.get(PreferenceConstants.TOOLCHAIN_TRIPLET,""));
+		elem.setStrQemuKernelLoc(projectNode.get(PreferenceConstants.QEMU_KERNEL,""));
+		elem.setStrSysrootLoc(projectNode.get(PreferenceConstants.SYSROOT,""));
+		elem.setStrQemuOption(projectNode.get(PreferenceConstants.QEMU_OPTION,""));
+		String sTemp = projectNode.get(PreferenceConstants.TARGET_ARCH_INDEX,"");
+		if (!sTemp.isEmpty())
+			elem.setIntTargetIndex(Integer.valueOf(sTemp).intValue());
+		if (projectNode.get(PreferenceConstants.SDK_MODE,"").equalsIgnoreCase(IPreferenceStore.TRUE))
+		{
+			elem.setEnumPokyMode(YoctoUIElement.PokyMode.POKY_SDK_MODE);
+		}
+		else
+			elem.setEnumPokyMode(YoctoUIElement.PokyMode.POKY_TREE_MODE);
+
+		if(projectNode.get(PreferenceConstants.TARGET_MODE,"").equalsIgnoreCase(IPreferenceStore.TRUE))
+			elem.setEnumDeviceMode(YoctoUIElement.DeviceMode.QEMU_MODE);
+		else
+			elem.setEnumDeviceMode(YoctoUIElement.DeviceMode.DEVICE_MODE);
+		return elem;
+	}
+
+	/* Save POKY Preference settings to project's preference store */
+	public static void saveElemToProjectPreferences(YoctoUIElement elem, IProject project)
+	{
+		IScopeContext projectScope = new ProjectScope(project);
+		IEclipsePreferences projectNode = projectScope.getNode(PROJECT_SCOPE);
+		if (projectNode == null)
+		{
+			return;
+		}
+
+		projectNode.putInt(PreferenceConstants.TARGET_ARCH_INDEX, elem.getIntTargetIndex());
+		if (elem.getEnumPokyMode() == YoctoUIElement.PokyMode.POKY_SDK_MODE)
+			projectNode.put(PreferenceConstants.SDK_MODE, IPreferenceStore.TRUE);
+		else
+			projectNode.put(PreferenceConstants.SDK_MODE, IPreferenceStore.FALSE);
+		projectNode.put(PreferenceConstants.QEMU_KERNEL, elem.getStrQemuKernelLoc());
+		projectNode.put(PreferenceConstants.QEMU_OPTION, elem.getStrQemuOption());
+		projectNode.put(PreferenceConstants.SYSROOT, elem.getStrSysrootLoc());
+		if (elem.getEnumDeviceMode() == YoctoUIElement.DeviceMode.QEMU_MODE)
+			projectNode.put(PreferenceConstants.TARGET_MODE, IPreferenceStore.TRUE);
+		else
+			projectNode.put(PreferenceConstants.TARGET_MODE, IPreferenceStore.FALSE);
+		projectNode.put(PreferenceConstants.TOOLCHAIN_ROOT, elem.getStrToolChainRoot());
+		projectNode.put(PreferenceConstants.TOOLCHAIN_TRIPLET, elem.getStrTarget());
+
+		try
+		{
+			projectNode.flush();
+		} catch (BackingStoreException e)
+		{
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+	}
+
 	/* Get POKY Preference settings from project's environment */
 	public static YoctoUIElement getElemFromProjectEnv(IProject project)
 	{
@@ -689,6 +762,27 @@ public class YoctoSDKUtils {
 		saveProfilesToStore(profileElement, YoctoSDKPlugin.getDefault().getPreferenceStore());
 	}
 
+	/* Save profiles and selected profile to the project's preference store */
+	public static void saveProfilesToProjectPreferences(YoctoProfileElement profileElement, IProject project) {
+		IScopeContext projectScope = new ProjectScope(project);
+		IEclipsePreferences projectPreferences = projectScope.getNode(PROJECT_SCOPE);
+		if (projectPreferences == null) {
+			return;
+		}
+
+		projectPreferences.put(PreferenceConstants.PROFILES, profileElement.getProfilesAsString());
+		projectPreferences.put(PreferenceConstants.SELECTED_PROFILE, profileElement.getSelectedProfile());
+
+		try
+		{
+			projectPreferences.flush();
+		} catch (BackingStoreException e)
+		{
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+	}
+
 	/* Save profiles and selected profile to a specific preference store */
 	public static void saveProfilesToStore(YoctoProfileElement profileElement, IPreferenceStore store)
 	{
@@ -710,4 +804,20 @@ public class YoctoSDKUtils {
 
 		return new YoctoProfileElement(profiles, selectedProfile);
 	}
+
+	/* Get profiles and selected profile from the project's preference store */
+	public static YoctoProfileElement getProfilesFromProjectPreferences(IProject project)
+	{
+		IScopeContext projectScope = new ProjectScope(project);
+		IEclipsePreferences projectNode = projectScope.getNode(PROJECT_SCOPE);
+		if (projectNode == null)
+		{
+			return getProfilesFromDefaultStore();
+		}
+
+		String profiles = projectNode.get(PreferenceConstants.PROFILES, "");
+		String selectedProfile = projectNode.get(PreferenceConstants.SELECTED_PROFILE, "");
+
+		return new YoctoProfileElement(profiles, selectedProfile);
+	}
 }
-- 
1.7.11.7



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [RFC v1 2/5] plugins/sdk.ide: Store profile configuration on project setup
  2013-02-08 13:28 ` [RFC v1 1/5] plugins/sdk.ide: Allow storage of yocto settings in project preferences Timo Mueller
@ 2013-02-08 13:28   ` Timo Mueller
  2013-02-08 13:28     ` [RFC v1 3/5] plugins/sdk.ide: Enable project specific yocto settings Timo Mueller
  0 siblings, 1 reply; 8+ messages in thread
From: Timo Mueller @ 2013-02-08 13:28 UTC (permalink / raw)
  To: yocto; +Cc: Timo Mueller

From: Timo Mueller <timo.mueller@bmw-carit.de>


Signed-off-by: Timo Mueller <timo.mueller@bmw-carit.de>
---
 .../org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKProjectNature.java   | 1 +
 1 file changed, 1 insertion(+)

diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKProjectNature.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKProjectNature.java
index 6f16732..b0e7121 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKProjectNature.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKProjectNature.java
@@ -154,6 +154,7 @@ public class YoctoSDKProjectNature implements IProjectNature {
 
 	public static void configureAutotools(IProject project) throws YoctoGeneralException {
 		YoctoProfileElement profileElement = YoctoSDKUtils.getProfilesFromDefaultStore();
+		YoctoSDKUtils.saveProfilesToProjectPreferences(profileElement, project);
 		IPreferenceStore selecteProfileStore = YoctoSDKPlugin.getProfilePreferenceStore(profileElement.getSelectedProfile());
 		YoctoUIElement elem = YoctoSDKUtils.getElemFromStore(selecteProfileStore);
 		YoctoSDKUtils.SDKCheckResults result = YoctoSDKUtils.checkYoctoSDK(elem);
-- 
1.7.11.7



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [RFC v1 3/5] plugins/sdk.ide: Enable project specific yocto settings
  2013-02-08 13:28   ` [RFC v1 2/5] plugins/sdk.ide: Store profile configuration on project setup Timo Mueller
@ 2013-02-08 13:28     ` Timo Mueller
  2013-02-08 13:28       ` [RFC v1 4/5] plugins/sdk.ide: Update projects affected by changes of a target profile Timo Mueller
  0 siblings, 1 reply; 8+ messages in thread
From: Timo Mueller @ 2013-02-08 13:28 UTC (permalink / raw)
  To: yocto; +Cc: Timo Mueller

From: Timo Mueller <timo.mueller@bmw-carit.de>

Until now only global target profiles could be used to configure a
project. Now a project can have its own specific settings which are
not affected by global changes to the profile.

Signed-off-by: Timo Mueller <timo.mueller@bmw-carit.de>
---
 .../yocto/sdk/ide/YoctoProjectSpecificSetting.java | 80 ++++++++++++++++++++++
 .../org/yocto/sdk/ide/YoctoSDKMessages.properties  |  3 +
 .../src/org/yocto/sdk/ide/YoctoSDKUtils.java       | 39 +++++++++++
 .../sdk/ide/preferences/PreferenceConstants.java   |  2 +
 4 files changed, 124 insertions(+)
 create mode 100644 plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProjectSpecificSetting.java

diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProjectSpecificSetting.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProjectSpecificSetting.java
new file mode 100644
index 0000000..25d4de4
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProjectSpecificSetting.java
@@ -0,0 +1,80 @@
+/*******************************************************************************
+ * Copyright (c) 2012 BMW Car IT GmbH.
+ * 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BMW Car IT - initial API and implementation
+ *******************************************************************************/
+package org.yocto.sdk.ide;
+
+import org.eclipse.jface.preference.PreferencePage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Group;
+
+public class YoctoProjectSpecificSetting {
+	private static final String PROJECT_SPECIFIC_TITLE = "Preferences.Profile.ProjectSpecific.Title";
+	private static final String PROJECT_SPECIFIC_GROUP_TITLE = "Preferences.Profile.ProjectSpecific.Group.Title";
+
+	private YoctoProfileSetting yoctoConfigurationsSetting;
+	private YoctoUISetting yoctoUISetting;
+
+	private Button btnUseProjectSpecificSettingsCheckbox;
+	private PreferencePage preferencePage;
+
+	public YoctoProjectSpecificSetting(YoctoProfileSetting yoctoConfigurationsSetting,
+						YoctoUISetting yoctoUISetting, PreferencePage preferencePage) {
+		this.yoctoConfigurationsSetting = yoctoConfigurationsSetting;
+		this.yoctoUISetting = yoctoUISetting;
+		this.preferencePage = preferencePage;
+	}
+
+	public void createComposite(Composite composite) {
+		GridData gd = new GridData(SWT.FILL, SWT.CENTER, true, false);
+		GridLayout layout = new GridLayout(2, false);
+		composite.setLayout(layout);
+
+		Group storeYoctoConfigurationsGroup = new Group (composite, SWT.NONE);
+		layout = new GridLayout(2, false);
+		storeYoctoConfigurationsGroup.setLayout(layout);
+		gd = new GridData(SWT.FILL, SWT.CENTER, true, false);
+		gd.horizontalSpan = 2;
+		storeYoctoConfigurationsGroup.setLayoutData(gd);
+		storeYoctoConfigurationsGroup.setText(YoctoSDKMessages.getString(PROJECT_SPECIFIC_GROUP_TITLE));
+
+		btnUseProjectSpecificSettingsCheckbox = new Button(storeYoctoConfigurationsGroup, SWT.CHECK);
+		btnUseProjectSpecificSettingsCheckbox.setText(YoctoSDKMessages.getString(PROJECT_SPECIFIC_TITLE));
+		btnUseProjectSpecificSettingsCheckbox.addSelectionListener(new SelectionListener() {
+			@Override
+			public void widgetSelected(SelectionEvent e) {
+				if (btnUseProjectSpecificSettingsCheckbox.getSelection()){
+					yoctoConfigurationsSetting.setUIFormEnabledState(false);
+					yoctoUISetting.setUIFormEnabledState(true);
+				} else {
+					yoctoConfigurationsSetting.setUIFormEnabledState(true);
+					yoctoConfigurationsSetting.setButtonsEnabledState(false);
+					yoctoUISetting.setUIFormEnabledState(false);
+				}
+			}
+
+			@Override
+			public void widgetDefaultSelected(SelectionEvent e) {}
+		});
+	}
+
+	public void setUseProjectSpecificSettings(boolean isUsingProjectSpecificSettings) {
+		btnUseProjectSpecificSettingsCheckbox.setSelection(isUsingProjectSpecificSettings);
+	}
+
+	public boolean isUsingProjectSpecificSettings() {
+		return btnUseProjectSpecificSettingsCheckbox.getSelection();
+	}
+}
diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties
index f631112..bfdde41 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties
@@ -64,6 +64,9 @@ Preferences.Profile.Remove.Dialog.Message = Do you really want to the remove the
 Preferences.Profile.Standard.Modification.Title = Modify standard target profile
 Preferences.Profile.Standard.Modification.Message = Standard target profile cannot be removed or renamed.
 
+Preferences.Profile.ProjectSpecific.Title = Use project specific settings
+Preferences.Profile.ProjectSpecific.Group.Title = Project specific settings:
+
 Console.SDK.Name = Yocto Project Console
 
 LaunchConfig.Type.Name = org.eclipse.ui.externaltools.ProgramLaunchConfigurationType
diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKUtils.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKUtils.java
index 857928c..11d68e0 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKUtils.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKUtils.java
@@ -820,4 +820,43 @@ public class YoctoSDKUtils {
 
 		return new YoctoProfileElement(profiles, selectedProfile);
 	}
+
+	public static boolean getUseProjectSpecificOptionFromProjectPreferences(IProject project)
+	{
+		IScopeContext projectScope = new ProjectScope(project);
+		IEclipsePreferences projectNode = projectScope.getNode(PROJECT_SCOPE);
+		if (projectNode == null) {
+			return false;
+		}
+
+		String useProjectSpecificSettingString = projectNode.get(PreferenceConstants.PROJECT_SPECIFIC_PROFILE, IPreferenceStore.FALSE);
+
+		if (useProjectSpecificSettingString.equals(IPreferenceStore.FALSE)) {
+			return false;
+		}
+
+		return true;
+	}
+
+	public static void saveUseProjectSpecificOptionToProjectPreferences(IProject project, boolean useProjectSpecificSetting)
+	{
+		IScopeContext projectScope = new ProjectScope(project);
+		IEclipsePreferences projectNode = projectScope.getNode(PROJECT_SCOPE);
+		if (projectNode == null) {
+			return;
+		}
+
+		if (useProjectSpecificSetting) {
+			projectNode.put(PreferenceConstants.PROJECT_SPECIFIC_PROFILE, IPreferenceStore.TRUE);
+		} else {
+			projectNode.put(PreferenceConstants.PROJECT_SPECIFIC_PROFILE, IPreferenceStore.FALSE);
+		}
+
+		try {
+			projectNode.flush();
+		} catch (BackingStoreException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+	}
 }
diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/PreferenceConstants.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/PreferenceConstants.java
index 814397a..0ebbe99 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/PreferenceConstants.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/PreferenceConstants.java
@@ -38,4 +38,6 @@ public class PreferenceConstants {
 	public static final String PROFILES = "profiles";
 
 	public static final String SELECTED_PROFILE = "selectedProfile";
+
+	public static final String PROJECT_SPECIFIC_PROFILE = "##PROJECT_SPECIFIC_PROFILE##";
 }
-- 
1.7.11.7



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [RFC v1 4/5] plugins/sdk.ide: Update projects affected by changes of a target profile
  2013-02-08 13:28     ` [RFC v1 3/5] plugins/sdk.ide: Enable project specific yocto settings Timo Mueller
@ 2013-02-08 13:28       ` Timo Mueller
  2013-02-08 13:28         ` [RFC v1 5/5] plugins/sdk.ide: Enable the usage of profiles in the project properties Timo Mueller
  0 siblings, 1 reply; 8+ messages in thread
From: Timo Mueller @ 2013-02-08 13:28 UTC (permalink / raw)
  To: yocto; +Cc: Timo Mueller

From: Timo Mueller <timo.mueller@bmw-carit.de>

If a target profile is modified, renamed or deleted globally the
projects using this profile are updated accordingly.
On deletion of a target profile the affected projects will set use the
standard target profile.

Signed-off-by: Timo Mueller <timo.mueller@bmw-carit.de>
---
 .../org/yocto/sdk/ide/YoctoSDKMessages.properties  |  2 +-
 .../ide/preferences/YoctoSDKPreferencePage.java    | 91 +++++++++++++++++++++-
 2 files changed, 89 insertions(+), 4 deletions(-)

diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties
index bfdde41..e779f7d 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties
@@ -60,7 +60,7 @@ Preferences.Profile.Rename.Dialog.Title = Rename target profile
 Preferences.Profile.Rename.Dialog.Message = Please input a new profile name.
 Preferences.Profile.Remove.Title = Remove
 Preferences.Profile.Remove.Dialog.Title = Remove target profile
-Preferences.Profile.Remove.Dialog.Message = Do you really want to the remove the target profile "{0}"?
+Preferences.Profile.Remove.Dialog.Message = Do you really want to the remove the target profile "{0}"?\nProjects using this target profile will be reconfigured to use the standard profile.
 Preferences.Profile.Standard.Modification.Title = Modify standard target profile
 Preferences.Profile.Standard.Modification.Message = Standard target profile cannot be removed or renamed.
 
diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
index fb015ab..b5963cf 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
@@ -10,6 +10,11 @@
  *******************************************************************************/
 package org.yocto.sdk.ide.preferences;
 
+import java.util.HashSet;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
 import org.eclipse.jface.dialogs.Dialog;
 import org.eclipse.jface.dialogs.IDialogConstants;
 import org.eclipse.jface.dialogs.InputDialog;
@@ -25,6 +30,7 @@ import org.yocto.sdk.ide.YoctoProfileElement;
 import org.yocto.sdk.ide.YoctoProfileSetting;
 import org.yocto.sdk.ide.YoctoSDKMessages;
 import org.yocto.sdk.ide.YoctoSDKPlugin;
+import org.yocto.sdk.ide.YoctoSDKProjectNature;
 import org.yocto.sdk.ide.YoctoSDKUtils;
 import org.yocto.sdk.ide.YoctoSDKUtils.SDKCheckRequestFrom;
 import org.yocto.sdk.ide.YoctoUIElement;
@@ -80,8 +86,8 @@ public class YoctoSDKPreferencePage extends PreferencePage implements IWorkbench
 			System.out.println(e.getMessage());
 			return result;
 		}
-
 	}
+
 	/*
 	 * @see IPreferencePage#performOk()
 	 */
@@ -95,6 +101,8 @@ public class YoctoSDKPreferencePage extends PreferencePage implements IWorkbench
 			YoctoProfileElement profileElement = yoctoProfileSetting.getCurrentInput();
 			YoctoSDKUtils.saveProfilesToDefaultStore(profileElement);
 
+			updateAffectedProjects(profileElement.getSelectedProfile(), elem);
+
 			return super.performOk();
 		} catch (YoctoGeneralException e) {
 			// TODO Auto-generated catch block
@@ -151,9 +159,86 @@ public class YoctoSDKPreferencePage extends PreferencePage implements IWorkbench
 	public void renameProfile(String oldProfileName, String newProfileName) {
 		YoctoUIElement oldProfileElement = YoctoSDKUtils.getElemFromStore(YoctoSDKPlugin.getProfilePreferenceStore(oldProfileName));
 		YoctoSDKUtils.saveElemToStore(oldProfileElement, YoctoSDKPlugin.getProfilePreferenceStore(newProfileName));
+
+		renameProfileInAffectedProjects(oldProfileName, newProfileName);
+	}
+
+	public void deleteProfile(String selectedProfile)
+	{
+		resetProfileInAffectedProjects(selectedProfile);
 	}
 
-	public void deleteProfile(String selectedProfile) {
-		// do nothing
+	private void resetProfileInAffectedProjects(String usedProfile)
+	{
+		HashSet<IProject> yoctoProjects = getAffectedProjects(usedProfile);
+		YoctoProfileElement profileElement = YoctoSDKUtils.getProfilesFromDefaultStore();
+		profileElement.setSelectedProfile(PreferenceConstants.STANDARD_PROFILE_NAME);
+
+		for (IProject project : yoctoProjects)
+		{
+			YoctoSDKUtils.saveProfilesToProjectPreferences(profileElement, project);
+			YoctoUIElement elem = YoctoSDKUtils.getElemFromStore(
+											YoctoSDKPlugin.getProfilePreferenceStore(PreferenceConstants.STANDARD_PROFILE_NAME));
+			YoctoSDKUtils.saveElemToProjectEnv(elem, project);
+		}
+	}
+
+	private void renameProfileInAffectedProjects(String oldProfileName, String newProfileName) {
+		HashSet<IProject> yoctoProjects = getAffectedProjects(oldProfileName);
+		YoctoProfileElement profileElement = YoctoSDKUtils.getProfilesFromDefaultStore();
+		profileElement.setSelectedProfile(newProfileName);
+
+		for (IProject project : yoctoProjects)
+		{
+			YoctoSDKUtils.saveProfilesToProjectPreferences(profileElement, project);
+		}
+	}
+
+	private void updateAffectedProjects(String usedProfile, YoctoUIElement elem) {
+		HashSet<IProject> yoctoProjects = getAffectedProjects(usedProfile);
+
+		for (IProject project : yoctoProjects)
+		{
+			YoctoSDKUtils.saveElemToProjectEnv(elem, project);
+		}
+	}
+
+	private HashSet<IProject> getAffectedProjects(String usedProfile)
+	{
+		HashSet<IProject> yoctoProjects = new HashSet<IProject>();
+
+		IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
+
+		for (IProject project : projects)
+		{
+			try
+			{
+				if (!project.hasNature(YoctoSDKProjectNature.YoctoSDK_NATURE_ID)) {
+					continue;
+				}
+			} catch (CoreException e)
+			{
+				// project is closed or does not exist so don't update
+				continue;
+			}
+
+			if (!projectUsesProfile(project, usedProfile)) {
+				continue;
+			}
+
+			yoctoProjects.add(project);
+		}
+		return yoctoProjects;
+	}
+
+	private boolean projectUsesProfile(IProject project, String profile)
+	{
+		YoctoProfileElement profileElement = YoctoSDKUtils.getProfilesFromProjectPreferences(project);
+
+		if (!profileElement.getSelectedProfile().equals(profile)) {
+			return false;
+		}
+
+		return true;
 	}
 }
-- 
1.7.11.7



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [RFC v1 5/5] plugins/sdk.ide: Enable the usage of profiles in the project properties
  2013-02-08 13:28       ` [RFC v1 4/5] plugins/sdk.ide: Update projects affected by changes of a target profile Timo Mueller
@ 2013-02-08 13:28         ` Timo Mueller
  0 siblings, 0 replies; 8+ messages in thread
From: Timo Mueller @ 2013-02-08 13:28 UTC (permalink / raw)
  To: yocto; +Cc: Timo Mueller

From: Timo Mueller <timo.mueller@bmw-carit.de>

UI elements are added to the project properties in order to use
profile capabilites with a project.

Signed-off-by: Timo Mueller <timo.mueller@bmw-carit.de>
---
 .../src/org/yocto/sdk/ide/YoctoProfileSetting.java |  3 +
 .../yocto/sdk/ide/YoctoProjectSpecificSetting.java |  9 +++
 .../preferences/YoctoSDKProjectPropertyPage.java   | 94 +++++++++++++++++-----
 3 files changed, 86 insertions(+), 20 deletions(-)

diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java
index 738dba7..cc3e167 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java
@@ -28,6 +28,7 @@ import org.eclipse.swt.widgets.Listener;
 import org.yocto.sdk.ide.preferences.PreferenceConstants;
 import org.yocto.sdk.ide.preferences.ProfileNameInputValidator;
 import org.yocto.sdk.ide.preferences.YoctoSDKPreferencePage;
+import org.yocto.sdk.ide.preferences.YoctoSDKProjectPropertyPage;
 
 public class YoctoProfileSetting {
 	private static final String PROFILES_TITLE = "Preferences.Profiles.Title";
@@ -91,6 +92,8 @@ public class YoctoProfileSetting {
 
 				if (preferencePage instanceof YoctoSDKPreferencePage) {
 					((YoctoSDKPreferencePage) preferencePage).switchProfile(selectedItem);
+				} else if (preferencePage instanceof YoctoSDKProjectPropertyPage) {
+					((YoctoSDKProjectPropertyPage) preferencePage).switchProfile(selectedItem);
 				}
 			}
 		};
diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProjectSpecificSetting.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProjectSpecificSetting.java
index 25d4de4..13acb8e 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProjectSpecificSetting.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProjectSpecificSetting.java
@@ -19,6 +19,7 @@ import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Group;
+import org.yocto.sdk.ide.preferences.YoctoSDKProjectPropertyPage;
 
 public class YoctoProjectSpecificSetting {
 	private static final String PROJECT_SPECIFIC_TITLE = "Preferences.Profile.ProjectSpecific.Title";
@@ -58,10 +59,18 @@ public class YoctoProjectSpecificSetting {
 				if (btnUseProjectSpecificSettingsCheckbox.getSelection()){
 					yoctoConfigurationsSetting.setUIFormEnabledState(false);
 					yoctoUISetting.setUIFormEnabledState(true);
+
+					if (preferencePage instanceof YoctoSDKProjectPropertyPage) {
+						((YoctoSDKProjectPropertyPage) preferencePage).switchToProjectSpecificProfile();
+					}
 				} else {
 					yoctoConfigurationsSetting.setUIFormEnabledState(true);
 					yoctoConfigurationsSetting.setButtonsEnabledState(false);
 					yoctoUISetting.setUIFormEnabledState(false);
+
+					if (preferencePage instanceof YoctoSDKProjectPropertyPage) {
+						((YoctoSDKProjectPropertyPage) preferencePage).switchToSelectedProfile();
+					}
 				}
 			}
 
diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
index 56cc4cb..eef56c1 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
@@ -21,6 +21,10 @@ import org.eclipse.swt.widgets.Control;
 import org.eclipse.ui.IWorkbenchPropertyPage;
 import org.eclipse.ui.dialogs.PropertyPage;
 import org.yocto.sdk.ide.YoctoGeneralException;
+import org.yocto.sdk.ide.YoctoProfileElement;
+import org.yocto.sdk.ide.YoctoProfileSetting;
+import org.yocto.sdk.ide.YoctoProjectSpecificSetting;
+import org.yocto.sdk.ide.YoctoSDKPlugin;
 import org.yocto.sdk.ide.YoctoSDKUtils;
 import org.yocto.sdk.ide.YoctoSDKUtils.SDKCheckRequestFrom;
 import org.yocto.sdk.ide.YoctoUIElement;
@@ -29,21 +33,56 @@ import org.yocto.sdk.ide.YoctoUISetting;
 public class YoctoSDKProjectPropertyPage extends PropertyPage implements
 		IWorkbenchPropertyPage {
 
+	private YoctoProfileSetting yoctoProfileSetting;
+	private YoctoProjectSpecificSetting yoctoProjectSpecificSetting;
 	private YoctoUISetting yoctoUISetting;
 	private IProject project = null;
 
 	@Override
 	protected Control createContents(Composite parent) {
-		YoctoUIElement uiElement = loadUIElement();
-		this.yoctoUISetting = new YoctoUISetting(uiElement);
+		IProject project = getProject();
+
+		YoctoProfileElement globalProfileElement= YoctoSDKUtils.getProfilesFromDefaultStore();
+		YoctoProfileElement profileElement = YoctoSDKUtils.getProfilesFromProjectPreferences(project);
+
+		String selectedProfile = profileElement.getSelectedProfile();
+		if (!globalProfileElement.contains(selectedProfile)) {
+			selectedProfile = globalProfileElement.getSelectedProfile();
+		}
+
+		yoctoProfileSetting = new YoctoProfileSetting(
+				new YoctoProfileElement(globalProfileElement.getProfilesAsString(), selectedProfile), this);
+		boolean useProjectSpecificSetting = YoctoSDKUtils.getUseProjectSpecificOptionFromProjectPreferences(project);
+
+		if (useProjectSpecificSetting) {
+			yoctoUISetting = new YoctoUISetting(YoctoSDKUtils.getElemFromProjectPreferences(project));
+		} else {
+			yoctoUISetting = new YoctoUISetting(YoctoSDKUtils.getElemFromStore(YoctoSDKPlugin.getProfilePreferenceStore(selectedProfile)));
+		}
+
+		yoctoProjectSpecificSetting = new YoctoProjectSpecificSetting(yoctoProfileSetting, yoctoUISetting, this);
 
 		initializeDialogUnits(parent);
 		final Composite result = new Composite(parent, SWT.NONE);
 
+		yoctoProfileSetting.createComposite(result);
+		yoctoProjectSpecificSetting.createComposite(result);
+
 		try {
 			yoctoUISetting.createComposite(result);
-			yoctoUISetting
-					.validateInput(SDKCheckRequestFrom.Preferences, false);
+
+			if (useProjectSpecificSetting) {
+				yoctoProfileSetting.setUIFormEnabledState(false);
+				yoctoProjectSpecificSetting.setUseProjectSpecificSettings(true);
+				yoctoUISetting.setUIFormEnabledState(true);
+				yoctoUISetting.validateInput(SDKCheckRequestFrom.Preferences, false);
+			} else {
+				yoctoProfileSetting.setUIFormEnabledState(true);
+				yoctoProfileSetting.setButtonsEnabledState(false);
+				yoctoProjectSpecificSetting.setUseProjectSpecificSettings(false);
+				yoctoUISetting.setUIFormEnabledState(false);
+			}
+
 			Dialog.applyDialogFont(result);
 			return result;
 		} catch (YoctoGeneralException e) {
@@ -67,19 +106,6 @@ public class YoctoSDKProjectPropertyPage extends PropertyPage implements
 		return project;
 	}
 
-	private YoctoUIElement loadUIElement() {
-		YoctoUIElement uiElement = YoctoSDKUtils.getElemFromProjectEnv(getProject());
-
-		if (uiElement.getStrToolChainRoot().isEmpty()
-				|| uiElement.getStrTarget().isEmpty()) {
-			// No project environment has been set yet, use the Preference
-			// values
-			uiElement = YoctoSDKUtils.getElemFromDefaultStore();
-		}
-
-		return uiElement;
-	}
-
 	/*
 	 * @see PreferencePage#performDefaults()
 	 */
@@ -87,6 +113,7 @@ public class YoctoSDKProjectPropertyPage extends PropertyPage implements
 	protected void performDefaults() {
 		YoctoUIElement defaultElement = YoctoSDKUtils.getDefaultElemFromDefaultStore();
 		yoctoUISetting.setCurrentInput(defaultElement);
+		yoctoProjectSpecificSetting.setUseProjectSpecificSettings(true);
 		super.performDefaults();
 	}
 
@@ -96,10 +123,20 @@ public class YoctoSDKProjectPropertyPage extends PropertyPage implements
 	@Override
 	public boolean performOk() {
 		try {
-			yoctoUISetting.validateInput(SDKCheckRequestFrom.Preferences, true);
+			IProject project = getProject();
 
-			YoctoUIElement elem = yoctoUISetting.getCurrentInput();
-			YoctoSDKUtils.saveElemToProjectEnv(elem, getProject());
+			if (yoctoProjectSpecificSetting.isUsingProjectSpecificSettings()) {
+				yoctoUISetting.validateInput(SDKCheckRequestFrom.Preferences, true);
+
+				YoctoSDKUtils.saveUseProjectSpecificOptionToProjectPreferences(project, true);
+				YoctoSDKUtils.saveProfilesToProjectPreferences(yoctoProfileSetting.getCurrentInput(), project);
+				YoctoSDKUtils.saveElemToProjectPreferences(yoctoUISetting.getCurrentInput(), project);
+			} else {
+				YoctoSDKUtils.saveUseProjectSpecificOptionToProjectPreferences(project, false);
+				YoctoSDKUtils.saveProfilesToProjectPreferences(yoctoProfileSetting.getCurrentInput(), project);
+			}
+
+			YoctoSDKUtils.saveElemToProjectEnv(yoctoUISetting.getCurrentInput(), getProject());
 
 			return super.performOk();
 		} catch (YoctoGeneralException e) {
@@ -108,4 +145,21 @@ public class YoctoSDKProjectPropertyPage extends PropertyPage implements
 			return false;
 		}
 	}
+
+	public void switchProfile(String selectedProfile)
+	{
+		YoctoUIElement profileElement = YoctoSDKUtils.getElemFromStore(YoctoSDKPlugin.getProfilePreferenceStore(selectedProfile));
+		yoctoUISetting.setCurrentInput(profileElement);
+	}
+
+	public void switchToProjectSpecificProfile()
+	{
+		YoctoUIElement profileElement = YoctoSDKUtils.getElemFromProjectPreferences(getProject());
+		yoctoUISetting.setCurrentInput(profileElement);
+	}
+
+	public void switchToSelectedProfile()
+	{
+		switchProfile(yoctoProfileSetting.getCurrentInput().getSelectedProfile());
+	}
 }
-- 
1.7.11.7



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [RFC v1 0/5][eclipse-poky] Enable target profiles for projects
  2013-02-08 13:28 [RFC v1 0/5][eclipse-poky] Enable target profiles for projects Timo Mueller
  2013-02-08 13:28 ` [RFC v1 1/5] plugins/sdk.ide: Allow storage of yocto settings in project preferences Timo Mueller
@ 2013-02-08 22:56 ` Zhang, Jessica
  2013-02-11 10:01   ` Timo Müller
  1 sibling, 1 reply; 8+ messages in thread
From: Zhang, Jessica @ 2013-02-08 22:56 UTC (permalink / raw)
  To: Timo Mueller, yocto; +Cc: Timo Mueller

Hi Timo,

Couple comments:

1.  I really like the way that the global profile and project profile are linked together.  But it also introduce an out of sync issue.  Say I use a profile compiled my project with one set of toolchain and sysroot setup.  Then I change the  toolchain and sysroot settings for the profile.  But unless we inform/enforce the user to rebuild the project with the new profile settings.  The built out in the project directory is using one set of setting, but by looking at the project profile setting is another set.  So, I think we need to add a notification to user like we're doing for "remove".  When user change a profile and if there're projects using the profile, we need to prompt the user  with something like: "The profile settings have been changed and there're projects using this profile which will be impacted.  If you want to pursue the changes, please rebuild those projects with the new profile settings".  And in those projects, we need a sign the inform the user that the underline profile has changed, they need to rebuild to resync.  Make sense?

2. Seems we only allow user to choose profiles in project settings, can eliminate those grayed out "save as...", "remove", etc buttons?

3.  Also since the profile are really cross development setting profiles.  Can we change "Target profile" to "Cross development profile"?

Thanks,
Jessica

-----Original Message-----
From: yocto-bounces@yoctoproject.org [mailto:yocto-bounces@yoctoproject.org] On Behalf Of Timo Mueller
Sent: Friday, February 08, 2013 5:28 AM
To: yocto@yoctoproject.org
Cc: Timo Mueller
Subject: [yocto] [RFC v1 0/5][eclipse-poky] Enable target profiles for projects

From: Timo Mueller <timo.mueller@bmw-carit.de>

Hi,

this patch set enables projects to make use of the target profiles proposed in "[RFC v4 00/17][eclipse-poky] Storing yocto settings as target profiles".

Currently the target profiles are only used to determine the default settings when creating a new project. Changing the used profile on an already created projects is not possible, also if the target profile is changed the projects are not affected.
This patch set enables the use of target profiles in the projects. You can select the used global profile within the projet properties or use a project specific configuration. If a global target profile is used and its values are changed in the eclipse preferences, the projects using this profile are updated accordingly.

Best regards
Timo

Timo Mueller (5):
  plugins/sdk.ide: Allow storage of yocto settings in project
    preferences
  plugins/sdk.ide: Store profile configuration on project setup
  plugins/sdk.ide: Enable project specific yocto settings
  plugins/sdk.ide: Update projects affected by changes of a target
    profile
  plugins/sdk.ide: Enable the usage of profiles in the project
    properties

 .../src/org/yocto/sdk/ide/YoctoProfileSetting.java |   3 +
 .../yocto/sdk/ide/YoctoProjectSpecificSetting.java |  89 ++++++++++++
 .../org/yocto/sdk/ide/YoctoSDKMessages.properties  |   5 +-
 .../org/yocto/sdk/ide/YoctoSDKProjectNature.java   |   1 +
 .../src/org/yocto/sdk/ide/YoctoSDKUtils.java       | 149 +++++++++++++++++++++
 .../sdk/ide/preferences/PreferenceConstants.java   |   2 +
 .../ide/preferences/YoctoSDKPreferencePage.java    |  91 ++++++++++++-
 .../preferences/YoctoSDKProjectPropertyPage.java   |  94 ++++++++++---
 8 files changed, 410 insertions(+), 24 deletions(-)  create mode 100644 plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProjectSpecificSetting.java

--
1.7.11.7

_______________________________________________
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [RFC v1 0/5][eclipse-poky] Enable target profiles for projects
  2013-02-08 22:56 ` [RFC v1 0/5][eclipse-poky] Enable target profiles for projects Zhang, Jessica
@ 2013-02-11 10:01   ` Timo Müller
  0 siblings, 0 replies; 8+ messages in thread
From: Timo Müller @ 2013-02-11 10:01 UTC (permalink / raw)
  To: Zhang, Jessica; +Cc: yocto, Timo Mueller

Hi Jessica,

Zhang, Jessica wrote, On 08.02.2013 23:56:
> Hi Timo,
>
> Couple comments:
>
> 1.  I really like the way that the global profile and project profile
> are linked together.  But it also introduce an out of sync issue.
> Say I use a profile compiled my project with one set of toolchain and
> sysroot setup.  Then I change the  toolchain and sysroot settings for
> the profile.  But unless we inform/enforce the user to rebuild the
> project with the new profile settings.  The built out in the project
> directory is using one set of setting, but by looking at the project
> profile setting is another set.  So, I think we need to add a
> notification to user like we're doing for "remove".  When user change
> a profile and if there're projects using the profile, we need to
> prompt the user  with something like: "The profile settings have been
> changed and there're projects using this profile which will be
> impacted.  If you want to pursue the changes, please rebuild those
> projects with the new profile settings".  And in those projects, we
> need a sign the inform the user that the underline profile has
> changed, they need to rebuild to resync.  Make sense?

Yes, makes sense. I haven't thought about this. Maybe I can also set the 
"dirty" flag on those projects, so they're automatically reconfigured 
when the build is started.

>
> 2. Seems we only allow user to choose profiles in project settings,
> can eliminate those grayed out "save as...", "remove", etc buttons?

The idea was to reuse the code from the global settings, but you're 
right, it would make sense to get rid of these button here as they are 
never activated.

>
> 3.  Also since the profile are really cross development setting
> profiles.  Can we change "Target profile" to "Cross development
> profile"?

Sure, this should be an easy one. I'll make the changes in the next 
version of the patch set.

>
> Thanks, Jessica
>
> -----Original Message----- From: yocto-bounces@yoctoproject.org
> [mailto:yocto-bounces@yoctoproject.org] On Behalf Of Timo Mueller
> Sent: Friday, February 08, 2013 5:28 AM To: yocto@yoctoproject.org
> Cc: Timo Mueller Subject: [yocto] [RFC v1 0/5][eclipse-poky] Enable
> target profiles for projects
>
> From: Timo Mueller <timo.mueller@bmw-carit.de>
>
> Hi,
>
> this patch set enables projects to make use of the target profiles
> proposed in "[RFC v4 00/17][eclipse-poky] Storing yocto settings as
> target profiles".
>
> Currently the target profiles are only used to determine the default
> settings when creating a new project. Changing the used profile on an
> already created projects is not possible, also if the target profile
> is changed the projects are not affected. This patch set enables the
> use of target profiles in the projects. You can select the used
> global profile within the projet properties or use a project specific
> configuration. If a global target profile is used and its values are
> changed in the eclipse preferences, the projects using this profile
> are updated accordingly.
>
> Best regards Timo

Thanks for the comments,
Timo




^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-02-11 10:01 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-08 13:28 [RFC v1 0/5][eclipse-poky] Enable target profiles for projects Timo Mueller
2013-02-08 13:28 ` [RFC v1 1/5] plugins/sdk.ide: Allow storage of yocto settings in project preferences Timo Mueller
2013-02-08 13:28   ` [RFC v1 2/5] plugins/sdk.ide: Store profile configuration on project setup Timo Mueller
2013-02-08 13:28     ` [RFC v1 3/5] plugins/sdk.ide: Enable project specific yocto settings Timo Mueller
2013-02-08 13:28       ` [RFC v1 4/5] plugins/sdk.ide: Update projects affected by changes of a target profile Timo Mueller
2013-02-08 13:28         ` [RFC v1 5/5] plugins/sdk.ide: Enable the usage of profiles in the project properties Timo Mueller
2013-02-08 22:56 ` [RFC v1 0/5][eclipse-poky] Enable target profiles for projects Zhang, Jessica
2013-02-11 10:01   ` Timo Müller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.