Skip to content

Commit 5313b8c

Browse files
committed
Fix analytics test
1 parent bfffc47 commit 5313b8c

File tree

3 files changed

+84
-3
lines changed

3 files changed

+84
-3
lines changed

buildSrc/src/main/kotlin/dokka-convention.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ dokka {
2222
rootProject.file("docs/dokka-presets/scripts/accessibility.js"),
2323
)
2424

25+
templatesDir.set(rootProject.file("docs/dokka-presets/templates"))
26+
2527
footerMessage.set("© ${java.time.LocalDate.now().year}, Amazon Web Services, Inc. or its affiliates. All rights reserved.")
2628
separateInheritedMembers.set(true)
2729
}
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
<#--
2+
This is a copy of Dokka's base.ftl, modified to add custom scripts for S_Code and Shortbread.
3+
Keep in sync with Dokka.
4+
-->
5+
<#import "includes/page_metadata.ftl" as page_metadata>
6+
<#import "includes/header.ftl" as header>
7+
<#import "includes/footer.ftl" as footer>
8+
<!DOCTYPE html>
9+
<html class="no-js" lang="en">
10+
<head>
11+
<meta name="viewport" content="width=device-width, initial-scale=1" charset="UTF-8">
12+
<@page_metadata.display/>
13+
<#-- AWS Analytics tracking script - Implements site-wide analytics and tracking functionality -->
14+
<script src="https://a0.awsstatic.com/s_code/js/3.0/awshome_s_code.js"></script>
15+
<@template_cmd name="pathToRoot">
16+
<script>var pathToRoot = "${pathToRoot}";</script></@template_cmd>
17+
<script>document.documentElement.classList.replace("no-js", "js");</script>
18+
<#-- This script doesn't need to be there but it is nice to have
19+
since app in dark mode doesn't 'blink' (class is added before it is rendered) -->
20+
<script>const storage = localStorage.getItem("dokka-dark-mode")
21+
if (storage == null) {
22+
const osDarkSchemePreferred = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches
23+
if (osDarkSchemePreferred === true) {
24+
document.getElementsByTagName("html")[0].classList.add("theme-dark")
25+
}
26+
} else {
27+
const savedDarkMode = JSON.parse(storage)
28+
if (savedDarkMode === true) {
29+
document.getElementsByTagName("html")[0].classList.add("theme-dark")
30+
}
31+
}
32+
</script>
33+
<#-- Scripts for AWS Shortbread -->
34+
<script>var existingShortbreadEl = document.getElementById("awsccc-sb-ux-c");
35+
existingShortbreadEl && existingShortbreadEl.remove();
36+
</script>
37+
<script src="https://prod.assets.shortbread.aws.dev/shortbread.js"></script>
38+
<link href="https://prod.assets.shortbread.aws.dev/shortbread.css" rel="stylesheet">
39+
<script>const shortbread = AWSCShortbread();
40+
shortbread.checkForCookieConsent();
41+
</script>
42+
<#-- Resources (scripts, stylesheets) are handled by Dokka.
43+
Use customStyleSheets and customAssets to change them. -->
44+
<@resources/>
45+
</head>
46+
<body>
47+
<div class="root">
48+
<@header.display/>
49+
<div id="container">
50+
<nav id="leftColumn" class="sidebar" data-item-type="SECTION" data-item-config='{"defaultSize": 280, "minSize": 200, "maxSize": 400}'>
51+
<a class="toc--skip-link" href="#main">Skip to content</a>
52+
<div class="dropdown theme-dark_mobile" data-role="dropdown" id="toc-dropdown">
53+
<ul role="listbox" id="toc-listbox" class="dropdown--list dropdown--list_toc-list"
54+
data-role="dropdown-listbox" aria-label="Table of contents">
55+
<div class="dropdown--header">
56+
<span>
57+
<@template_cmd name="projectName">
58+
${projectName}
59+
</@template_cmd>
60+
</span>
61+
<button class="button" data-role="dropdown-toggle" aria-label="Close table of contents">
62+
<i class="ui-kit-icon ui-kit-icon_cross"></i>
63+
</button>
64+
</div>
65+
<div class="sidebar--inner" id="sideMenu"></div>
66+
</ul>
67+
<div class="dropdown--overlay"></div>
68+
</div>
69+
</nav>
70+
<div id="resizer" class="resizer" data-item-type="BAR"></div>
71+
<div id="main" data-item-type="SECTION" role="main">
72+
<@content/>
73+
<@footer.display/>
74+
</div>
75+
</div>
76+
</div>
77+
</body>
78+
</html>

dokka-aws/build.gradle.kts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@
22
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
* SPDX-License-Identifier: Apache-2.0
44
*/
5+
import org.jetbrains.dokka.gradle.tasks.DokkaGenerateTask
56
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
67
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
7-
import java.time.LocalDate
88

99
/*
1010
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
1111
* SPDX-License-Identifier: Apache-2.0
1212
*/
1313
plugins {
14+
`dokka-convention`
1415
id(libs.plugins.kotlin.jvm.get().pluginId)
1516
}
1617

@@ -26,9 +27,9 @@ dependencies {
2627
testImplementation(libs.kotlin.test.junit5)
2728
}
2829

29-
tasks.test {
30+
tasks.withType<Test>().configureEach {
3031
useJUnitPlatform()
31-
dependsOn(tasks.dokkaHtml)
32+
dependsOn(tasks.withType<DokkaGenerateTask>())
3233
}
3334

3435
tasks.withType<KotlinCompile> {

0 commit comments

Comments
 (0)