HTML reports and SVG-based charts.
WARNING: This code is nowhere near being complete nor API-stable. Use it at your own risk, and contributions would be welcome.
This file focuses on building Carte from source. You can find more information about Carte in the Wiki.
After cloning the main repository:
git clone https://github.com/css4j/carte.gitrun the gradlew wrapper to build (requires Java 11 or later):
cd carte
./gradlew buildA variety of Gradle tasks can be executed:
-
./gradlew build(normal build). -
./gradlew build publishToMavenLocal(to install in local Maven repository). -
./gradlew uberjar(to create a fat jar with all dependencies). -
./gradlew publish(to deploy to a Maven repository, as described in thepublishingblock of io.sf.carte.java-conventions.gradle).
If your Gradle project depends on Carte, you can use this project's own Maven repository in a repositories section of
your build file, for easy access to dependencies:
repositories {
maven {
url = "https://css4j.github.io/maven/"
mavenContent {
releasesOnly()
}
content {
includeGroupByRegex 'io\\.sf\\..*'
// Alternative to the regex:
//includeGroup 'io.sf.carte'
//includeGroup 'io.sf.jclf'
//includeGroup 'io.sf.graphics'
//includeGroup 'io.sf.w3'
}
}
}please use this repository only for the artifact groups listed in the
includeGroup statements.
Then, to use the core Carte module put the following in your build.gradle file:
dependencies {
implementation "io.sf.carte:carte:${carteVersion}"
}where carteVersion could be defined in a gradle.properties file. Similarly,
to use carte-jmh:
dependencies {
implementation "io.sf.carte:carte-jmh:${carteVersion}"
}To run the benchmark report app on JMH-produced JSON files, you have to prepare a configuration file and execute:
./gradlew build uberjarjava -jar carte-jmh/build/libs/carte-jmh-<version>-all.jar --config=<path-to-config-file> *.json
You could use the example files as a starting point and run any of the
*-benchmark-charts.sh scripts that produces the graphs in
https://css4j.github.io/dom-mark.html https://css4j.github.io/svg-mark.html
For example, for the DOM benchmarks look inside the dom-benchmark.xml file:
-
In the element with
documentStoreid of that file, it is configured that the file~/www/css4j.github.io/dom-mark.htmlis aDocumentStorewhere the SVG graphs will be put. -
And the element with a
fileStoreid tells that the directory~/www/css4j.github.io/benchmarkwould be aFileStorecontaining the fallback images.
All that you have to do is to download your copy of the dom-mark.html file and
modify the paths in dom-benchmark.xml as necessary. Then:
cd carte-jmh/examples
./dom-benchmark-charts.sh dom-*.jsonAnd you shall reproduce the JMH charts.