felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mccu...@apache.org
Subject svn commit: r1351297 - in /felix/trunk/bundleplugin/src/main/java/aQute: bnd/build/ bnd/maven/ bnd/repo/eclipse/ lib/deployer/ lib/osgi/
Date Mon, 18 Jun 2012 11:15:16 GMT
Author: mcculls
Date: Mon Jun 18 11:15:15 2012
New Revision: 1351297

URL: http://svn.apache.org/viewvc?rev=1351297&view=rev
Log:
Another bnd code refresh

Modified:
    felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/Container.java
    felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/Project.java
    felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/Workspace.java
    felix/trunk/bundleplugin/src/main/java/aQute/bnd/maven/MavenRepository.java
    felix/trunk/bundleplugin/src/main/java/aQute/bnd/repo/eclipse/EclipseRepo.java
    felix/trunk/bundleplugin/src/main/java/aQute/lib/deployer/FileRepo.java
    felix/trunk/bundleplugin/src/main/java/aQute/lib/osgi/Annotation.java
    felix/trunk/bundleplugin/src/main/java/aQute/lib/osgi/Processor.java

Modified: felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/Container.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/Container.java?rev=1351297&r1=1351296&r2=1351297&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/Container.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/Container.java Mon Jun 18 11:15:15
2012
@@ -9,7 +9,7 @@ import aQute.lib.osgi.*;
 
 public class Container {
 	public enum TYPE {
-		REPO, PROJECT, PROJECT_BUNDLE, EXTERNAL, LIBRARY, ERROR
+		REPO, PROJECT, EXTERNAL, LIBRARY, ERROR
 	}
 
 	final File					file;

Modified: felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/Project.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/Project.java?rev=1351297&r1=1351296&r2=1351297&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/Project.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/Project.java Mon Jun 18 11:15:15
2012
@@ -998,6 +998,9 @@ public class Project extends Processor {
 					case LOWEST :
 						provider = versions.firstKey();
 						break;
+					case EXACT :
+						// TODO need to handle exact better
+						break;
 				}
 				if (provider != null) {
 					RepositoryPlugin repo = versions.get(provider);
@@ -1274,6 +1277,11 @@ public class Project extends Processor {
 	 * Check if this project needs building. This is defined as:
 	 */
 	public boolean isStale() throws Exception {
+		if ( workspace.isOffline()) {
+			trace("working %s offline, so always stale", this);
+			return true;
+		}
+		
 		Set<Project> visited = new HashSet<Project>();
 		return isStale(visited);
 	}
@@ -1320,6 +1328,7 @@ public class Project extends Processor {
 					return true;
 			}
 		}
+		
 		return false;
 	}
 

Modified: felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/Workspace.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/Workspace.java?rev=1351297&r1=1351296&r2=1351297&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/Workspace.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/build/Workspace.java Mon Jun 18 11:15:15
2012
@@ -28,6 +28,7 @@ public class Workspace extends Processor
 	final Map<String,Action>					commands	= newMap();
 	final File									buildDir;
 	final Maven									maven		= new Maven(Processor.getExecutor());
+	private boolean								offline		= true;
 
 	/**
 	 * This static method finds the workspace and creates a project (or returns
@@ -188,6 +189,7 @@ public class Workspace extends Processor
 		List<BndListener> listeners = getPlugins(BndListener.class);
 		for (BndListener l : listeners)
 			try {
+				offline = false;
 				l.changed(f);
 			}
 			catch (Exception e) {
@@ -360,4 +362,19 @@ public class Workspace extends Processor
 		list.add(new CachedFileRepo());
 	}
 
+	/**
+	 * Return if we're in offline mode. Offline mode is defined as an
+	 * environment where nobody tells us the resources are out of date (refresh
+	 * or changed). This is currently defined as having bndlisteners.
+	 * 
+	 * @return
+	 */
+	public boolean isOffline() {
+		return offline;
+	}
+
+	public Workspace setOffline(boolean on) {
+		this.offline = on;
+		return this;
+	}
 }

Modified: felix/trunk/bundleplugin/src/main/java/aQute/bnd/maven/MavenRepository.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/maven/MavenRepository.java?rev=1351297&r1=1351296&r2=1351297&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/maven/MavenRepository.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/maven/MavenRepository.java Mon Jun 18
11:15:15 2012
@@ -185,6 +185,9 @@ public class MavenRepository implements 
 					return files[0];
 				case HIGHEST :
 					return files[files.length - 1];
+				case EXACT :
+					// TODO exact
+					break;
 			}
 		}
 		return null;

Modified: felix/trunk/bundleplugin/src/main/java/aQute/bnd/repo/eclipse/EclipseRepo.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/bnd/repo/eclipse/EclipseRepo.java?rev=1351297&r1=1351296&r2=1351297&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/bnd/repo/eclipse/EclipseRepo.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/bnd/repo/eclipse/EclipseRepo.java Mon Jun
18 11:15:15 2012
@@ -189,6 +189,9 @@ public class EclipseRepo implements Plug
 					return files[0];
 				case HIGHEST :
 					return files[files.length - 1];
+				case EXACT :
+					// TODO exact version handing
+					break;
 			}
 		}
 		return null;

Modified: felix/trunk/bundleplugin/src/main/java/aQute/lib/deployer/FileRepo.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/lib/deployer/FileRepo.java?rev=1351297&r1=1351296&r2=1351297&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/lib/deployer/FileRepo.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/lib/deployer/FileRepo.java Mon Jun 18 11:15:15
2012
@@ -313,6 +313,9 @@ public class FileRepo implements Plugin,
 					return files[0];
 				case HIGHEST :
 					return files[files.length - 1];
+				case EXACT :
+					// TODO
+					break;
 			}
 		}
 		return null;

Modified: felix/trunk/bundleplugin/src/main/java/aQute/lib/osgi/Annotation.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/lib/osgi/Annotation.java?rev=1351297&r1=1351296&r2=1351297&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/lib/osgi/Annotation.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/lib/osgi/Annotation.java Mon Jun 18 11:15:15
2012
@@ -6,7 +6,6 @@ import java.util.*;
 import aQute.bnd.annotation.metatype.*;
 import aQute.lib.osgi.Descriptors.TypeRef;
 
-@SuppressWarnings("unchecked")
 public class Annotation {
 	TypeRef				name;
 	Map<String,Object>	elements;

Modified: felix/trunk/bundleplugin/src/main/java/aQute/lib/osgi/Processor.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/aQute/lib/osgi/Processor.java?rev=1351297&r1=1351296&r2=1351297&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/aQute/lib/osgi/Processor.java (original)
+++ felix/trunk/bundleplugin/src/main/java/aQute/lib/osgi/Processor.java Mon Jun 18 11:15:15
2012
@@ -128,7 +128,7 @@ public class Processor extends Domain im
 		if (p.isFailOk())
 			p.warning(string, args);
 		else {
-			String s = formatArrays(string, args);
+			String s = formatArrays(string, args == null ? new Object[0] : args);
 			if (!p.errors.contains(s))
 				p.errors.add(s);
 		}
@@ -142,7 +142,7 @@ public class Processor extends Domain im
 			p.warning(string + ": " + t, args);
 		else {
 			p.errors.add("Exception: " + t.getMessage());
-			String s = formatArrays(string, args);
+			String s = formatArrays(string, args == null ? new Object[0] : args);
 			if (!p.errors.contains(s))
 				p.errors.add(s);
 		}



Mime
View raw message