Fix doc builds on windows (#1409)

Signed-off-by: Marinov Avgustin <Avgustin.Marinov@bosch.com>
This commit is contained in:
Avgustin Marinov
2023-08-03 16:27:51 +03:00
committed by GitHub
parent b35f45aabc
commit 4590d004f9
5 changed files with 92 additions and 5 deletions

4
.gitattributes vendored
View File

@@ -1,4 +1,5 @@
* text eol=lf
*.bat text eol=crlf
# Denote all files that are truly binary and should not be modified.
*.png binary
*.jpg binary
@@ -9,3 +10,6 @@
*.eot binary
*.ttf binary
*.woff binary
*.jks binary
*.pfx binary
*.p12 binary

23
docs/cleanup.bat Normal file
View File

@@ -0,0 +1,23 @@
@echo off
@REM
@REM Copyright (c) 2018 Bosch Software Innovations GmbH and others.
@REM
@REM All rights reserved. This program and the accompanying materials
@REM are made available under the terms of the Eclipse Public License v1.0
@REM which accompanies this distribution, and is available at
@REM http://www.eclipse.org/legal/epl-v10.html
@REM
rem This script is used to clean up the previously generated or downloaded files.
echo [INFO] Remove Hugo Theme
rmdir /Q /S themes resources public
echo [INFO] ... done
echo [INFO]
echo [INFO] Remove generated REST docs
del /Q content\rest-api\*.html
echo [INFO] ... done

30
docs/install-theme.bat Normal file
View File

@@ -0,0 +1,30 @@
@echo off
@REM
@REM Copyright (c) 2018 Bosch Software Innovations GmbH and others.
@REM
@REM All rights reserved. This program and the accompanying materials
@REM are made available under the terms of the Eclipse Public License v1.0
@REM which accompanies this distribution, and is available at
@REM http://www.eclipse.org/legal/epl-v10.html
@REM
rem This script checks if 'hugo' is installed. Afterwards, the Hugo theme is downloaded.
hugo version
if ERRORLEVEL 1 (
echo [ERROR] Please install Hugo first before proceeding.
exit 1
)
echo [INFO]
echo [INFO] Install Hugo Theme
set HUGO_THEMES=themes\hugo-material-docs
if not exist %HUGO_THEMES%\ (
git submodule add --force https://github.com/digitalcraftsman/hugo-material-docs.git %HUGO_THEMES%
echo [INFO] ... done
) else echo [INFO] ... theme already installed in: %HUGO_THEMES%
echo [INFO]
echo [INFO] Launch the documentation locally by running 'mvn site' (or 'hugo server' in the docs directory),
echo [INFO] and browse to 'http://localhost:1313/hawkbit/'.

View File

@@ -24,6 +24,35 @@
<exec-maven-plugin.version>1.6.0</exec-maven-plugin.version>
</properties>
<profiles>
<profile>
<id>unix</id>
<activation>
<os>
<family>!windows</family>
</os>
</activation>
<properties>
<shell>/bin/bash</shell>
<shell.option/>
<batch.ext>sh</batch.ext>
</properties>
</profile>
<profile>
<id>windows</id>
<activation>
<os>
<family>windows</family>
</os>
</activation>
<properties>
<shell>cmd</shell>
<shell.option>/c</shell.option>
<batch.ext>bat</batch.ext>
</properties>
</profile>
</profiles>
<build>
<plugins>
<plugin>
@@ -64,10 +93,11 @@
</goals>
<phase>install</phase>
<configuration>
<executable>/bin/bash</executable>
<executable>${shell}</executable>
<workingDirectory>${project.basedir}</workingDirectory>
<arguments>
<argument>install-theme.sh</argument>
<argument>${shell.option}</argument>
<argument>install-theme.${batch.ext}</argument>
</arguments>
</configuration>
</execution>
@@ -92,10 +122,11 @@
</goals>
<phase>clean</phase>
<configuration>
<executable>/bin/bash</executable>
<executable>${shell}</executable>
<workingDirectory>${project.basedir}</workingDirectory>
<arguments>
<argument>cleanup.sh</argument>
<argument>${shell.option}</argument>
<argument>cleanup.${batch.ext}</argument>
</arguments>
</configuration>
</execution>

Submodule docs/themes/hugo-material-docs deleted from 9dbd25cf94