Skip to content

Commit

Permalink
LRDOCS-3286 Refer to source folder names instead of ZIP files.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jim Hinkey committed Feb 1, 2017
1 parent 5e7b9b1 commit bc5665c
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -187,16 +187,16 @@ public boolean accept(File dir, String name) {
sortByPackageName(removedClasses);
removeJavaSuffix(removedClasses);

String oldZipName = oldDir.getName() + ".zip";
String newZipName = newDir.getName() + ".zip";
String oldDirName = oldDir.getName();
String newDirName = newDir.getName();

TemplateProcessor movedClassesTemplateProcessor = new TemplateProcessor();
movedClassesTemplateProcessor.processMovedClassesTemplate(movedClasses, movedClassesOutputFile, oldZipName, newZipName);
movedClassesTemplateProcessor.processMovedClassesTemplate(movedClasses, movedClassesOutputFile, oldDirName, newDirName);
System.out.println("Reported moved classes to file: " + movedClassesOutputFile.getPath());

if (removedClassesOutputFile != null) {
TemplateProcessor removedClassesTemplateProcessor = new TemplateProcessor();
removedClassesTemplateProcessor.processRemovedClassesTemplate(removedClasses, removedClassesOutputFile, oldZipName, newZipName);
removedClassesTemplateProcessor.processRemovedClassesTemplate(removedClasses, removedClassesOutputFile, oldDirName, newDirName);
System.out.println("Reported removed classes to file: " + removedClassesOutputFile.getPath());

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

public class TemplateProcessor {

public void processMovedClassesTemplate(List<FormerPortalServiceClass> movedClasses, File article, String oldZipName, String newZipName) {
public void processMovedClassesTemplate(List<FormerPortalServiceClass> movedClasses, File article, String oldDirName, String newDirName) {
// Write report using FreeMarker template
Configuration cfg = new Configuration(Configuration.VERSION_2_3_23);
try {
Expand All @@ -26,8 +26,8 @@ public void processMovedClassesTemplate(List<FormerPortalServiceClass> movedClas

Map root = new HashMap();

root.put("oldSrcZip", oldZipName);
root.put("newSrcZip", newZipName);
root.put("oldSrc", oldDirName);
root.put("newSrc", newDirName);
root.put("movedClasses", movedClasses);

Template temp = cfg.getTemplate("moved-classes.ftl");
Expand All @@ -44,7 +44,7 @@ public void processMovedClassesTemplate(List<FormerPortalServiceClass> movedClas

}

public void processRemovedClassesTemplate(List<FormerPortalServiceClass> removedClasses, File article, String oldZipName, String newZipName) {
public void processRemovedClassesTemplate(List<FormerPortalServiceClass> removedClasses, File article, String oldDirName, String newDirName) {
// Write report using FreeMarker template
Configuration cfg = new Configuration(Configuration.VERSION_2_3_23);
try {
Expand All @@ -56,8 +56,8 @@ public void processRemovedClassesTemplate(List<FormerPortalServiceClass> removed

Map root = new HashMap();

root.put("oldSrcZip", oldZipName);
root.put("newSrcZip", newZipName);
root.put("oldSrc", oldDirName);
root.put("newSrc", newDirName);
root.put("removedClasses", removedClasses);

Template temp = cfg.getTemplate("removed-classes.ftl");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ caption {
<b>Classes Moved from portal-service to com.liferay.portal.kernel</b>
<p>
This information was generated based on comparing classes in
<em>${oldSrcZip}</em> to classes in <em>${newSrcZip}</em>.
<em>${oldSrc}</em> to classes in <em>${newSrc}</em>.
</p>
</caption>
<tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Classes removed from Liferay
<p>
The following table lists classes formerly in <em>portal-service.jar</em> that
have been removed from Liferay. This information was generated based on
comparing classes in <em>${oldSrcZip}</em> to classes in <em>${newSrcZip}</em>.
comparing classes in <em>${oldSrc}</em> to classes in <em>${newSrc}</em>.
</p>

<style>
Expand Down
Binary file modified lib/liferay-doc-utils.jar
Binary file not shown.

0 comments on commit bc5665c

Please sign in to comment.