From c7db8642549605ec8d13868cdc6a6efab64cacf1 Mon Sep 17 00:00:00 2001 From: "smain@google.com" Date: Fri, 2 Sep 2016 11:15:47 -0700 Subject: remove USE_UPDATED_TEMPLATES flag now that 'templates-sdk-dev' is the default template in 'template-sdk', as per: https://googleplex-android-review.git.corp.google.com/#/c/1407762/1 Change-Id: Ie15f23897bf0e1bc9d40046c620f0affc13f1633 --- src/com/google/doclava/ClearPage.java | 3 - src/com/google/doclava/DocFile.java | 368 +++++++++++-------------------- src/com/google/doclava/Doclava.java | 21 +- src/com/google/doclava/PageMetadata.java | 6 +- 4 files changed, 136 insertions(+), 262 deletions(-) diff --git a/src/com/google/doclava/ClearPage.java b/src/com/google/doclava/ClearPage.java index 853e49d..1b4b5ca 100644 --- a/src/com/google/doclava/ClearPage.java +++ b/src/com/google/doclava/ClearPage.java @@ -107,9 +107,6 @@ public class ClearPage { } } data.setValue("toroot", toroot); - if (Doclava.USE_UPDATED_TEMPLATES) { - data.setValue("useUpdatedTemplates", "true"); - } data.setValue("filename", filename); if (!fullPath) { diff --git a/src/com/google/doclava/DocFile.java b/src/com/google/doclava/DocFile.java index a8c4c78..fae2231 100644 --- a/src/com/google/doclava/DocFile.java +++ b/src/com/google/doclava/DocFile.java @@ -190,253 +190,151 @@ public class DocFile { // guide, design, distribute, etc. filename = getPathRoot(filename); - if (Doclava.USE_UPDATED_TEMPLATES) { - //remap types to design, dev, distribute etc. - if (filename.indexOf("design") == 0) { - hdf.setValue("design", "true"); - hdf.setValue("page.type", "design"); - hdf.setValue("page.category", "design"); - } else if (filename.indexOf("develop") == 0) { - hdf.setValue("develop", "true"); - hdf.setValue("page.type", "develop"); - hdf.setValue("page.category", "develop"); - } else if (filename.indexOf("guide") == 0) { - hdf.setValue("guide", "true"); - hdf.setValue("page.type", "develop"); - if (filename.indexOf("guide/topics/manif") == 0) { - hdf.setValue("page.category", "app manifest"); - } else { - hdf.setValue("page.category", "guide"); - } - } else if (filename.indexOf("training") == 0) { - hdf.setValue("training", "true"); + // map types to design, dev, distribute etc. + if (filename.indexOf("design") == 0) { + hdf.setValue("design", "true"); + hdf.setValue("page.type", "design"); + hdf.setValue("page.category", "design"); + } else if (filename.indexOf("develop") == 0) { + hdf.setValue("develop", "true"); + hdf.setValue("page.type", "develop"); + hdf.setValue("page.category", "develop"); + } else if (filename.indexOf("guide") == 0) { + hdf.setValue("guide", "true"); + hdf.setValue("page.type", "develop"); + if (filename.indexOf("guide/topics/manif") == 0) { + hdf.setValue("page.category", "app manifest"); + } else { + hdf.setValue("page.category", "guide"); + } + } else if (filename.indexOf("training") == 0) { + hdf.setValue("training", "true"); + hdf.setValue("page.type", "develop"); + hdf.setValue("page.category", "training"); + } else if (filename.indexOf("more") == 0) { + hdf.setValue("more", "true"); + } else if (filename.indexOf("google") == 0) { + hdf.setValue("google", "true"); + hdf.setValue("page.type", "develop"); + hdf.setValue("page.category", "google"); + } else if (filename.indexOf("samples") == 0) { + hdf.setValue("samples", "true"); + hdf.setValue("samplesDocPage", "true"); + hdf.setValue("page.type", "develop"); + hdf.setValue("page.category", "samples"); + if (Doclava.samplesNavTree != null) { + hdf.setValue("samples_toc_tree", Doclava.samplesNavTree.getValue("samples_toc_tree", "")); + } + } else if (filename.indexOf("topic/") == 0) { + hdf.setValue("topic", "true"); + hdf.setValue("page.type", "develop"); + if (filename.indexOf("topic/libraries") == 0) { + hdf.setValue("page.category", "libraries"); hdf.setValue("page.type", "develop"); - hdf.setValue("page.category", "training"); - } else if (filename.indexOf("more") == 0) { - hdf.setValue("more", "true"); - } else if (filename.indexOf("google") == 0) { - hdf.setValue("google", "true"); + hdf.setValue("libraries", "true"); + } else if (filename.indexOf("topic/instant-apps") == 0) { + hdf.setValue("instantapps", "true"); hdf.setValue("page.type", "develop"); - hdf.setValue("page.category", "google"); - } else if (filename.indexOf("samples") == 0) { - hdf.setValue("samples", "true"); - hdf.setValue("samplesDocPage", "true"); + hdf.setValue("page.category", "instant apps"); + } else if (filename.indexOf("topic/performance") == 0) { + hdf.setValue("perf", "true"); hdf.setValue("page.type", "develop"); - hdf.setValue("page.category", "samples"); - if (Doclava.samplesNavTree != null) { - hdf.setValue("samples_toc_tree", Doclava.samplesNavTree.getValue("samples_toc_tree", "")); - } - } else if (filename.indexOf("topic/") == 0) { - hdf.setValue("topic", "true"); + hdf.setValue("page.category", "performance"); + } else if (filename.indexOf("topic/arc") == 0) { + hdf.setValue("arc", "true"); hdf.setValue("page.type", "develop"); - if (filename.indexOf("topic/libraries") == 0) { - hdf.setValue("page.category", "libraries"); - hdf.setValue("page.type", "develop"); - hdf.setValue("libraries", "true"); - } else if (filename.indexOf("topic/instant-apps") == 0) { - hdf.setValue("instantapps", "true"); - hdf.setValue("page.type", "develop"); - hdf.setValue("page.category", "instant apps"); - } else if (filename.indexOf("topic/performance") == 0) { - hdf.setValue("perf", "true"); - hdf.setValue("page.type", "develop"); - hdf.setValue("page.category", "performance"); - } else if (filename.indexOf("topic/arc") == 0) { - hdf.setValue("arc", "true"); - hdf.setValue("page.type", "develop"); - hdf.setValue("page.category", "arc"); - } - } else if (filename.indexOf("distribute") == 0) { - hdf.setValue("distribute", "true"); + hdf.setValue("page.category", "arc"); + } + } else if (filename.indexOf("distribute") == 0) { + hdf.setValue("distribute", "true"); + hdf.setValue("page.type", "distribute"); + hdf.setValue("page.category", "distribute"); + if (filename.indexOf("distribute/googleplay") == 0) { + hdf.setValue("page.category", "googleplay"); hdf.setValue("page.type", "distribute"); - hdf.setValue("page.category", "distribute"); - if (filename.indexOf("distribute/googleplay") == 0) { - hdf.setValue("page.category", "googleplay"); - hdf.setValue("page.type", "distribute"); - hdf.setValue("googleplay", "true"); - } else if (filename.indexOf("distribute/essentials") == 0) { - hdf.setValue("page.category", "essentials"); - hdf.setValue("essentials", "true"); - } else if (filename.indexOf("distribute/users") == 0) { - hdf.setValue("page.category", "users"); - hdf.setValue("users", "true"); - } else if (filename.indexOf("distribute/engage") == 0) { - hdf.setValue("page.category", "engage"); - hdf.setValue("engage", "true"); - } else if (filename.indexOf("distribute/monetize") == 0) { - hdf.setValue("page.category", "monetize"); - hdf.setValue("monetize", "true"); - } else if (filename.indexOf("distribute/analyze") == 0) { - hdf.setValue("page.category", "analyze"); - hdf.setValue("analyze", "true"); - } else if (filename.indexOf("distribute/tools") == 0) { - hdf.setValue("page.category", "essentials"); - hdf.setValue("essentials", "true"); - } else if (filename.indexOf("distribute/stories") == 0) { - hdf.setValue("page.category", "stories"); - hdf.setValue("stories", "true"); - } - } else if (filename.indexOf("about") == 0) { - hdf.setValue("about", "true"); - hdf.setValue("page.type", "about"); - hdf.setValue("page.category", "about"); - if ((filename.indexOf("about/versions") == 0)) { - hdf.setValue("versions", "true"); - hdf.setValue("page.category", "versions"); - //todo remove this because there's no file at this location - } else if ((filename.indexOf("wear") == 0)) { - hdf.setValue("wear", "true"); - hdf.setValue("page.category", "wear"); - } else if ((filename.indexOf("tv") == 0)) { - hdf.setValue("tv", "true"); - hdf.setValue("page.category", "tv"); - } else if ((filename.indexOf("auto") == 0)) { - hdf.setValue("auto", "true"); - hdf.setValue("page.category", "auto"); - } - } else if (filename.indexOf("wear/preview") == 0) { - hdf.setValue("wearpreview", "true"); - hdf.setValue("page.type", "about"); - hdf.setValue("page.category", "wear preview"); - } else if (filename.indexOf("devices") == 0) { - hdf.setValue("devices", "true"); - hdf.setValue("page.type", "devices"); - } else if (filename.indexOf("source") == 0) { - hdf.setValue("source", "true"); - } else if (filename.indexOf("security") == 0) { - hdf.setValue("security", "true"); - } else if (filename.indexOf("compatibility") == 0) { - hdf.setValue("compatibility", "true"); - } else if (filename.indexOf("wear") == 0) { + hdf.setValue("googleplay", "true"); + } else if (filename.indexOf("distribute/essentials") == 0) { + hdf.setValue("page.category", "essentials"); + hdf.setValue("essentials", "true"); + } else if (filename.indexOf("distribute/users") == 0) { + hdf.setValue("page.category", "users"); + hdf.setValue("users", "true"); + } else if (filename.indexOf("distribute/engage") == 0) { + hdf.setValue("page.category", "engage"); + hdf.setValue("engage", "true"); + } else if (filename.indexOf("distribute/monetize") == 0) { + hdf.setValue("page.category", "monetize"); + hdf.setValue("monetize", "true"); + } else if (filename.indexOf("distribute/analyze") == 0) { + hdf.setValue("page.category", "analyze"); + hdf.setValue("analyze", "true"); + } else if (filename.indexOf("distribute/tools") == 0) { + hdf.setValue("page.category", "essentials"); + hdf.setValue("essentials", "true"); + } else if (filename.indexOf("distribute/stories") == 0) { + hdf.setValue("page.category", "stories"); + hdf.setValue("stories", "true"); + } + } else if (filename.indexOf("about") == 0) { + hdf.setValue("about", "true"); + hdf.setValue("page.type", "about"); + hdf.setValue("page.category", "about"); + if ((filename.indexOf("about/versions") == 0)) { + hdf.setValue("versions", "true"); + hdf.setValue("page.category", "versions"); + //todo remove this because there's no file at this location + } else if ((filename.indexOf("wear") == 0)) { hdf.setValue("wear", "true"); - hdf.setValue("about", "true"); - hdf.setValue("page.type", "about"); hdf.setValue("page.category", "wear"); - } else if (filename.indexOf("work") == 0) { - hdf.setValue("work", "true"); - hdf.setValue("page.type", "about"); - hdf.setValue("page.category", "work"); - } else if (filename.indexOf("preview") == 0) { - hdf.setValue("page.type", "develop"); - hdf.setValue("page.category", "preview"); - hdf.setValue("preview", "true"); - } else if (filename.indexOf("auto") == 0) { - hdf.setValue("auto", "true"); - hdf.setValue("about", "true"); - hdf.setValue("page.type", "about"); - hdf.setValue("page.category", "auto"); - } else if (filename.indexOf("tv") == 0) { + } else if ((filename.indexOf("tv") == 0)) { hdf.setValue("tv", "true"); - hdf.setValue("about", "true"); - hdf.setValue("page.type", "about"); hdf.setValue("page.category", "tv"); - } else { - hdf.setValue("about", "true"); - hdf.setValue("page.type", "about"); - hdf.setValue("page.category", "about"); - } - } else { - //support the old mappings - if (filename.indexOf("design") == 0) { - hdf.setValue("design", "true"); - hdf.setValue("page.type", "design"); - } else if (filename.indexOf("develop") == 0) { - hdf.setValue("develop", "true"); - hdf.setValue("page.type", "develop"); - } else if (filename.indexOf("guide") == 0) { - hdf.setValue("guide", "true"); - hdf.setValue("page.type", "guide"); - } else if (filename.indexOf("training") == 0) { - hdf.setValue("training", "true"); - hdf.setValue("page.type", "training"); - } else if (filename.indexOf("more") == 0) { - hdf.setValue("more", "true"); - } else if (filename.indexOf("google") == 0) { - hdf.setValue("google", "true"); - hdf.setValue("page.type", "google"); - } else if (filename.indexOf("samples") == 0) { - hdf.setValue("samples", "true"); - hdf.setValue("samplesDocPage", "true"); - hdf.setValue("page.type", "samples"); - if (Doclava.samplesNavTree != null) { - hdf.setValue("samples_toc_tree", Doclava.samplesNavTree.getValue("samples_toc_tree", "")); - } - } else if (filename.indexOf("distribute") == 0) { - hdf.setValue("distribute", "true"); - hdf.setValue("page.type", "distribute"); - if (filename.indexOf("distribute/googleplay") == 0) { - hdf.setValue("googleplay", "true"); - } else if (filename.indexOf("distribute/essentials") == 0) { - hdf.setValue("essentials", "true"); - } else if (filename.indexOf("distribute/users") == 0) { - hdf.setValue("users", "true"); - } else if (filename.indexOf("distribute/engage") == 0) { - hdf.setValue("engage", "true"); - } else if (filename.indexOf("distribute/monetize") == 0) { - hdf.setValue("monetize", "true"); - } else if (filename.indexOf("distribute/analyze") == 0) { - hdf.setValue("analyze", "true"); - } else if (filename.indexOf("distribute/tools") == 0) { - hdf.setValue("essentials", "true"); - } else if (filename.indexOf("distribute/stories") == 0) { - hdf.setValue("stories", "true"); - } - } else if (filename.indexOf("about") == 0) { - hdf.setValue("about", "true"); - hdf.setValue("page.type", "about"); - } else if (filename.indexOf("devices") == 0) { - hdf.setValue("devices", "true"); - hdf.setValue("page.type", "devices"); - } else if (filename.indexOf("source") == 0) { - hdf.setValue("source", "true"); - } else if (filename.indexOf("security") == 0) { - hdf.setValue("security", "true"); - } else if (filename.indexOf("compatibility") == 0) { - hdf.setValue("compatibility", "true"); - } else if (filename.indexOf("topic/") == 0) { - hdf.setValue("topic", "true"); - hdf.setValue("page.type", "develop"); - if (filename.indexOf("topic/libraries") == 0) { - hdf.setValue("page.category", "libraries"); - hdf.setValue("page.type", "develop"); - hdf.setValue("libraries", "true"); - } else if (filename.indexOf("topic/instant-apps") == 0) { - hdf.setValue("instantapps", "true"); - hdf.setValue("page.type", "develop"); - hdf.setValue("page.category", "instant apps"); - } else if (filename.indexOf("topic/performance") == 0) { - hdf.setValue("perf", "true"); - hdf.setValue("page.type", "develop"); - hdf.setValue("page.category", "performance"); - } else if (filename.indexOf("topic/arc") == 0) { - hdf.setValue("arc", "true"); - hdf.setValue("page.type", "develop"); - hdf.setValue("page.category", "arc"); - } - } else if (filename.indexOf("wear/preview") == 0) { - hdf.setValue("wearpreview", "true"); - hdf.setValue("page.type", "about"); - hdf.setValue("page.category", "wear preview"); - } else if (filename.indexOf("wear") == 0) { - hdf.setValue("wear", "true"); - } else if (filename.indexOf("work") == 0) { - hdf.setValue("work", "true"); - hdf.setValue("page.type", "about"); - hdf.setValue("page.category", "work"); - } else if (filename.indexOf("preview") == 0) { - hdf.setValue("page.type", "preview"); - hdf.setValue("page.category", "preview"); - hdf.setValue("preview", "true"); - } else if (filename.indexOf("auto") == 0) { + } else if ((filename.indexOf("auto") == 0)) { hdf.setValue("auto", "true"); - } else if (filename.indexOf("tv") == 0) { - hdf.setValue("tv", "true"); - } else { - hdf.setValue("about", "true"); - hdf.setValue("page.type", "about"); - hdf.setValue("page.category", "about"); + hdf.setValue("page.category", "auto"); } + } else if (filename.indexOf("wear/preview") == 0) { + hdf.setValue("wearpreview", "true"); + hdf.setValue("page.type", "about"); + hdf.setValue("page.category", "wear preview"); + } else if (filename.indexOf("devices") == 0) { + hdf.setValue("devices", "true"); + hdf.setValue("page.type", "devices"); + } else if (filename.indexOf("source") == 0) { + hdf.setValue("source", "true"); + } else if (filename.indexOf("security") == 0) { + hdf.setValue("security", "true"); + } else if (filename.indexOf("compatibility") == 0) { + hdf.setValue("compatibility", "true"); + } else if (filename.indexOf("wear") == 0) { + hdf.setValue("wear", "true"); + hdf.setValue("about", "true"); + hdf.setValue("page.type", "about"); + hdf.setValue("page.category", "wear"); + } else if (filename.indexOf("work") == 0) { + hdf.setValue("work", "true"); + hdf.setValue("page.type", "about"); + hdf.setValue("page.category", "work"); + } else if (filename.indexOf("preview") == 0) { + hdf.setValue("page.type", "develop"); + hdf.setValue("page.category", "preview"); + hdf.setValue("preview", "true"); + } else if (filename.indexOf("auto") == 0) { + hdf.setValue("auto", "true"); + hdf.setValue("about", "true"); + hdf.setValue("page.type", "about"); + hdf.setValue("page.category", "auto"); + } else if (filename.indexOf("tv") == 0) { + hdf.setValue("tv", "true"); + hdf.setValue("about", "true"); + hdf.setValue("page.type", "about"); + hdf.setValue("page.category", "tv"); + } else { + hdf.setValue("about", "true"); + hdf.setValue("page.type", "about"); + hdf.setValue("page.category", "about"); } + //set metadata for this file in jd_lists_unified PageMetadata.setPageMetadata(docfile, relative, outfile, hdf, Doclava.sTaglist); diff --git a/src/com/google/doclava/Doclava.java b/src/com/google/doclava/Doclava.java index 38fa9b3..20b68bb 100644 --- a/src/com/google/doclava/Doclava.java +++ b/src/com/google/doclava/Doclava.java @@ -72,8 +72,6 @@ public class Doclava { public static boolean DEVSITE_STATIC_ONLY = false; /* Don't resolve @link refs found in devsite pages */ public static boolean DEVSITE_IGNORE_JDLINKS = false; - /* Remove after updated templates are launched */ - public static boolean USE_UPDATED_TEMPLATES = false; /* Show Preview navigation and process preview docs */ public static boolean INCLUDE_PREVIEW = false; /* output en, es, ja without parent intl/ container */ @@ -182,12 +180,7 @@ public class Doclava { if (a[0].equals("-d")) { outputPathBase = outputPathHtmlDirs = ClearPage.outputDir = a[1]; } else if (a[0].equals("-templatedir")) { - if (USE_UPDATED_TEMPLATES) { - /* remove with updated templates are launched */ - ClearPage.addTemplateDir("build/tools/droiddoc/templates-sdk-dev"); - } else { - ClearPage.addTemplateDir(a[1]); - } + ClearPage.addTemplateDir(a[1]); } else if (a[0].equals("-hdf")) { mHDFData.add(new String[] {a[1], a[2]}); } else if (a[0].equals("-knowntags")) { @@ -281,8 +274,6 @@ public class Doclava { offlineMode = true; } else if (a[0].equals("-metadataDebug")) { META_DBG = true; - } else if (a[0].equals("-useUpdatedTemplates")) { - USE_UPDATED_TEMPLATES = true; } else if (a[0].equals("-includePreview")) { INCLUDE_PREVIEW = true; } else if (a[0].equals("-ignoreJdLinks")) { @@ -317,7 +308,6 @@ public class Doclava { // Don't copy the doclava assets to devsite output (ie use proj assets only) includeDefaultAssets = false; USE_DEVSITE_LOCALE_OUTPUT_PATHS = true; - USE_UPDATED_TEMPLATES = true; mHDFData.add(new String[] {"devsite", "1"}); if (staticOnly) { DEVSITE_STATIC_ONLY = true; @@ -446,11 +436,7 @@ public class Doclava { } // Write metadata for all processed files to jd_lists_unified.js in out dir if (!sTaglist.isEmpty()) { - if (USE_UPDATED_TEMPLATES) { - PageMetadata.WriteListByLang(sTaglist); - } else { - PageMetadata.WriteList(sTaglist); - } + PageMetadata.WriteListByLang(sTaglist); } } @@ -738,9 +724,6 @@ public class Doclava { if (option.equals("-metadataDebug")) { return 1; } - if (option.equals("-useUpdatedTemplates")) { - return 1; - } if (option.equals("-includePreview")) { return 1; } diff --git a/src/com/google/doclava/PageMetadata.java b/src/com/google/doclava/PageMetadata.java index 1928709..7ac0eae 100644 --- a/src/com/google/doclava/PageMetadata.java +++ b/src/com/google/doclava/PageMetadata.java @@ -181,11 +181,7 @@ public class PageMetadata { pageMeta.setLang(getLangStringNormalized(hdf, filename)); pageMeta.setType(getStringValueNormalized(hdf, "page.type")); pageMeta.setTimestamp(hdf.getValue("page.timestamp","")); - if (Doclava.USE_UPDATED_TEMPLATES) { - appendMetaNodeByLang(pageMeta, tagList); - } else { - appendMetaNodeByType(pageMeta, tagList); - } + appendMetaNodeByLang(pageMeta, tagList); } } -- cgit v1.2.3