ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hi...@apache.org
Subject svn commit: r679119 - in /ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse: ./ src/java/org/apache/ivyde/eclipse/cpcontainer/ src/java/org/apache/ivyde/eclipse/ui/preferences/
Date Wed, 23 Jul 2008 16:03:46 GMT
Author: hibou
Date: Wed Jul 23 09:03:45 2008
New Revision: 679119

URL: http://svn.apache.org/viewvc?rev=679119&view=rev
Log:
IVYDE-105 : Retrieve after resolve feature does not clean target directory first
 - added a button in the UI to "synchronize" the retrieve

Modified:
    ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/CHANGES.txt
    ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainerConfiguration.java
    ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyResolveJob.java
    ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvydeContainerPage.java
    ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/IvyDEPreferenceStoreHelper.java
    ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/IvyPreferencePage.java
    ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/PreferenceConstants.java

Modified: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/CHANGES.txt
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/CHANGES.txt?rev=679119&r1=679118&r2=679119&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/CHANGES.txt (original)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/CHANGES.txt Wed Jul 23 09:03:45 2008
@@ -1,6 +1,11 @@
 				IvyDE 
 				============================================
 
+  next
+==========================
+- IMPROVE: Retrieve after resolve feature does not clean target directory first (IVYDE-105)
+
+
   version 2.0.0 alpha1
 ===========================
 - NEW: [build] Use the latest ivy to resolve dependencies (IVYDE-62) (thanks to Nicolas Lalevée)


Modified: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainerConfiguration.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainerConfiguration.java?rev=679119&r1=679118&r2=679119&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainerConfiguration.java
(original)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainerConfiguration.java
Wed Jul 23 09:03:45 2008
@@ -72,6 +72,8 @@
 
     String retrievePattern;
 
+    boolean retrieveSync = false;
+
     boolean alphaOrder;
 
     /**
@@ -174,6 +176,9 @@
             } else if (parameter[0].equals("retrievePattern")) {
                 retrievePattern = value;
                 isProjectSpecific = true;
+            } else if (parameter[0].equals("retrieveSync")) {
+                retrieveSync = Boolean.valueOf(value);
+                isProjectSpecific = true;
             } else if (parameter[0].equals("alphaOrder")) {
                 // if the value is not actually "true" or "false", the Boolean class ensure
to
                 // return false, so it is fine
@@ -236,6 +241,8 @@
                 path.append(URLEncoder.encode(Boolean.toString(doRetrieve), "UTF-8"));
                 path.append("&retrievePattern=");
                 path.append(URLEncoder.encode(retrievePattern, "UTF-8"));
+                path.append("&retrieveSync=");
+                path.append(URLEncoder.encode(Boolean.toString(retrieveSync), "UTF-8"));
                 path.append("&alphaOrder=");
                 path.append(URLEncoder.encode(Boolean.toString(alphaOrder), "UTF-8"));
             }
@@ -336,6 +343,13 @@
         return retrievePattern;
     }
 
+    public boolean getInheritedRetrieveSync() {
+        if (ivySettingsPath == null) {
+            return IvyPlugin.getPreferenceStoreHelper().getRetrieveSync();
+        }
+        return retrieveSync;
+    }
+
     public boolean isInheritedAlphaOrder() {
         if (ivySettingsPath == null) {
             return IvyPlugin.getPreferenceStoreHelper().isAlphOrder();

Modified: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyResolveJob.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyResolveJob.java?rev=679119&r1=679118&r2=679119&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyResolveJob.java
(original)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyResolveJob.java
Wed Jul 23 09:03:45 2008
@@ -374,7 +374,9 @@
             String pattern = conf.javaProject.getProject().getLocation().toPortableString()
+ "/"
                     + conf.getInheritedRetrievePattern();
             _monitor.setTaskName("retrieving dependencies in " + pattern);
-            ivy.retrieve(md.getModuleRevisionId(), pattern, new RetrieveOptions().setConfs(confs));
+            RetrieveOptions c = new RetrieveOptions().setConfs(confs);
+            c.setSync(conf.getInheritedRetrieveSync());
+            ivy.retrieve(md.getModuleRevisionId(), pattern, c);
         }
     }
 

Modified: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvydeContainerPage.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvydeContainerPage.java?rev=679119&r1=679118&r2=679119&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvydeContainerPage.java
(original)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvydeContainerPage.java
Wed Jul 23 09:03:45 2008
@@ -121,6 +121,8 @@
 
     private ModuleDescriptor md;
 
+    private Button retrieveSyncButton;
+
     /**
      * Constructor
      * 
@@ -156,6 +158,7 @@
             conf.javadocSuffixes = IvyClasspathUtil.split(javadocSuffixesText.getText());
             conf.doRetrieve = doRetrieveButton.getSelection();
             conf.retrievePattern = retrievePatternText.getText();
+            conf.retrieveSync = retrieveSyncButton.getSelection();
             conf.alphaOrder = alphaOrderCheck.getSelection();
         } else {
             conf.ivySettingsPath = null;
@@ -493,9 +496,15 @@
         retrievePatternText
                 .setToolTipText("Example: lib/[conf]/[artifact].[ext]\nTo copy artifacts
in folder named lib without revision by folder named like configurations");
 
+        retrieveSyncButton = new Button(configComposite, SWT.CHECK);
+        retrieveSyncButton.setText("Delete old retrieved artifacts");
+        retrieveSyncButton.setLayoutData(new GridData(GridData.FILL, GridData.FILL, false,
false, 2, 1));
+        retrieveSyncButton.setEnabled(doRetrieveButton.getSelection());
+
         doRetrieveButton.addSelectionListener(new SelectionAdapter() {
             public void widgetSelected(SelectionEvent e) {
                 retrievePatternText.setEnabled(doRetrieveButton.getSelection());
+                retrieveSyncButton.setEnabled(doRetrieveButton.getSelection());
             }
         });
 
@@ -527,6 +536,7 @@
             javadocSuffixesText.setText(IvyClasspathUtil.concat(conf.javadocSuffixes));
             doRetrieveButton.setSelection(conf.doRetrieve);
             retrievePatternText.setText(conf.retrievePattern);
+            retrieveSyncButton.setSelection(conf.retrieveSync);
             alphaOrderCheck.setSelection(conf.alphaOrder);
         } else {
             projectSpecificButton.setSelection(false);
@@ -539,6 +549,7 @@
             javadocSuffixesText.setText(IvyClasspathUtil.concat(helper.getJavadocSuffixes()));
             doRetrieveButton.setSelection(helper.getDoRetrieve());
             retrievePatternText.setText(helper.getRetrievePattern());
+            retrieveSyncButton.setSelection(helper.getRetrieveSync());
             alphaOrderCheck.setSelection(helper.isAlphOrder());
         }
 
@@ -557,6 +568,7 @@
         javadocSuffixesText.setEnabled(projectSpecific);
         doRetrieveButton.setEnabled(projectSpecific);
         retrievePatternText.setEnabled(doRetrieveButton.getSelection() && projectSpecific);
+        retrieveSyncButton.setEnabled(doRetrieveButton.getSelection() && projectSpecific);
         alphaOrderCheck.setEnabled(projectSpecific);
     }
 

Modified: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/IvyDEPreferenceStoreHelper.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/IvyDEPreferenceStoreHelper.java?rev=679119&r1=679118&r2=679119&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/IvyDEPreferenceStoreHelper.java
(original)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/IvyDEPreferenceStoreHelper.java
Wed Jul 23 09:03:45 2008
@@ -85,6 +85,10 @@
         return prefStore.getString(PreferenceConstants.RETRIEVE_PATTERN);
     }
 
+    public boolean getRetrieveSync() {
+        return prefStore.getBoolean(PreferenceConstants.RETRIEVE_SYNC);
+    }
+
     public boolean isAlphOrder() {
         return prefStore.getBoolean(PreferenceConstants.ALPHABETICAL_ORDER);
     }

Modified: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/IvyPreferencePage.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/IvyPreferencePage.java?rev=679119&r1=679118&r2=679119&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/IvyPreferencePage.java
(original)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/IvyPreferencePage.java
Wed Jul 23 09:03:45 2008
@@ -56,6 +56,8 @@
 
     private StringFieldEditor _pattern;
 
+    private BooleanFieldEditor _retreiveSync;
+
     public IvyPreferencePage() {
         super(GRID);
         setPreferenceStore(IvyPlugin.getDefault().getPreferenceStore());
@@ -123,6 +125,7 @@
                 b.addSelectionListener(new SelectionAdapter() {
                     public void widgetSelected(SelectionEvent e) {
                         _pattern.setEnabled(b.getSelection(), parent);
+                        _retreiveSync.setEnabled(b.getSelection(), parent);
                     }
                 });
             }
@@ -131,8 +134,11 @@
                 fieldParent);
         _pattern.setEnabled(getPreferenceStore().getBoolean(PreferenceConstants.DO_RETRIEVE),
             fieldParent);
+        _retreiveSync = new BooleanFieldEditor(PreferenceConstants.RETRIEVE_SYNC,
+                "Delete old retrieved artifacts", fieldParent);
         addField(doR);
         addField(_pattern);
+        addField(_retreiveSync);
 
         new Label(fieldParent, SWT.NONE); // space
         explanation = new Label(fieldParent, SWT.NONE);

Modified: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/PreferenceConstants.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/PreferenceConstants.java?rev=679119&r1=679118&r2=679119&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/PreferenceConstants.java
(original)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/PreferenceConstants.java
Wed Jul 23 09:03:45 2008
@@ -48,6 +48,8 @@
 
     public static final String RETRIEVE_PATTERN = "retreive.pattern";
 
+    public static final String RETRIEVE_SYNC = "retreive.sync";
+
     public static final String ALPHABETICAL_ORDER = "order.alphabetical";
 
 }



Mime
View raw message