Skip to content

Commit 286a368

Browse files
authored
Merge pull request #36 from appdevforall/fix/ADFA-5548
ADFA-5548: Android(X) docs in template format
2 parents df64bae + 0ae218f commit 286a368

28 files changed

Lines changed: 6368 additions & 10 deletions

‎.github/workflows/build-android-docs-local.yaml‎

Lines changed: 333 additions & 0 deletions
Large diffs are not rendered by default.

‎.github/workflows/build-android-docs.yaml‎

Lines changed: 382 additions & 0 deletions
Large diffs are not rendered by default.

‎.github/workflows/build-kotlin-docs.yaml‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,10 @@ permissions:
4747

4848
# This workflow overwrites a single shared Drive file - never let two runs
4949
# race to upload against each other.
50+
# Shared with build-android-docs.yaml: both rewrite the same documentation.db on Drive, so they
51+
# have to serialise against each other, not merely against a second run of themselves.
5052
concurrency:
51-
group: build-kotlin-docs
53+
group: documentation-db
5254
cancel-in-progress: false
5355

5456
on:

‎ProcessDocs/AndroidDocs/AndroidDocsToJson/README.md‎

Lines changed: 419 additions & 0 deletions
Large diffs are not rendered by default.

‎ProcessDocs/AndroidDocs/AndroidDocsToJson/android_docs_to_json.py‎

Lines changed: 1373 additions & 0 deletions
Large diffs are not rendered by default.

‎ProcessDocs/AndroidDocs/AndroidDocsToJson/load_android_json_db.py‎

Lines changed: 359 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Gradle build output.
2+
build/
3+
.gradle/
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// Renders the JSON that android_docs_to_json.py writes into browsable HTML, using Pebble
2+
// templates that follow the layout of the reference pages the JSON was read from.
3+
//
4+
// Deliberately plain Java, and compiled for 17 rather than through a toolchain: this has to build
5+
// with whatever JDK happens to be on the machine, and nothing here needs anything newer.
6+
plugins {
7+
application
8+
}
9+
10+
repositories {
11+
mavenCentral()
12+
}
13+
14+
dependencies {
15+
implementation("io.pebbletemplates:pebble:3.2.2")
16+
implementation("com.fasterxml.jackson.core:jackson-databind:2.17.2")
17+
18+
testImplementation("org.junit.jupiter:junit-jupiter:5.10.2")
19+
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
20+
}
21+
22+
// The templates are the part of this module most likely to break silently: Pebble is configured
23+
// with strictVariables(false), so a field that stops existing renders as nothing rather than as
24+
// an error, and a macro called with a `macros.` prefix renders empty too. The tests render a real
25+
// page and assert the pieces are there.
26+
tasks.test {
27+
useJUnitPlatform()
28+
}
29+
30+
java {
31+
sourceCompatibility = JavaVersion.VERSION_17
32+
targetCompatibility = JavaVersion.VERSION_17
33+
}
34+
35+
application {
36+
mainClass.set("org.appdevforall.docs.android.AndroidDocRenderer")
37+
}
38+
39+
tasks.named<JavaExec>("run") {
40+
// Lets the driver script pass "<json-dir> <html-dir>" through as -Pargs="..."
41+
(findProperty("args") as String?)?.let { args = it.split(" ").filter { a -> a.isNotEmpty() } }
42+
}
Binary file not shown.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.1-bin.zip
4+
networkTimeout=10000
5+
retries=0
6+
retryBackOffMs=500
7+
validateDistributionUrl=true
8+
zipStoreBase=GRADLE_USER_HOME
9+
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)