Skip to content

Commit

Permalink
Provide support for improved configuration of Git repositories
Browse files Browse the repository at this point in the history
  • Loading branch information
merks committed Jan 21, 2024
1 parent 72c836c commit a35040f
Show file tree
Hide file tree
Showing 31 changed files with 1,953 additions and 305 deletions.
2 changes: 1 addition & 1 deletion features/org.eclipse.oomph.setup.git-feature/feature.xml
Expand Up @@ -12,7 +12,7 @@
<feature
id="org.eclipse.oomph.setup.git"
label="%featureName"
version="1.24.0.qualifier"
version="1.25.0.qualifier"
provider-name="%providerName"
license-feature="org.eclipse.oomph.license"
license-feature-version="0.0.0">
Expand Down
2 changes: 1 addition & 1 deletion features/org.eclipse.oomph.setup.git-feature/pom.xml
Expand Up @@ -20,6 +20,6 @@
</parent>
<groupId>org.eclipse.oomph.features</groupId>
<artifactId>org.eclipse.oomph.setup.git</artifactId>
<version>1.24.0-SNAPSHOT</version>
<version>1.25.0-SNAPSHOT</version>
<packaging>eclipse-feature</packaging>
</project>
8 changes: 4 additions & 4 deletions plugins/org.eclipse.oomph.setup.git.edit/META-INF/MANIFEST.MF
Expand Up @@ -2,17 +2,17 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.oomph.setup.git.edit;singleton:=true
Bundle-Version: 1.15.0.qualifier
Bundle-Version: 1.16.0.qualifier
Bundle-ClassPath: .
Bundle-Activator: org.eclipse.oomph.setup.git.provider.GitEditPlugin$Implementation
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: JavaSE-11
Export-Package: org.eclipse.oomph.setup.git.provider;version="1.15.0";x-internal:=true
Export-Package: org.eclipse.oomph.setup.git.provider;version="1.16.0";x-internal:=true
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.24.0,4.0.0)",
org.eclipse.emf.edit;bundle-version="[2.10.0,3.0.0)";visibility:=reexport,
org.eclipse.oomph.setup.git;bundle-version="[1.23.0,2.0.0)";visibility:=reexport,
org.eclipse.oomph.setup.git;bundle-version="[1.25.0,2.0.0)";visibility:=reexport,
org.eclipse.oomph.base.edit;bundle-version="[1.17.0,2.0.0)";visibility:=reexport,
org.eclipse.oomph.setup.edit;bundle-version="[1.16.0,2.0.0)";visibility:=reexport
org.eclipse.oomph.setup.edit;bundle-version="[1.17.0,2.0.0)";visibility:=reexport
Bundle-ActivationPolicy: lazy
Automatic-Module-Name: org.eclipse.oomph.setup.git.edit
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 19 additions & 7 deletions plugins/org.eclipse.oomph.setup.git.edit/plugin.properties
Expand Up @@ -30,17 +30,29 @@ _UI_GitCloneTask_remoteURI_feature = Remote URI
_UI_GitCloneTask_pushURI_feature = Push URI
_UI_GitCloneTask_userID_feature = User ID
_UI_GitCloneTask_checkoutBranch_feature = Checkout Branch

_UI_GitCloneTask_restrictToCheckoutBranch_feature = Restrict To Checkout Branch
_UI_GitCloneTask_locationQualifier_feature = Location Qualifier
_UI_GitCloneTask_recursive_feature = Recursive
_UI_ConfigSection_type = Config Section
_UI_ConfigSubsection_type = Config Subsection
_UI_ConfigProperty_type = Config Property
_UI_GitCloneTask_configSections_feature = Config Sections
_UI_GitCloneTask_configurations_feature = Configurations
_UI_GitCloneTask_locationQualifier_description = The qualifier used in the computed location to help ensure that the Git repository's folder name is unique

_UI_ConfigSection_type = Config Section
_UI_ConfigSection_subsections_feature = Subsections

_UI_ConfigSubsection_type = Config Subsection
_UI_ConfigSubsection_name_feature = Name
_UI_ConfigSubsection_properties_feature = Properties

_UI_ConfigProperty_type = Config Property
_UI_ConfigProperty_key_feature = Key
_UI_ConfigProperty_value_feature = Value
_UI_GitCloneTask_restrictToCheckoutBranch_feature = Restrict To Checkout Branch
_UI_GitCloneTask_locationQualifier_feature = Location Qualifier
_UI_GitCloneTask_locationQualifier_description = The qualifier used in the computed location to help ensure that the Git repository's folder name is unique
_UI_ConfigProperty_force_feature = Force
_UI_ConfigProperty_force_description = Whether to force the property to the specified value even if the property is set to a different value
_UI_ConfigProperty_recursive_feature = Recursive
_UI_ConfigProperty_recursive_description = Whether to apply this configuration property also on submodules

_UI_GitConfigurationTask_type = Git Configuration
_UI_GitConfigurationTask_remoteURIPattern_feature = Remote URI Pattern
_UI_GitConfigurationTask_remoteURIPattern_description = A pattern used to match against the resolved URI of Git clone tasks
_UI_GitConfigurationTask_configSections_feature = Config Sections
2 changes: 1 addition & 1 deletion plugins/org.eclipse.oomph.setup.git.edit/pom.xml
Expand Up @@ -20,7 +20,7 @@
</parent>
<groupId>org.eclipse.oomph</groupId>
<artifactId>org.eclipse.oomph.setup.git.edit</artifactId>
<version>1.15.0-SNAPSHOT</version>
<version>1.16.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>

<build>
Expand Down
Expand Up @@ -65,6 +65,8 @@ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object)

addKeyPropertyDescriptor(object);
addValuePropertyDescriptor(object);
addForcePropertyDescriptor(object);
addRecursivePropertyDescriptor(object);
}
return itemPropertyDescriptors;
}
Expand Down Expand Up @@ -97,6 +99,34 @@ protected void addValuePropertyDescriptor(Object object)
GitPackage.Literals.CONFIG_PROPERTY__VALUE, true, true, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
}

/**
* This adds a property descriptor for the Force feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addForcePropertyDescriptor(Object object)
{
itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(),
getString("_UI_ConfigProperty_force_feature"), //$NON-NLS-1$
getString("_UI_ConfigProperty_force_description"), //$NON-NLS-1$
GitPackage.Literals.CONFIG_PROPERTY__FORCE, true, false, false, ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, null, null));
}

/**
* This adds a property descriptor for the Recursive feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addRecursivePropertyDescriptor(Object object)
{
itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(),
getString("_UI_ConfigProperty_recursive_feature"), //$NON-NLS-1$
getString("_UI_ConfigProperty_recursive_description"), //$NON-NLS-1$
GitPackage.Literals.CONFIG_PROPERTY__RECURSIVE, true, false, false, ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, null, null));
}

/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
Expand Down Expand Up @@ -162,6 +192,8 @@ public void notifyChanged(Notification notification)
{
case GitPackage.CONFIG_PROPERTY__KEY:
case GitPackage.CONFIG_PROPERTY__VALUE:
case GitPackage.CONFIG_PROPERTY__FORCE:
case GitPackage.CONFIG_PROPERTY__RECURSIVE:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
return;
}
Expand Down
Expand Up @@ -153,16 +153,14 @@ public void notifyChanged(Notification notification)
* that can be created under this object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @generated NOT
*/
@Override
protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object)
{
super.collectNewChildDescriptors(newChildDescriptors, object);

newChildDescriptors.add(createChildParameter(GitPackage.Literals.CONFIG_SECTION__SUBSECTIONS, GitFactory.eINSTANCE.createConfigSubsection()));

newChildDescriptors.add(createChildParameter(GitPackage.Literals.CONFIG_SECTION__SUBSECTIONS, GitFactory.eINSTANCE.createConfigSection()));
}

}
Expand Up @@ -10,14 +10,19 @@
*/
package org.eclipse.oomph.setup.git.provider;

import org.eclipse.oomph.setup.git.ConfigSection;
import org.eclipse.oomph.setup.git.ConfigSubsection;
import org.eclipse.oomph.setup.git.GitFactory;
import org.eclipse.oomph.setup.git.GitPackage;

import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.common.command.UnexecutableCommand;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.util.ResourceLocator;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
Expand Down Expand Up @@ -193,16 +198,25 @@ public void notifyChanged(Notification notification)
* that can be created under this object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @generated NOT
*/
@Override
protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object)
{
super.collectNewChildDescriptors(newChildDescriptors, object);

newChildDescriptors.add(createChildParameter(GitPackage.Literals.CONFIG_SUBSECTION__PROPERTIES, GitFactory.eINSTANCE.createConfigProperty()));
}

@Override
protected Command createAddCommand(EditingDomain domain, EObject owner, EStructuralFeature feature, Collection<?> collection, int index)
{
if (collection.stream().anyMatch(ConfigSection.class::isInstance))
{
return UnexecutableCommand.INSTANCE;
}

return super.createAddCommand(domain, owner, feature, collection, index);
}

/**
* Return the resource locator for this item provider's resources.
* <!-- begin-user-doc -->
Expand Down
Expand Up @@ -203,6 +203,7 @@ public Collection<? extends EStructuralFeature> getChildrenFeatures(Object objec
{
super.getChildrenFeatures(object);
childrenFeatures.add(GitPackage.Literals.GIT_CLONE_TASK__CONFIG_SECTIONS);
childrenFeatures.add(GitPackage.Literals.GIT_CLONE_TASK__CONFIGURATIONS);
}
return childrenFeatures;
}
Expand Down Expand Up @@ -288,6 +289,7 @@ public void notifyChanged(Notification notification)
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
return;
case GitPackage.GIT_CLONE_TASK__CONFIG_SECTIONS:
case GitPackage.GIT_CLONE_TASK__CONFIGURATIONS:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
return;
}
Expand Down

0 comments on commit a35040f

Please sign in to comment.