[Nice-commit] Nice/src/bossa/modules Package.java,1.118,1.119 Locator.java,1.4,1.5 Compilation.nice,
Brought to you by:
bonniot
From: Daniel B. <bo...@us...> - 2004-08-07 14:57:42
|
Update of /cvsroot/nice/Nice/src/bossa/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv758/src/bossa/modules Modified Files: Package.java Locator.java Compilation.nice Log Message: Implementation of remote package repositories. Index: Locator.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/modules/Locator.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Locator.java 2 Jul 2004 19:31:03 -0000 1.4 --- Locator.java 7 Aug 2004 14:57:33 -0000 1.5 *************** *** 15,21 **** import java.io.*; import java.util.LinkedList; ! import java.util.jar.JarFile; import bossa.util.Debug; import bossa.util.User; /** --- 15,22 ---- import java.io.*; import java.util.LinkedList; ! import java.net.URL; import bossa.util.Debug; import bossa.util.User; + import nice.tools.repository.VersionTracker; /** *************** *** 28,52 **** final class Locator { ! Locator (Compilation compilation, String classpath) { ! sources = new nice.tools.locator.Locator ! (compilation.sourcePath, ! new gnu.mapping.Procedure1() { ! public Object apply1(Object o) { ! String message = (String) o; ! User.warning(message); ! return null; ! } ! }); ! packages = new nice.tools.locator.Locator ! (classpath, ! new gnu.mapping.Procedure1() { ! public Object apply1(Object o) { ! String message = (String) o; ! User.warning(message); ! return null; ! } ! }); } --- 29,48 ---- final class Locator { ! Locator (Compilation compilation, String classpath, URL repository) { ! gnu.mapping.Procedure1 warning = new gnu.mapping.Procedure1() { ! public Object apply1(Object o) { ! String message = (String) o; ! User.warning(message); ! return null; ! } ! }; ! sources = new nice.tools.locator.Locator(compilation.sourcePath, warning); ! packages = new nice.tools.locator.Locator(classpath, warning); ! ! vt = nice.tools.repository.dispatch.versionTracker ! (new File("nice.versions").getAbsoluteFile()); ! remote = new nice.tools.locator.Locator(vt.repository(repository)); } *************** *** 64,67 **** --- 60,67 ---- source = DirectorySourceContent.create(pkg, sroot.getURL()); + // If the package couldn't be found locally, try remotely. + if (source == null && croot == null) + croot = remote.get(name + "/package.nicei"); + if (croot != null) compiled = CompiledContent.create(pkg, croot.getURL()); *************** *** 75,78 **** --- 75,83 ---- } + void save() + { + vt.save(); + } + /**************************************************************** * Private *************** *** 84,86 **** --- 89,96 ---- /** where to find compiled packages. */ private final nice.tools.locator.Locator packages; + + /** remote location where to find imported packages. */ + private final nice.tools.locator.Locator remote; + + private VersionTracker vt; } Index: Compilation.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/modules/Compilation.nice,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** Compilation.nice 30 Jun 2004 14:12:38 -0000 1.28 --- Compilation.nice 7 Aug 2004 14:57:33 -0000 1.29 *************** *** 14,17 **** --- 14,19 ---- import mlsub.compilation; + import nice.tools.locator; + import nice.tools.repository; /** *************** *** 49,53 **** ?String runtimeFile = null; ! ?Locator locator = null; CompilationListener listener; --- 51,55 ---- ?String runtimeFile = null; ! ?bossa.modules.Locator locator = null; CompilationListener listener; *************** *** 80,85 **** Package.startNewCompilation(); // Create the locator that uses these two pathes to locate packages. ! this.locator = new Locator(this, classpath); // forces reading nice.lang first --- 82,89 ---- Package.startNewCompilation(); + let repository = System.getProperty + ("nice.repository", "http://packages.sourceforge.net/repository/"); // Create the locator that uses these two pathes to locate packages. ! this.locator = new bossa.modules.Locator(this, classpath, new java.net.URL(repository)); // forces reading nice.lang first Index: Package.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/modules/Package.java,v retrieving revision 1.118 retrieving revision 1.119 diff -C2 -d -r1.118 -r1.119 *** Package.java 30 Jul 2004 19:08:46 -0000 1.118 --- Package.java 7 Aug 2004 14:57:33 -0000 1.119 *************** *** 348,351 **** --- 348,353 ---- // This is useful to bundle the application after it was compiled. writeArchive(); + + compilation.locator.save(); } |