ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hi...@apache.org
Subject svn commit: r1028394 - in /ant/ivy/ivyde/trunk: doc/ org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/resolve/ org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/
Date Thu, 28 Oct 2010 17:19:54 GMT
Author: hibou
Date: Thu Oct 28 17:19:54 2010
New Revision: 1028394

URL: http://svn.apache.org/viewvc?rev=1028394&view=rev
Log:
Add an offline mode

Modified:
    ant/ivy/ivyde/trunk/doc/release-notes.html
    ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/resolve/IvyResolver.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
    ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/PreferenceInitializer.java

Modified: ant/ivy/ivyde/trunk/doc/release-notes.html
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/doc/release-notes.html?rev=1028394&r1=1028393&r2=1028394&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/doc/release-notes.html (original)
+++ ant/ivy/ivyde/trunk/doc/release-notes.html Thu Oct 28 17:19:54 2010
@@ -127,6 +127,7 @@ List of changes since <a href="/ivy/ivyd
     <li>NEW: an IvyDE classpath can now be retrieved (IVYDE-56)</li>
     <li>NEW: Add branch comparison to workspace resolver (IVYDE-234) (thanks to Jeffrey
M. Metcalf)</li>
     <li>NEW: Look for ivysettings.xml file in project root copying the behavior of
ivy ant task (IVYDE-258)</li>
+    <li>NEW: IvyDE can now resolve in an offline mode, where Ivy use only the caches
(Ivy 2.3 required)</li>
 </ul><ul>
     <li>IMPROVE: let IvyDE refresh workspace after a resolve (IVYDE-27) (thanks to
Clint Burghduff)</li>
     <li>IMPROVE: IvyDE now resolve by batch, then preventing too many workspace build
(IVYDE-177)</li>

Modified: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/resolve/IvyResolver.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/resolve/IvyResolver.java?rev=1028394&r1=1028393&r2=1028394&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/resolve/IvyResolver.java
(original)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/resolve/IvyResolver.java
Thu Oct 28 17:19:54 2010
@@ -73,6 +73,8 @@ public class IvyResolver {
 
     private final String ivyXmlPath;
 
+    private boolean useCacheOnly = IvyPlugin.getPreferenceStoreHelper().isOffline();
+
     public IvyResolver(String ivyXmlPath, List confInput, IProject project) {
         this.ivyXmlPath = ivyXmlPath;
         this.confInput = confInput;
@@ -95,6 +97,10 @@ public class IvyResolver {
         this.retrieveTypes = retrieveTypes;
     }
 
+    public void setUseCacheOnly(boolean useCacheOnly) {
+        this.useCacheOnly = useCacheOnly;
+    }
+
     public String getIvyXmlPath() {
         return ivyXmlPath;
     }
@@ -205,8 +211,10 @@ public class IvyResolver {
 
     private ResolveResult doResolve(Ivy ivy, ModuleDescriptor md) throws ParseException,
             IOException {
-        ResolveOptions resolveOption = new ResolveOptions().setConfs(confs);
+        ResolveOptions resolveOption = new ResolveOptions();
+        resolveOption.setConfs(confs);
         resolveOption.setValidate(ivy.getSettings().doValidate());
+        resolveOption.setUseCacheOnly(useCacheOnly);
         ResolveReport report = ivy.resolve(md, resolveOption);
 
         ResolveResult result = new ResolveResult(report);

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=1028394&r1=1028393&r2=1028394&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
Thu Oct 28 17:19:54 2010
@@ -271,4 +271,12 @@ public class IvyDEPreferenceStoreHelper 
                 .getRetrieveTypes());
     }
 
+    public boolean isOffline() {
+        return prefStore.getBoolean(PreferenceConstants.OFFLINE);
+    }
+
+    public void setOffline(boolean offline) {
+        prefStore.setValue(PreferenceConstants.OFFLINE, offline);
+    }
+
 }

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=1028394&r1=1028393&r2=1028394&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
Thu Oct 28 17:19:54 2010
@@ -65,6 +65,8 @@ public class IvyPreferencePage extends P
 
     private Button doNothingOnChangeButton;
 
+    private Button offlineButton;
+
     public IvyPreferencePage() {
         setPreferenceStore(IvyPlugin.getDefault().getPreferenceStore());
         Object ivydeVersion = IvyPlugin.getDefault().getBundle().getHeaders().get(
@@ -87,6 +89,10 @@ public class IvyPreferencePage extends P
         Label horizontalLine = new Label(composite, SWT.SEPARATOR | SWT.HORIZONTAL);
         horizontalLine.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
 
+        offlineButton = new Button(composite, SWT.CHECK);
+        offlineButton.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false,
3, 1));
+        offlineButton.setText("Offline (use only the caches)");
+
         Group startupGroup = new Group(composite, SWT.NONE);
         startupGroup.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
         startupGroup.setLayout(new GridLayout());
@@ -170,6 +176,8 @@ public class IvyPreferencePage extends P
 
         organizationText.setText(helper.getIvyOrg());
         organizationUrlText.setText(helper.getIvyOrgUrl());
+
+        offlineButton.setSelection(helper.isOffline());
     }
 
     public boolean performOk() {
@@ -191,6 +199,8 @@ public class IvyPreferencePage extends P
 
         helper.setOrganization(organizationText.getText());
         helper.setOrganizationUrl(organizationUrlText.getText());
+        
+        helper.setOffline(offlineButton.getSelection());
         return true;
     }
 
@@ -218,5 +228,7 @@ public class IvyPreferencePage extends P
 
         organizationText.setText(PreferenceInitializer.DEFAULT_ORGANISATION);
         organizationUrlText.setText(PreferenceInitializer.DEFAULT_ORGANISATION_URL);
+
+        offlineButton.setSelection(PreferenceInitializer.DEFAULT_OFFLINE);
     }
 }

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=1028394&r1=1028393&r2=1028394&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
Thu Oct 28 17:19:54 2010
@@ -110,4 +110,6 @@ public final class PreferenceConstants {
 
     public static final String MAP_IF_ONLY_ONE_JAVADOC = "mapIfOnlyOneJavadoc";
 
+    public static final String OFFLINE = "offline";
+
 }

Modified: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/PreferenceInitializer.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/PreferenceInitializer.java?rev=1028394&r1=1028393&r2=1028394&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/PreferenceInitializer.java
(original)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/PreferenceInitializer.java
Thu Oct 28 17:19:54 2010
@@ -120,6 +120,8 @@ public class PreferenceInitializer exten
         DEFAULT_RETRIEVED_CLASSPATH_SETUP.setRetrieveTypes(DEFAULT_RETRIEVED_CLASSPATH_TYPES);
     }
 
+    public static final boolean DEFAULT_OFFLINE = false;
+
     public void initializeDefaultPreferences() {
         IPreferenceStore store = IvyPlugin.getDefault().getPreferenceStore();
         store.setDefault(PreferenceConstants.P_BOOLEAN, true);
@@ -179,6 +181,8 @@ public class PreferenceInitializer exten
             DEFAULT_RETRIEVED_CLASSPATH_SYNC);
         store.setDefault(PreferenceConstants.RETRIEVED_CLASSPATH_TYPES,
             DEFAULT_RETRIEVED_CLASSPATH_TYPES);
+
+        store.setDefault(PreferenceConstants.OFFLINE, DEFAULT_OFFLINE);
     }
 
 }



Mime
View raw message