clirr-devel Mailing List for Clirr (Page 42)
Status: Alpha
Brought to you by:
lkuehne
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(15) |
Oct
(23) |
Nov
|
Dec
(25) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(9) |
Feb
|
Mar
|
Apr
|
May
(76) |
Jun
(207) |
Jul
(242) |
Aug
(42) |
Sep
(33) |
Oct
|
Nov
(7) |
Dec
(1) |
2005 |
Jan
|
Feb
|
Mar
(5) |
Apr
|
May
|
Jun
|
Jul
(3) |
Aug
(66) |
Sep
(38) |
Oct
(6) |
Nov
|
Dec
(2) |
2006 |
Jan
(17) |
Feb
(5) |
Mar
(28) |
Apr
(6) |
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
(1) |
Nov
(1) |
Dec
(7) |
2007 |
Jan
|
Feb
|
Mar
|
Apr
(7) |
May
(33) |
Jun
(4) |
Jul
(3) |
Aug
|
Sep
(5) |
Oct
|
Nov
|
Dec
|
2008 |
Jan
(4) |
Feb
(3) |
Mar
(2) |
Apr
|
May
(1) |
Jun
|
Jul
(6) |
Aug
(8) |
Sep
(5) |
Oct
(20) |
Nov
(7) |
Dec
(9) |
2009 |
Jan
(8) |
Feb
(3) |
Mar
(20) |
Apr
(10) |
May
(40) |
Jun
(11) |
Jul
(23) |
Aug
(4) |
Sep
(1) |
Oct
(1) |
Nov
|
Dec
(2) |
2010 |
Jan
(5) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
(3) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
(6) |
May
(22) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
(1) |
Dec
(2) |
2014 |
Jan
(5) |
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2015 |
Jan
(1) |
Feb
(2) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Lars K?h. <lk...@us...> - 2003-10-05 17:54:39
|
Update of /cvsroot/clirr/clirr/src/test/net/sf/clirr In directory sc8-pr-cvs1:/tmp/cvs-serv23255/src/test/net/sf/clirr Added Files: CheckerFactory.java Log Message: a great day for Clirr - started to add unit tests --- NEW FILE --- package net.sf.clirr; import net.sf.clirr.framework.ClassChangeCheck; /** * Provides a way for check tests to create a checker via the package private * Checker constructor, even if the tests are not in the same package. */ public class CheckerFactory { public static Checker createChecker(ClassChangeCheck check) { return new Checker(check); } } |
From: Lars K?h. <lk...@us...> - 2003-10-05 17:54:38
|
Update of /cvsroot/clirr/clirr/src/test/net/sf/clirr/ant In directory sc8-pr-cvs1:/tmp/cvs-serv23255/src/test/net/sf/clirr/ant Added Files: ChangeCounterTest.java Log Message: a great day for Clirr - started to add unit tests --- NEW FILE --- package net.sf.clirr.ant; import junit.framework.TestCase; import net.sf.clirr.event.ApiDifference; import net.sf.clirr.event.Severity; public class ChangeCounterTest extends TestCase { public void testCorrectCounting() { ChangeCounter counter = new ChangeCounter(); counter.reportDiff(new ApiDifference("blah", Severity.WARNING)); counter.reportDiff(new ApiDifference("blah", Severity.ERROR)); counter.reportDiff(new ApiDifference("blah", Severity.INFO)); counter.reportDiff(new ApiDifference("blah", Severity.ERROR)); counter.reportDiff(new ApiDifference("blah", Severity.ERROR)); counter.reportDiff(new ApiDifference("blah", Severity.WARNING)); assertEquals(3, counter.getErrors()); assertEquals(2, counter.getWarnings()); assertEquals(1, counter.getInfos()); } } |
From: Lars K?h. <lk...@us...> - 2003-10-05 17:54:38
|
Update of /cvsroot/clirr/clirr/src/test/net/sf/clirr/checks In directory sc8-pr-cvs1:/tmp/cvs-serv23255/src/test/net/sf/clirr/checks Added Files: AbstractCheckTestCase.java GenderChangeCheckTest.java TestDiffListener.java Log Message: a great day for Clirr - started to add unit tests --- NEW FILE --- package net.sf.clirr.checks; import java.io.File; import java.net.URL; import java.net.URLClassLoader; import junit.framework.TestCase; import net.sf.clirr.Checker; import net.sf.clirr.CheckerFactory; import net.sf.clirr.event.ApiDifference; import net.sf.clirr.framework.ClassChangeCheck; import org.apache.bcel.util.ClassSet; /** * Abstract Baseclass to test individual Checks. * @author lkuehne */ public abstract class AbstractCheckTestCase extends TestCase { protected final File getTestInputDir() { // property is set in project.properties return new File(System.getProperty("testinput")); } protected void verify( Checker checker, ClassSet baseline, ClassSet current, ApiDifference[] expected) { } protected File[] getBaseLine() { return new File[]{ new File(getTestInputDir(), "testlib-v1.jar") }; } protected File[] getCurrent() { return new File[]{ new File(getTestInputDir(), "testlib-v2.jar") }; } protected void verify(ApiDifference[] expected) { TestDiffListener tdl = new TestDiffListener(); Checker checker = CheckerFactory.createChecker(createCheck(tdl)); checker.reportDiffs(getBaseLine(), getCurrent(), new URLClassLoader(new URL[]{}), new URLClassLoader(new URL[]{})); tdl.checkExpected(expected); } /** * Creates a check and sets it up so ApiDifferences are reported to the test diff listener. * * @param tdl the test diff listener that records the recognized api changes. * @return the confiured check */ protected abstract ClassChangeCheck createCheck(TestDiffListener tdl); } --- NEW FILE --- package net.sf.clirr.checks; import net.sf.clirr.event.ApiDifference; import net.sf.clirr.event.Severity; import net.sf.clirr.framework.ClassChangeCheck; public class GenderChangeCheckTest extends AbstractCheckTestCase { public void testGenderChangeCheckTest() { ApiDifference[] expected = new ApiDifference[] { new ApiDifference("Changed Gender of testlib.ClassBecomesInterface", Severity.ERROR), new ApiDifference("Changed Gender of testlib.InterfaceBecomesClass", Severity.ERROR), }; verify(expected); } protected final ClassChangeCheck createCheck(TestDiffListener tdl) { return new GenderChangeCheck(tdl); } } --- NEW FILE --- package net.sf.clirr.checks; import java.util.Set; import java.util.HashSet; import java.util.Iterator; import net.sf.clirr.framework.ApiDiffDispatcher; import net.sf.clirr.event.ApiDifference; import junit.framework.TestCase; class TestDiffListener implements ApiDiffDispatcher { private Set diffs = new HashSet(); public void fireDiff(ApiDifference difference) { diffs.add(difference); } public void checkExpected(ApiDifference[] expected) { HashSet expectedDiffs = new HashSet(); for (int i = 0; i < expected.length; i++) { ApiDifference apiDifference = expected[i]; expectedDiffs.add(apiDifference); } for (Iterator it = expectedDiffs.iterator(); it.hasNext();) { ApiDifference apiDifference = (ApiDifference) it.next(); TestCase.assertTrue("expected diff " + apiDifference + " was not generated", diffs.contains(apiDifference)); } for (Iterator it = diffs.iterator(); it.hasNext();) { ApiDifference apiDifference = (ApiDifference) it.next(); TestCase.assertTrue("unexpected diff " + apiDifference, expectedDiffs.contains(apiDifference)); } } } |
From: Lars K?h. <lk...@us...> - 2003-10-05 17:52:35
|
Update of /cvsroot/clirr/clirr/src/test/net/sf/clirr/checks In directory sc8-pr-cvs1:/tmp/cvs-serv22830/src/test/net/sf/clirr/checks Log Message: Directory /cvsroot/clirr/clirr/src/test/net/sf/clirr/checks added to the repository |
From: Lars K?h. <lk...@us...> - 2003-10-05 17:52:23
|
Update of /cvsroot/clirr/clirr/src/test/net/sf/clirr/ant In directory sc8-pr-cvs1:/tmp/cvs-serv22783/src/test/net/sf/clirr/ant Log Message: Directory /cvsroot/clirr/clirr/src/test/net/sf/clirr/ant added to the repository |
From: Lars K?h. <lk...@us...> - 2003-10-05 17:52:19
|
Update of /cvsroot/clirr/clirr/src/test/net/sf/clirr In directory sc8-pr-cvs1:/tmp/cvs-serv22755/src/test/net/sf/clirr Log Message: Directory /cvsroot/clirr/clirr/src/test/net/sf/clirr added to the repository |
From: Lars K?h. <lk...@us...> - 2003-10-05 17:52:12
|
Update of /cvsroot/clirr/clirr/src/test/net/sf In directory sc8-pr-cvs1:/tmp/cvs-serv22727/src/test/net/sf Log Message: Directory /cvsroot/clirr/clirr/src/test/net/sf added to the repository |
From: Lars K?h. <lk...@us...> - 2003-10-05 17:52:06
|
Update of /cvsroot/clirr/clirr/src/test/net In directory sc8-pr-cvs1:/tmp/cvs-serv22676/src/test/net Log Message: Directory /cvsroot/clirr/clirr/src/test/net added to the repository |
From: Lars K?h. <lk...@us...> - 2003-10-05 17:52:05
|
Update of /cvsroot/clirr/clirr/src/test In directory sc8-pr-cvs1:/tmp/cvs-serv22648/src/test Log Message: Directory /cvsroot/clirr/clirr/src/test added to the repository |
From: Lars K?h. <lk...@us...> - 2003-10-05 17:51:24
|
Update of /cvsroot/clirr/clirr In directory sc8-pr-cvs1:/tmp/cvs-serv22527 Modified Files: project.properties Log Message: compile testlibs before running unit tests, so tests have input libraries to test against Index: project.properties =================================================================== RCS file: /cvsroot/clirr/clirr/project.properties,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- project.properties 28 Sep 2003 05:15:05 -0000 1.4 +++ project.properties 5 Oct 2003 17:51:19 -0000 1.5 @@ -13,4 +13,11 @@ # TODO: this still shows a nonsense link. I think that's a bug in Maven - will contact maven-user maven.xdoc.developmentProcessUrl= +maven.junit.fork=true +# tell tests where testinput is +maven.junit.sysproperties=testinput +testinput=${basedir}/target/testinput + +# used by test pregoal to generate test input, see maven.xml +clirr.testlibs=testlib-v1, testlib-v2 |
From: Lars K?h. <lk...@us...> - 2003-10-05 17:51:07
|
Update of /cvsroot/clirr/clirr In directory sc8-pr-cvs1:/tmp/cvs-serv22368 Added Files: maven.xml Log Message: compile testlibs before running unit tests, so tests have input libraries to test against --- NEW FILE --- <?xml version="1.0"?> <project default="java:jar" xmlns:u="jelly:util" xmlns:j="jelly:core"> <preGoal name="test:test"> <attainGoal name="clirr:compiletestlibs"/> </preGoal> <goal name="clirr:compiletestlibs"> <u:tokenize var="testlibs" delim=", ">${clirr.testlibs}</u:tokenize> <j:forEach items="${testlibs}" var="testlib" indexVar="testlibIdx"> Compiling test input ${testlib} <j:set var="testlibclassdir" value="${maven.build.dir}/testinput/${testlib}/classes"/> <mkdir dir="${testlibclassdir}"/> <javac srcdir="${basedir}/src/testinput/${testlib}" destdir="${testlibclassdir}"/> <jar basedir="${testlibclassdir}" jarfile="${maven.build.dir}/testinput/${testlib}.jar" /> </j:forEach> </goal> </project> |
From: Lars K?h. <lk...@us...> - 2003-10-05 17:48:27
|
Update of /cvsroot/clirr/clirr/src/testinput/testlib-v1/testlib In directory sc8-pr-cvs1:/tmp/cvs-serv21898/testinput/testlib-v1/testlib Added Files: ClassBecomesInterface.java InterfaceBecomesClass.java Log Message: add test libs to run unit tests against --- NEW FILE --- package testlib; public class ClassBecomesInterface { } --- NEW FILE --- package testlib; public interface InterfaceBecomesClass { } |
From: Lars K?h. <lk...@us...> - 2003-10-05 17:48:27
|
Update of /cvsroot/clirr/clirr/src/testinput/testlib-v2/testlib In directory sc8-pr-cvs1:/tmp/cvs-serv21898/testinput/testlib-v2/testlib Added Files: ClassBecomesInterface.java InterfaceBecomesClass.java Log Message: add test libs to run unit tests against --- NEW FILE --- package testlib; public interface ClassBecomesInterface { } --- NEW FILE --- package testlib; public class InterfaceBecomesClass { } |
From: Lars K?h. <lk...@us...> - 2003-10-05 17:47:21
|
Update of /cvsroot/clirr/clirr/src/testinput/testlib-v2/testlib In directory sc8-pr-cvs1:/tmp/cvs-serv21709/testlib Log Message: Directory /cvsroot/clirr/clirr/src/testinput/testlib-v2/testlib added to the repository |
From: Lars K?h. <lk...@us...> - 2003-10-05 17:46:13
|
Update of /cvsroot/clirr/clirr/src/testinput/testlib-v1/testlib In directory sc8-pr-cvs1:/tmp/cvs-serv21563/testlib Log Message: Directory /cvsroot/clirr/clirr/src/testinput/testlib-v1/testlib added to the repository |
From: Lars K?h. <lk...@us...> - 2003-10-05 17:45:52
|
Update of /cvsroot/clirr/clirr/src/testinput/testlib-v1 In directory sc8-pr-cvs1:/tmp/cvs-serv21465/testlib-v1 Log Message: Directory /cvsroot/clirr/clirr/src/testinput/testlib-v1 added to the repository |
From: Lars K?h. <lk...@us...> - 2003-10-05 17:45:52
|
Update of /cvsroot/clirr/clirr/src/testinput/testlib-v2 In directory sc8-pr-cvs1:/tmp/cvs-serv21465/testlib-v2 Log Message: Directory /cvsroot/clirr/clirr/src/testinput/testlib-v2 added to the repository |
From: Lars K?h. <lk...@us...> - 2003-10-05 17:45:26
|
Update of /cvsroot/clirr/clirr/src/testinput In directory sc8-pr-cvs1:/tmp/cvs-serv21395/testinput Log Message: Directory /cvsroot/clirr/clirr/src/testinput added to the repository |
From: Lars K?h. <lk...@us...> - 2003-09-29 05:40:48
|
Update of /cvsroot/clirr/clirr/xdocs In directory sc8-pr-cvs1:/tmp/cvs-serv14750/xdocs Modified Files: download.xml Log Message: fixed copy and paste error Index: download.xml =================================================================== RCS file: /cvsroot/clirr/clirr/xdocs/download.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- download.xml 27 Sep 2003 11:50:10 -0000 1.1 +++ download.xml 29 Sep 2003 05:22:33 -0000 1.2 @@ -25,7 +25,7 @@ servers.</strong> </p> </section> - <section name="Compile Maven yourself"> + <section name="Compile Clirr yourself"> <p> To compile Clirr yourself you need to have the following tools installed on your machine and |
From: Lars K?h. <lk...@us...> - 2003-09-29 05:26:25
|
Update of /cvsroot/clirr/clirr/src/java/net/sf/clirr In directory sc8-pr-cvs1:/tmp/cvs-serv15182/src/java/net/sf/clirr Modified Files: Checker.java Log Message: removed BCEL ClassSet from the Checker interface, BCEL is now an implementation detail for frontends such as the Ant task Index: Checker.java =================================================================== RCS file: /cvsroot/clirr/clirr/src/java/net/sf/clirr/Checker.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- Checker.java 27 Sep 2003 05:28:43 -0000 1.4 +++ Checker.java 29 Sep 2003 05:26:12 -0000 1.5 @@ -22,6 +22,15 @@ import java.util.ArrayList; import java.util.Iterator; import java.util.List; +import java.util.Enumeration; +import java.util.zip.ZipFile; +import java.util.zip.ZipEntry; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; +import java.net.MalformedURLException; +import java.net.URLClassLoader; import net.sf.clirr.checks.AddedClassCheck; import net.sf.clirr.checks.ClassHierarchyCheck; @@ -35,9 +44,23 @@ import net.sf.clirr.framework.ClassChangeCheck; import net.sf.clirr.framework.ClassSetChangeCheck; import org.apache.bcel.classfile.JavaClass; +import org.apache.bcel.classfile.ClassParser; import org.apache.bcel.util.ClassSet; +import org.apache.bcel.util.Repository; +import org.apache.bcel.util.ClassLoaderRepository; +import org.apache.tools.ant.BuildException; +/** + * This is the main class to be used by Clirr frontends, + * it implements the checking functionality of Clirr. + * Frontends can create an instance of this class + * and register themselves as DiffListeners, they are then + * informed whenever an API change is detected by the + * reportDiffs method. + * + * @author lkuehne + */ public final class Checker implements ApiDiffDispatcher { @@ -46,6 +69,25 @@ private List classSetChecks = new ArrayList(); private List classChecks = new ArrayList(); + /** + * Package visible constructor for unit testing. + */ + Checker(ClassSetChangeCheck cscc) + { + classSetChecks.add(cscc); + } + + /** + * Package visible constructor for unit testing. + */ + Checker(ClassChangeCheck ccc) + { + classChecks.add(ccc); + } + + /** + * Creates a new Checker. + */ public Checker() { classSetChecks.add(new RemovedClassCheck(this)); @@ -89,15 +131,125 @@ } } - public void diffs(ClassSet oldClasses, ClassSet newClasses) + public void reportDiffs( + File[] origJars, File[] newJars, + ClassLoader origThirdPartyLoader, ClassLoader newThirdPartyLoader) + { + final ClassSet origClasses = createClassSet(origJars, origThirdPartyLoader); + final ClassSet newClasses = createClassSet(newJars, newThirdPartyLoader); + reportDiffs(origClasses, newClasses); + } + + private ClassSet createClassSet(File[] jarFiles, ClassLoader thirdPartyClasses) + { + ClassLoader classLoader = createClassLoader(jarFiles, thirdPartyClasses); + + Repository repository = new ClassLoaderRepository(classLoader); + + ClassSet ret = new ClassSet(); + + for (int i = 0; i < jarFiles.length; i++) + { + File jarFile = jarFiles[i]; + ZipFile zip = null; + try + { + zip = new ZipFile(jarFile, ZipFile.OPEN_READ); + } + catch (IOException ex) + { + throw new BuildException("Cannot open " + jarFile + " for reading", ex); + } + Enumeration enum = zip.entries(); + while (enum.hasMoreElements()) + { + ZipEntry zipEntry = (ZipEntry) enum.nextElement(); + if (!zipEntry.isDirectory() && zipEntry.getName().endsWith(".class")) + { + JavaClass clazz = extractClass(zipEntry, zip, repository); + if (clazz.isPublic() || clazz.isProtected()) + { + ret.add(clazz); + } + } + } + } + + return ret; + } + + private JavaClass extractClass(ZipEntry zipEntry, ZipFile zip, Repository repository) + { + String name = zipEntry.getName(); + InputStream is = null; + try + { + is = zip.getInputStream(zipEntry); + + ClassParser parser = new ClassParser(is, name); + JavaClass clazz = parser.parse(); + clazz.setRepository(repository); + return clazz; + } + catch (IOException ex) + { + throw new BuildException("Cannot read " + zipEntry + " from " + zip, ex); + } + finally + { + if (is != null) + { + try + { + is.close(); + } + catch (IOException ex) + { + throw new BuildException(ex); + } + } + } + } + + private ClassLoader createClassLoader(File[] jarFiles, ClassLoader thirdPartyClasses) + { + final URL[] jarUrls = new URL[jarFiles.length]; + for (int i = 0; i < jarFiles.length; i++) + { + File jarFile = jarFiles[i]; + try + { + URL url = jarFile.toURL(); + jarUrls[i] = url; + } + catch (MalformedURLException ex) + { + throw new RuntimeException("Cannot create classloader with jar file " + jarFile); + } + } + final URLClassLoader jarsLoader = new URLClassLoader(jarUrls, thirdPartyClasses); + + return jarsLoader; + } + + + /** + * Checks two sets of classes for api changes and reports + * them to the DiffListeners. + * @param compatibilityBaseline the classes that form the + * compatibility baseline to check against + * @param currentVersion the classes that are checked for + * compatibility with compatibilityBaseline + */ + private void reportDiffs(ClassSet compatibilityBaseline, ClassSet currentVersion) { fireStart(); for (Iterator it = classSetChecks.iterator(); it.hasNext();) { ClassSetChangeCheck check = (ClassSetChangeCheck) it.next(); - check.check(oldClasses, newClasses); + check.check(compatibilityBaseline, currentVersion); } - runClassChecks(oldClasses, newClasses); + runClassChecks(compatibilityBaseline, currentVersion); fireStop(); } |
From: Lars K?h. <lk...@us...> - 2003-09-29 05:26:25
|
Update of /cvsroot/clirr/clirr/src/java/net/sf/clirr/ant In directory sc8-pr-cvs1:/tmp/cvs-serv15182/src/java/net/sf/clirr/ant Modified Files: AntTask.java Log Message: removed BCEL ClassSet from the Checker interface, BCEL is now an implementation detail for frontends such as the Ant task Index: AntTask.java =================================================================== RCS file: /cvsroot/clirr/clirr/src/java/net/sf/clirr/ant/AntTask.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- AntTask.java 27 Sep 2003 05:28:43 -0000 1.4 +++ AntTask.java 29 Sep 2003 05:26:12 -0000 1.5 @@ -21,25 +21,16 @@ import java.io.File; import java.io.IOException; -import java.io.InputStream; import java.net.MalformedURLException; import java.net.URL; import java.net.URLClassLoader; -import java.util.Enumeration; import java.util.Iterator; import java.util.LinkedList; import java.util.List; -import java.util.zip.ZipEntry; -import java.util.zip.ZipFile; import net.sf.clirr.Checker; import net.sf.clirr.event.PlainDiffListener; import net.sf.clirr.event.XmlDiffListener; -import org.apache.bcel.classfile.ClassParser; -import org.apache.bcel.classfile.JavaClass; -import org.apache.bcel.util.ClassLoaderRepository; -import org.apache.bcel.util.ClassSet; -import org.apache.bcel.util.Repository; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.DirectoryScanner; import org.apache.tools.ant.Project; @@ -57,6 +48,9 @@ private static final String FORMATTER_TYPE_PLAIN = "plain"; private static final String FORMATTER_TYPE_XML = "xml"; + /** + * Output formater. + */ public static final class Formatter { private String type = null; @@ -195,8 +189,8 @@ final File[] origJars = scanFileSet(origFiles); final File[] newJars = scanFileSet(newFiles); - final ClassSet origClasses = createClassSet(origJars, origClassPath); - final ClassSet newClasses = createClassSet(newJars, newClassPath); + final ClassLoader origThirdPartyLoader = createClasspathLoader(origClassPath); + final ClassLoader newThirdPartyLoader = createClasspathLoader(newClassPath); final Checker checker = new Checker(); final ChangeCounter counter = new ChangeCounter(); @@ -234,7 +228,7 @@ } checker.addDiffListener(counter); - checker.diffs(origClasses, newClasses); + checker.reportDiffs(origJars, newJars, origThirdPartyLoader, newThirdPartyLoader); if (counter.getWarnings() > 0 && failOnWarning || counter.getErrors() > 0 && failOnError) { @@ -243,62 +237,8 @@ } - private ClassSet createClassSet(File[] jarFiles, Path classpath) + private ClassLoader createClasspathLoader(Path classpath) { - ClassLoader classLoader = createClassLoader(jarFiles, classpath); - - Repository repository = new ClassLoaderRepository(classLoader); - - ClassSet ret = new ClassSet(); - - for (int i = 0; i < jarFiles.length; i++) - { - File jarFile = jarFiles[i]; - ZipFile zip = null; - try - { - zip = new ZipFile(jarFile, ZipFile.OPEN_READ); - } - catch (IOException ex) - { - throw new BuildException("Cannot open " + jarFile + " for reading", ex); - } - Enumeration enum = zip.entries(); - while (enum.hasMoreElements()) - { - ZipEntry zipEntry = (ZipEntry) enum.nextElement(); - if (!zipEntry.isDirectory() && zipEntry.getName().endsWith(".class")) - { - JavaClass clazz = extractClass(zipEntry, zip, repository); - if (clazz.isPublic() || clazz.isProtected()) - { - ret.add(clazz); - } - } - } - } - - return ret; - } - - private ClassLoader createClassLoader(File[] jarFiles, Path classpath) - { - final URL[] jarUrls = new URL[jarFiles.length]; - for (int i = 0; i < jarFiles.length; i++) - { - File jarFile = jarFiles[i]; - try - { - URL url = jarFile.toURL(); - jarUrls[i] = url; - } - catch (MalformedURLException ex) - { - throw new RuntimeException("Cannot create classloader with jar file " + jarFile); - } - } - final URLClassLoader jarsLoader = new URLClassLoader(jarUrls); - final String[] cpEntries = classpath.list(); final URL[] cpUrls = new URL[cpEntries.length]; for (int i = 0; i < cpEntries.length; i++) @@ -315,43 +255,8 @@ throw new RuntimeException("Cannot create classLoader from classpath entry " + entry); } } - - final URLClassLoader retVal = new URLClassLoader(cpUrls, jarsLoader); - - return retVal; - } - - private JavaClass extractClass(ZipEntry zipEntry, ZipFile zip, Repository repository) - { - String name = zipEntry.getName(); - InputStream is = null; - try - { - is = zip.getInputStream(zipEntry); - - ClassParser parser = new ClassParser(is, name); - JavaClass clazz = parser.parse(); - clazz.setRepository(repository); - return clazz; - } - catch (IOException ex) - { - throw new BuildException("Cannot read " + zipEntry + " from " + zip, ex); - } - finally - { - if (is != null) - { - try - { - is.close(); - } - catch (IOException ex) - { - throw new BuildException(ex); - } - } - } + final URLClassLoader classPathLoader = new URLClassLoader(cpUrls); + return classPathLoader; } private File[] scanFileSet(FileSet fs) |
From: Lars K?h. <lk...@us...> - 2003-09-28 06:18:57
|
Update of /cvsroot/clirr/clirr In directory sc8-pr-cvs1:/tmp/cvs-serv31541 Modified Files: project.properties Log Message: try to hide irrelevant stuff from navbar include javadoc overview page Index: project.properties =================================================================== RCS file: /cvsroot/clirr/clirr/project.properties,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- project.properties 20 Sep 2003 13:06:00 -0000 1.3 +++ project.properties 28 Sep 2003 05:15:05 -0000 1.4 @@ -4,3 +4,13 @@ maven.checkstyle.properties=${basedir}/conf/clirr_checks.xml maven.checkstyle.header.file=${basedir}/conf/javaheader.txt maven.checkstyle.fail.on.violation=true + +# include api overview page, will work only with Maven version > 1.0-rc1 +maven.javadoc.overview=${pom.build.sourceDirectory}/net/sf/clirr/overview.html + +# hide irrelevant stuff from the nav bar +maven.xdoc.poweredby.image= +# TODO: this still shows a nonsense link. I think that's a bug in Maven - will contact maven-user +maven.xdoc.developmentProcessUrl= + + |
From: Lars K?h. <lk...@us...> - 2003-09-27 16:46:40
|
Update of /cvsroot/clirr/clirr/xdocs In directory sc8-pr-cvs1:/tmp/cvs-serv23131 Modified Files: navigation.xml Added Files: download.xml Log Message: added download page that also explains how to build from anon cvs --- NEW FILE --- <?xml version="1.0" encoding="ISO-8859-1"?> <document> <properties> <title>Download Clirr</title> <author>Lars Kühne</author> </properties> <body> <section name="Download Clirr"> <p> The latest release of Clirr is available from the <a href="http://sourceforge.net/project/showfiles.php?group_id=89627">Sourceforge download page</a>. Currently no files have been released, but stay tuned! </p> <p> Development snapshots are occasionally made available between releases <a href="builds/clirr/distributions/">here</a>. </p> <p> <strong>Sourceforge.net provides their infrastructure for free. Please use the Sourceforge download pages above whenever possible to save bandwith on the sourceforge servers.</strong> </p> </section> <section name="Compile Maven yourself"> <p> To compile Clirr yourself you need to have the following tools installed on your machine and available in the command line search path: </p> <ul> <li> the latest release of <a href="maven.apache.org">Maven</a>, at the time of writing that's beta-10. </li> <li> A CVS client. If you are on Linux you probably already have that. If you are on Windows, you use the binary that is included in the WinCVS distribution. For other platforms, please search Google for a precompiled client or build one yourself using the sources available from the <a href="http://www.cvshome.org">CVS homepage</a>. </li> </ul> <p> To build Clirr, open a command line shell, cd to an empty directory and enter the following commands (when prompted for a password for anonymous, simply press the Enter key): </p> <source><![CDATA[ cvs -d :pserver:ano...@cv...:/cvsroot/clirr login cvs -z3 -d :pserver:ano...@cv...:/cvsroot/clirr checkout clirr cd clirr maven dist site ]]></source> <p> Note that the anonymous CVS server on Sourceforge is under heavy load, and you might experience difficulties when checking out the sources. This is temporary, please try again a few minutes later. Sourceforge is currently in the process of installing more capable hardware. </p> </section> </body> </document> Index: navigation.xml =================================================================== RCS file: /cvsroot/clirr/clirr/xdocs/navigation.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- navigation.xml 20 Sep 2003 12:59:49 -0000 1.4 +++ navigation.xml 27 Sep 2003 11:50:09 -0000 1.5 @@ -14,7 +14,7 @@ <item name="Running Clirr" href="/anttask.html"/> <item name="Download" - href="http://sourceforge.net/project/showfiles.php?group_id=89627"/> + href="/download.html"/> <item name="Contributing" href="/contributing.html"/> <item name="Related tools" @@ -29,4 +29,4 @@ </a> </footer> </body> -</project> \ No newline at end of file +</project> |
From: Lars K?h. <lk...@us...> - 2003-09-27 16:43:31
|
Update of /cvsroot/clirr/clirr In directory sc8-pr-cvs1:/tmp/cvs-serv27431 Modified Files: project.xml Log Message: corrected deployment info, so "maven -Dmaven.username=$SOURCEFORGE_USERNAME clean dist:deploy" updates the clirr website Index: project.xml =================================================================== RCS file: /cvsroot/clirr/clirr/project.xml,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- project.xml 25 Sep 2003 22:59:35 -0000 1.10 +++ project.xml 27 Sep 2003 09:27:12 -0000 1.11 @@ -42,11 +42,13 @@ <!-- the project home page --> <url>http://clirr.sourceforge.net/</url> <issueTrackingUrl>https://sourceforge.net/tracker/?group_id=89627&atid=590799</issueTrackingUrl> + <siteAddress>shell.sourceforge.net</siteAddress> <!-- - <siteAddress>clirr.sourceforge.net</siteAddress> - <siteDirectory>/www/maven.apache.org/reference/plugins/examples/</siteDirectory> - <distributionDirectory>/www/maven.apache.org/builds/</distributionDirectory> + <siteDirectory>/home/lk/rmdir</siteDirectory> --> + <siteDirectory>/home/groups/c/cl/clirr/htdocs/</siteDirectory> + <distributionSite>shell.sourceforge.net</distributionSite> + <distributionDirectory>/home/groups/c/cl/clirr/htdocs/builds/</distributionDirectory> <!-- the version control repository and http url for online access the connection element has the form: scm:<system>:<system specific connection string> --> @@ -133,9 +135,6 @@ <resources> <resource> <directory>${basedir}/src/conf</directory> - <includes> - <include>*.properties</include> - </includes> </resource> </resources> </build> |
From: Lars K?h. <lk...@us...> - 2003-09-27 11:18:57
|
Update of /cvsroot/clirr/clirr In directory sc8-pr-cvs1:/tmp/cvs-serv18423 Modified Files: project.xml Log Message: corrected typo in cvs access info Index: project.xml =================================================================== RCS file: /cvsroot/clirr/clirr/project.xml,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- project.xml 27 Sep 2003 09:27:12 -0000 1.11 +++ project.xml 27 Sep 2003 11:18:43 -0000 1.12 @@ -53,7 +53,7 @@ the connection element has the form: scm:<system>:<system specific connection string> --> <repository> - <connection>scm:cvs:perver:ano...@cv...:/cvsroot/clirr:clirr</connection> + <connection>scm:cvs:pserver:ano...@cv...:/cvsroot/clirr:clirr</connection> <url>http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/clirr</url> </repository> |