Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Reviewers for Dependabot PRs
build.gradle @sebastian-peter @danielfeismann @staudtMarius

# Reviewers for CI/CD related PRs
.github/workflows/ @sebastian-peter @PhilippSchmelter
5 changes: 0 additions & 5 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,3 @@ updates:
time: "04:00"
open-pull-requests-limit: 10
target-branch: main
reviewers:
- ckittl
- johanneshiry
- t-ober
- sensarmad
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -219,3 +219,11 @@ gradle-app.setting

# Cache of project
.gradletasknamecache

# Read the docs integration
# Don't commit the virtual environment of python
**/venv
docs/readthedocs/build

# Ignore output files
/output/
21 changes: 21 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the version of Python and other tools you might need
build:
os: ubuntu-24.04
tools:
python: "3.13"

# Configure python
python:
install:
- requirements: docs/readthedocs/requirements.txt

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/readthedocs/conf.py
20 changes: 10 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ plugins {

ext {
//version (changing these should be considered thoroughly!)
javaVersion = JavaVersion.VERSION_11
javaVersion = JavaVersion.VERSION_17
tscfgVersion = '0.9.986'
scriptsLocation = 'gradle' + File.separator + 'scripts' + File.separator //location of script
}
Expand Down Expand Up @@ -90,7 +90,7 @@ dependencies {
testImplementation 'junit:junit:4.13.2'
testImplementation 'cglib:cglib-nodep:3.3.0' // enables mocking of classes (in addition to interfaces)
testImplementation 'org.mockito:mockito-core:3.11.2' // mocking framework
testImplementation 'org.spockframework:spock-core:2.0-M3-groovy-3.0'
testImplementation 'org.spockframework:spock-core:2.3-groovy-4.0'
testImplementation 'org.objenesis:objenesis:3.2' // Mock creation with constructor parameters

// config //
Expand All @@ -99,16 +99,16 @@ dependencies {

}

wrapper {
gradleVersion = '7.0'
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}

tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
tasks.withType(Javadoc){
options.encoding = 'UTF-8'
}

task printVersion {
doLast {
println project.version
}
tasks.register("printVersion") {
doLast {
println project.version
}
}
20 changes: 20 additions & 0 deletions docs/readthedocs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
13 changes: 13 additions & 0 deletions docs/readthedocs/_static/css/theme_override.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/* Suppress spacing after multi-line entries in tables
* Inspired by this issue: https://github.com/readthedocs/sphinx_rtd_theme/issues/117 */
.wy-table-responsive table td div.line-block {
margin-bottom: 0;
font-size: 90%;
}
.wy-table-responsive table th div.line-block {
margin-bottom: 0;
font-size: 90%;
}
.wy-table-responsive table th p {
margin-bottom: 0;
}
73 changes: 73 additions & 0 deletions docs/readthedocs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))


# -- Project information -----------------------------------------------------

project = 'OSMoGrid'
copyright = u'2021. TU Dortmund University, Institute of Energy Systems, Energy Efficiency and Energy Economics, Research group Distribution grid planning and operation '
author = 'Johannes Hiry, Chris Kittl, Lars Lenssen, Thomas Oberließen, Sebastian Peter'

# The full version, including alpha/beta/rc tags
version = '1.0'
release = '1.0.1-SNAPSHOT'

pygments_style = 'tango'
add_function_parentheses = True
# Will point sphinx to use 'index.rst' as the master document
master_doc = 'index'

# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'myst_parser',
'sphinx.ext.autosectionlabel',
]

# Prefix all autogenerated labels wit the document to get unique labels (e.g. `index:Hello`)
autosectionlabel_prefix_document = True

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', 'venv']

source_encoding = 'utf-8-sig'

# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'sphinx_rtd_theme'
html_short_title = "OSMoGrid"
htmlhelp_basename = 'OSMoGrid-doc'
html_use_index = True
html_show_sourcelink = False

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']


def setup(app):
app.add_css_file("css/theme_override.css")
19 changes: 19 additions & 0 deletions docs/readthedocs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
.. OSMoGrid documentation master file, created by
sphinx-quickstart on Sun Nov 28 14:17:05 2021.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.

Welcome to OSMoGrid's documentation!
====================================

.. toctree::
:maxdepth: 2
:caption: Contents:


Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
35 changes: 35 additions & 0 deletions docs/readthedocs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=.
set BUILDDIR=_build

if "%1" == "" goto help

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://www.sphinx-doc.org/
exit /b 1
)

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
3 changes: 3 additions & 0 deletions docs/readthedocs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
myst-parser==4.0.1
Sphinx==8.2.3
sphinx-rtd-theme==3.0.2
95 changes: 63 additions & 32 deletions gradle/scripts/documentation.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,23 @@ def docBaseDirPath = project.projectDir.toString() + File.separator + project.do
* Configuring the sphinx plugin
*/
sphinx {
description 'Generate high level HTML documentation output.'
group 'Documentation'
description 'Generate high level HTML documentation output.'
group 'Documentation'

sourceDirectory = "${docBaseDirPath}/readthedocs"
outputDirectory = "${project.buildDir}/docs/readthedocs"
sourceDirectory = "${docBaseDirPath}/readthedocs"
outputDirectory = layout.buildDirectory.dir("/docs/readthedocs")
}

/**
* Task to generate the JavaDoc
*/
javadoc() {
description 'Generates java API doc at the correct place.'
group 'Documentation'
description 'Generates java API doc at the correct place.'
group 'Documentation'

source = sourceSets.main.allJava
destinationDir = file( docBaseDirPath + 'javadoc' )
classpath = project.sourceSets.main.compileClasspath
source = sourceSets.main.allJava
destinationDir = file( docBaseDirPath + 'javadoc' )
classpath = project.sourceSets.main.compileClasspath
}

/**
Expand All @@ -34,27 +34,58 @@ javadoc() {
* Important note: you have to install GraphViz Manually before being able to execute this task! -> https://graphviz.org
*/
task puml2png() {
description 'Converts plantUML diagrams to png files.'
group 'Documentation'

doLast {
/* Get the PlantUML-jar or download it, if it is not available */
def pumlJarFile = project.file("${project.buildDir}/plantuml.jar")
if (!pumlJarFile.exists() || !pumlJarFile.isFile()) {
download {
src 'https://downloads.sourceforge.net/project/plantuml/plantuml.jar'
dest buildDir
}
}
javaexec {
main = "-jar"
args = [
"build/plantuml.jar",
"-psvg",
"-o",
"${docBaseDirPath}readthedocs/_static/figures/uml/",
"${docBaseDirPath}uml/**/*.puml"
]
}
}
description 'Converts plantUML diagrams to png files.'
group 'Documentation'

doLast {
/* Get the PlantUML-jar or download it, if it is not available */
def pumlJarFile = layout.buildDirectory.file("plantuml.jar").get().asFile
if (!pumlJarFile.exists() || !pumlJarFile.isFile()) {
download.run {
src 'https://downloads.sourceforge.net/project/plantuml/plantuml.jar'
dest layout.buildDirectory.get()
}
}
javaexec {
main = "-jar"
args = [
"build/plantuml.jar",
"-psvg",
"-o",
"${docBaseDirPath}readthedocs/_static/figures/puml/",
"${docBaseDirPath}puml/**/*.puml"
]
}
}
}

/**
* Converts the PlantUML diagrams to a svg file, so that those can be used in sphinx documentation
*
* Important note: you have to install GraphViz Manually before being able to execute this task! -> https://graphviz.org
*/
task puml2svg() {
description 'Converts plantUML diagrams to svg files.'
group 'Documentation'

doLast {
/* Get the PlantUML-jar or download it, if it is not available */
def pumlJarFile = layout.buildDirectory.file("plantuml.jar").get().asFile
if (!pumlJarFile.exists() || !pumlJarFile.isFile()) {
download.run {
src 'https://downloads.sourceforge.net/project/plantuml/plantuml.jar'
dest layout.buildDirectory.get()
}
}
javaexec {
main = "-jar"
args = [
"build/plantuml.jar",
"-svg",
"-o",
"${docBaseDirPath}readthedocs/_static/figures/puml/",
"${docBaseDirPath}puml/**/*.puml"
]
}
}
}
Loading