-
Notifications
You must be signed in to change notification settings - Fork 0
/
docs.sh
40 lines (27 loc) · 1.14 KB
/
docs.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
set -e
# Evaluate Maven Coordinates
mvn help:evaluate -Dexpression=project.groupId -Doutput=groupId.mvnhelp
mvn help:evaluate -Dexpression=project.artifactId -Doutput=artifactId.mvnhelp
mvn help:evaluate -Dexpression=project.version -Doutput=version.mvnhelp
git log -1 --pretty=format:'%H' >> gitHash.mvnhelp
groupId=$(cat groupId.mvnhelp)
artifactId=$(cat artifactId.mvnhelp)
version=$(cat version.mvnhelp)
gitHash=$(cat gitHash.mvnhelp)
rm *.mvnhelp
# Create JavaDocs
mkdir --parents ./dist/
rm -rf ./dist/
cp -a ./public/ ./dist/
cp ./build.sh ./dist/
cp ./docs.sh ./dist/
cp ./download_jar.sh ./dist/
mkdir --parents ./dist/javadocs/
mkdir --parents ./dist/man/
# Create Variables
prefix_name="${artifactId}-${version}"
cp maven.zip ./dist/
unzip "./target/${prefix_name}-javadoc.jar" -d ./dist/javadocs
java -jar "./target/${prefix_name}.jar" gen-manpage -d ./dist/man/
asciidoctor --source-dir "./dist/man" "./dist/man/*.adoc"
asciidoctor README.asciidoc "--attribute" "gitHash=${gitHash}" "--attribute" "mavenGroupId=${groupId}" "--attribute" "mavenArtifactId=${artifactId}" "--attribute" "mavenVersion=${version}" "--out-file" "./dist/index.html"