Skip to content

Commit

Permalink
add content sources for jetty 10 and 11; update jetty block to accoun…
Browse files Browse the repository at this point in the history
…t for package name variation
  • Loading branch information
mojavelinux committed Mar 26, 2024
1 parent cadb542 commit df9b62e
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 7 deletions.
2 changes: 1 addition & 1 deletion antora-playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
16 changes: 15 additions & 1 deletion docs-home/modules/ROOT/pages/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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]
|===
15 changes: 10 additions & 5 deletions lib/jetty-block.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down Expand Up @@ -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]) => {
Expand All @@ -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 {
Expand All @@ -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')
Expand Down

0 comments on commit df9b62e

Please sign in to comment.