ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maart...@apache.org
Subject svn commit: r663379 - in /ant/ivy/core/trunk: CHANGES.txt src/java/org/apache/ivy/ant/IvyReport.java test/java/org/apache/ivy/ant/IvyReportTest.java
Date Wed, 04 Jun 2008 21:51:27 GMT
Author: maartenc
Date: Wed Jun  4 14:51:27 2008
New Revision: 663379

URL: http://svn.apache.org/viewvc?rev=663379&view=rev
Log:
ivy:report will generate an HTML file that references non-existent ivy-report.css (IVY-826)

Modified:
    ant/ivy/core/trunk/CHANGES.txt
    ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyReport.java
    ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyReportTest.java

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=663379&r1=663378&r2=663379&view=diff
==============================================================================
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Wed Jun  4 14:51:27 2008
@@ -81,6 +81,7 @@
 - IMPROVEMENT: Change allownomd and skipbuildwithoutivy into a more semantically correct
name (IVY-297)
 - IMPROVEMENT: Smarter determination if an expression is exact or not for RegexpPatternMatcher
and GlobPatternMatcher
 
+- FIX: ivy:report will generate an HTML file that references non-existent ivy-report.css
(IVY-826)
 - FIX: dynamic resolveMode not being dynamic on branch (IVY-825)
 - FIX: Filesystem repositories can not have () in the path (IVY-797)
 - FIX: Type tag in poms not supported (IVY-762)

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyReport.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyReport.java?rev=663379&r1=663378&r2=663379&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyReport.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyReport.java Wed Jun  4 14:51:27 2008
@@ -248,8 +248,14 @@
         genStyled(confs, getReportStylePath(), xslext);
 
         // copy the css if required
-        if (todir != null && xslFile == null) {
-            File css = new File(todir, "ivy-report.css");
+        if (xslFile == null) {
+            File css;
+            if (todir != null) {
+                css = new File(todir, "ivy-report.css");
+            } else {
+                css = new File("ivy-report.css");
+            }
+            
             if (!css.exists()) {
                 Message.debug("copying report css to " + todir);
                 FileUtil.copy(XmlReportOutputter.class.getResourceAsStream("ivy-report.css"),
css,

Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyReportTest.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyReportTest.java?rev=663379&r1=663378&r2=663379&view=diff
==============================================================================
--- ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyReportTest.java (original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyReportTest.java Wed Jun  4 14:51:27
2008
@@ -75,11 +75,36 @@
             report.execute();
             
             assertTrue(new File(cache, "report/apache-resolve-simple-default.html").exists());
+            assertTrue(new File(cache, "report/ivy-report.css").exists()); // IVY-826
             assertTrue(new File(cache, "report/apache-resolve-simple-default.graphml").exists());
         } finally {
             Locale.setDefault(oldLocale);
         }
     }
+    
+    public void testCopyCssIfTodirNotSet() {
+        Locale oldLocale = Locale.getDefault();
+        
+        try {
+            // set the locale to UK as workaround for SUN bug 6240963
+            Locale.setDefault(Locale.UK);
+
+            IvyResolve res = new IvyResolve();
+            res.setProject(project);
+            res.setFile(new File("test/java/org/apache/ivy/ant/ivy-simple.xml"));
+            res.execute();
+    
+            report.execute();
+            report.setGraph(false);
+            
+            assertTrue(new File("apache-resolve-simple-default.html").exists());
+            assertTrue(new File("ivy-report.css").exists()); // IVY-826
+        } finally {
+            Locale.setDefault(oldLocale);
+            new File("apache-resolve-simple-default.html").delete();
+            new File("ivy-report.css").delete();
+        }
+    }
 
     public void testNoRevisionInOutputPattern() throws Exception {
         Locale oldLocale = Locale.getDefault();



Mime
View raw message