From df9b62e3ce070f1eba6e8a2dbe1fce06ac4a9326 Mon Sep 17 00:00:00 2001 From: Dan Allen Date: Tue, 26 Mar 2024 03:46:23 -0600 Subject: [PATCH] add content sources for jetty 10 and 11; update jetty block to account for package name variation --- antora-playbook.yml | 2 +- docs-home/modules/ROOT/pages/index.adoc | 16 +++++++++++++++- lib/jetty-block.js | 15 ++++++++++----- 3 files changed, 26 insertions(+), 7 deletions(-) diff --git a/antora-playbook.yml b/antora-playbook.yml index 4bf4803..407bf43 100644 --- a/antora-playbook.yml +++ b/antora-playbook.yml @@ -30,7 +30,7 @@ content: branches: HEAD start_paths: [home, docs-home, contribution-guide] - url: https://github.com/opendevise/jetty.project - branches: jetty-12.0.x-for-antora + branches: jetty-{12,11,10}.0.x-for-antora start_path: documentation/jetty asciidoc: attributes: diff --git a/docs-home/modules/ROOT/pages/index.adoc b/docs-home/modules/ROOT/pages/index.adoc index 734e561..59a2285 100644 --- a/docs-home/modules/ROOT/pages/index.adoc +++ b/docs-home/modules/ROOT/pages/index.adoc @@ -11,5 +11,19 @@ s|Jetty 12 xref:12@jetty:programming-guide:index.adoc[] |https://eclipse.dev/jetty/javadoc/jetty-12/index.html?overview-summary.html[api] / -https://github.com/eclipse/jetty.project/tree/jetty-12.0.3[source] +https://github.com/eclipse/jetty.project/tree/jetty-12.0.x[source] + +s|Jetty 11 +|xref:11@jetty:operations-guide:index.adoc[] + +xref:11@jetty:programming-guide:index.adoc[] + +|https://eclipse.dev/jetty/javadoc/jetty-11/index.html?overview-summary.html[api] / +https://github.com/eclipse/jetty.project/tree/jetty-11.0.x[source] + +s|Jetty 10 +|xref:10@jetty:operations-guide:index.adoc[] + +xref:10@jetty:programming-guide:index.adoc[] + +|https://eclipse.dev/jetty/javadoc/jetty-10/index.html?overview-summary.html[api] / +https://github.com/eclipse/jetty.project/tree/jetty-10.0.x[source] |=== diff --git a/lib/jetty-block.js b/lib/jetty-block.js index 379d389..957813c 100644 --- a/lib/jetty-block.js +++ b/lib/jetty-block.js @@ -4,7 +4,11 @@ const fs = require('node:fs') const ospath = require('node:path') const { execFileSync } = require('node:child_process') -const MAIN_CLASS = 'org.eclipse.jetty.tests.testers.RunJetty' +const MAIN_CLASS = { + default: 'org.eclipse.jetty.tests.testers.RunJetty', + 11: 'org.eclipse.jetty.tests.hometester.RunJetty', + 10: 'org.eclipse.jetty.tests.hometester.RunJetty', +} function createExtensionGroup (context) { return function () { @@ -54,7 +58,8 @@ function createExtensionGroup (context) { } const args = [] args.push('-cp', runJettyClasspath) - args.push(MAIN_CLASS) + const mainClass = MAIN_CLASS[doc.getAttribute('page-version')] || MAIN_CLASS.default + args.push(mainClass) args.push('--jetty-home=' + jettyHome) args.push('--jetty-version=' + doc.getAttribute('version')) const runJettyArgs = Object.entries(config).reduce((accum, [name, val]) => { @@ -65,7 +70,7 @@ function createExtensionGroup (context) { return accum }, []) console.log( - '[exec] java -cp $RUN_JETTY_CLASSPATH ' + MAIN_CLASS + ' --jetty-home=$JETTY_HOME' + + '[exec] java -cp $RUN_JETTY_CLASSPATH ' + mainClass + ' --jetty-home=$JETTY_HOME' + (runJettyArgs.length ? ' ' + runJettyArgs.map((it) => it.replace('=', '="') + '"').join(' ') : '') ) try { @@ -75,12 +80,12 @@ function createExtensionGroup (context) { if (includeContents.startsWith('**')) attrs.subs = '+quotes' return this.createBlock(parent, 'literal', includeContents, attrs) } else { - log(doc, 'error', `${MAIN_CLASS} no output`, cursor) + log(doc, 'error', `${mainClass} no output`, cursor) return this.createBlock(parent, 'literal', lines, attrs) } } catch (e) { const message = [ - `${MAIN_CLASS} failed:`, + `${mainClass} failed:`, e.stderr.toString().trimEnd(), `RUN_JETTY_CLASSPATH=${runJettyClasspath}` ].join('\n')