Skip to content

Commit

Permalink
Merge branch 'release/2023.6.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
sfeilmeier committed Jun 1, 2023
2 parents 1a9ce01 + cc8380c commit c69b14a
Show file tree
Hide file tree
Showing 542 changed files with 11,324 additions and 10,215 deletions.
Binary file modified .gradle-wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion .gradle-wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
136 changes: 111 additions & 25 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,30 @@
plugins {
id 'java'
id 'biz.aQute.bnd.workspace'
id 'java-library'
id 'com.github.node-gradle.node'
}

repositories {
mavenCentral()
maven {
url = uri('https://repo.maven.apache.org/maven2/')
}
}

dependencies {
// Use JUnit test framework.
testImplementation 'junit:junit:4.13.2'

// This dependency is used by the application.
implementation 'biz.aQute.bnd.workspace:biz.aQute.bnd.workspace.gradle.plugin:6.4.0'
}

java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}

/*
* disable report generation
*/
Expand All @@ -12,21 +33,38 @@ allprojects {
mavenCentral()
gradlePluginPortal()
}

tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
options.fork = true
options.incremental = true
}

}
tasks.withType(Test) {
maxParallelForks = 2
forkEvery = 100
reports {
html.required = false
junitXml.required = false
}
}
}
}

task cleanEdge() {
group 'OpenEMS-Build'
description 'Clean all Edge-Bundles'
}
task cleanBackend() {
group 'OpenEMS-Build'
description 'Clean all Backend-Bundles'
}
task assembleEdge() {
group 'OpenEMS-Build'
description 'Assemble all Edge-Bundles'
}
task assembleBackend() {
group 'OpenEMS-Build'
description 'Assemble all Backend-Bundles'
}

/*
Expand All @@ -35,25 +73,43 @@ allprojects {
subprojects {
if (plugins.hasPlugin("biz.aQute.bnd")) {
apply plugin: 'checkstyle'

checkstyle {
toolVersion = '10.4'
toolVersion = '10.11.0'
configFile = file("${rootDir}/cnf/checkstyle.xml")
maxWarnings = 0
ignoreFailures false
}

tasks.withType(Checkstyle) {
reports {
xml.required = false
html.required = false
}
}

tasks.withType(aQute.bnd.gradle.Export) {
dependsOn tasks.withType(aQute.bnd.gradle.Resolve)
}
}

if ( it.name ==~ /io.openems.(common|edge|shared|wrapper).*/ ) {
def clean = tasks.findByName('clean')
def assemble = tasks.findByName('assemble')
if( clean && assemble ) {
rootProject.tasks.findByPath(':cleanEdge').dependsOn(clean)
rootProject.tasks.findByPath(':assembleEdge').dependsOn(assemble)
}
}

if ( it.name ==~ /io.openems.(backend|common|shared|wrapper).*/ ) {
def clean = tasks.findByName('clean')
def assemble = tasks.findByName('assemble')
if( clean && assemble ) {
rootProject.tasks.findByPath(':cleanBackend').dependsOn(clean)
rootProject.tasks.findByPath(':assembleBackend').dependsOn(assemble)
}
}
}

tasks.named('wrapper') {
Expand All @@ -76,11 +132,25 @@ task buildComponents() {
}
}

/*
* Build OpenEMS Edge fat-jar
*/
task buildEdge() {
dependsOn ':io.openems.edge.application:export.EdgeApp'
group 'OpenEMS-Build'
description 'Build a Fat-Jar for the OpenEMS-Edge into build/openems-edge.jar'

def assemble = tasks.findByPath(':assembleEdge')
def export = tasks.findByPath(':io.openems.edge.application:export.EdgeApp')
def resolve = tasks.findByPath(':io.openems.edge.application:resolve.EdgeApp')

dependsOn assemble
dependsOn export
dependsOn resolve

resolve.mustRunAfter assemble
export.mustRunAfter resolve

/* force rebuild */
export.outputs.upToDateWhen { false }
outputs.upToDateWhen { false }

doLast {
file("${buildDir}/openems-edge.jar").delete()
copy {
Expand All @@ -91,11 +161,25 @@ task buildEdge() {
}
}

/*
* Build OpenEMS Backend fat-jar
*/
task buildBackend() {
dependsOn ":io.openems.backend.application:export.BackendApp"
group 'OpenEMS-Build'
description 'Build a Fat-Jar for the OpenEMS-Backend into build/openems-backend.jar'

def assemble = tasks.findByPath(':assembleBackend')
def export = tasks.findByPath(':io.openems.backend.application:export.BackendApp')
def resolve = tasks.findByPath(':io.openems.backend.application:resolve.BackendApp')

dependsOn assemble
dependsOn export
dependsOn resolve

resolve.mustRunAfter assemble
export.mustRunAfter resolve

/* force rebuild */
export.outputs.upToDateWhen { false }
outputs.upToDateWhen { false }

doLast {
file("${buildDir}/openems-backend.jar").delete()
copy {
Expand Down Expand Up @@ -137,13 +221,13 @@ task copyBundleReadmes() {
def targetBridge = basePath + "edge/bridge.adoc.d"
def targetDeviceService = basePath + "edge/device_service.adoc.d"
def targetTimedata = basePath + "edge/timedata.adoc.d"

// initialize target files and directories
[targetController, targetScheduler, targetNature, targetBridge, targetDeviceService, targetTimedata].each { target ->
delete fileTree(dir: target, include: '**/*.adoc')
new File(target + "/_include.adoc").write('')
}

subprojects.each { proj ->
// in each subproject (= bundle)...
proj.file(".").listFiles().each { sourceFile ->
Expand All @@ -168,21 +252,21 @@ task copyBundleReadmes() {
} else {
target = targetDeviceService
}

} else if(bundle.startsWith("io.openems.backend.")) {
// ignore
return

} else if(bundle.startsWith("io.openems.wrapper")) {
// ignore
return
}

// could we exactly evaluate the bundle type and set the targetFile?
if(target == null) {
throw new Exception("Bundle type is unknown for " + bundle)
}

// copy the readme file to "target.d" folder
copy {
from (sourceFile.toPath())
Expand All @@ -191,7 +275,7 @@ task copyBundleReadmes() {
return bundle + ".adoc"
}
}

// append content of source file to target file
File targetFile = new File(target + "/_include.adoc")
targetFile.append("\ninclude::" + bundle + ".adoc[leveloffset=+1]\n")
Expand All @@ -205,11 +289,13 @@ task copyBundleReadmes() {
* Build Antora docs
*/
task buildAntoraDocs(dependsOn: copyBundleReadmes) {
group 'Documentation'

dependsOn ":doc:buildAntoraDocs"
doLast {
copy {
from "doc/build/www"
into "${buildDir}/www"
}
}
}
}
1 change: 1 addition & 0 deletions cnf/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
<property name="allowEmptyMethods" value="true"/>
<property name="allowEmptyTypes" value="true"/>
<property name="allowEmptyLoops" value="true"/>
<property name="tokens" value="ASSIGN,BAND,BAND_ASSIGN,BOR,BOR_ASSIGN,BSR,BSR_ASSIGN,BXOR,BXOR_ASSIGN,COLON,DIV,DIV_ASSIGN,DO_WHILE,EQUAL,GE,GT,LAMBDA,LAND,LCURLY,LE,LITERAL_CATCH,LITERAL_DO,LITERAL_ELSE,LITERAL_FINALLY,LITERAL_FOR,LITERAL_IF,LITERAL_RETURN,LITERAL_SYNCHRONIZED,LITERAL_TRY,LITERAL_WHILE,LOR,LT,MINUS,MINUS_ASSIGN,MOD,MOD_ASSIGN,NOT_EQUAL,PLUS,PLUS_ASSIGN,QUESTION,RCURLY,SL,SLIST,SL_ASSIGN,SR,SR_ASSIGN,STAR,STAR_ASSIGN,LITERAL_ASSERT,TYPE_EXTENSION_AND"/>
<message key="ws.notPreceded" value="WhitespaceAround: ''{0}'' is not preceded with whitespace."/>
<message key="ws.notFollowed" value="WhitespaceAround: ''{0}'' is not followed by whitespace. Empty blocks may only be represented as '{}' when not part of a multi-block statement (4.1.3)"/>
</module>
Expand Down
12 changes: 6 additions & 6 deletions cnf/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>31.1-jre</version>
<version>32.0.0-jre</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
Expand Down Expand Up @@ -107,7 +107,7 @@
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.11.0</version>
<version>2.12.0</version>
</dependency>
<!-- de -->
<dependency>
Expand Down Expand Up @@ -259,7 +259,7 @@
<!-- Changelog: https://github.com/typetools/checker-framework/blob/master/docs/CHANGELOG.md -->
<groupId>org.checkerframework</groupId>
<artifactId>checker-qual</artifactId>
<version>3.32.0</version>
<version>3.34.0</version>
</dependency>
<dependency>
<groupId>org.dhatim</groupId>
Expand Down Expand Up @@ -300,18 +300,18 @@
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-osgi-bundle</artifactId>
<version>1.8.20</version>
<version>1.8.21</version>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlinx</groupId>
<artifactId>kotlinx-coroutines-core-jvm</artifactId>
<version>1.6.4</version>
<version>1.7.1</version>
</dependency>
<dependency>
<!-- HTML processing -->
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.15.4</version>
<version>1.16.1</version>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
Expand Down
22 changes: 11 additions & 11 deletions doc/build.gradle
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
apply plugin: 'com.github.node-gradle.node'

node {
nodeModulesDir = file("${projectDir}/build")
nodeModulesDir = file("${projectDir}/build")
}

/*
* Build Antora docs
*/
task buildAntoraDocs(type: NodeTask) {
dependsOn npmInstall
script = file("build/node_modules/@antora/cli/bin/antora")
args = ["site.yml"]
doLast {
copy {
from "build/.nojekyll", "build/CNAME"
into "build/www"
}
}
}
dependsOn npmInstall
script = file("build/node_modules/@antora/cli/bin/antora")
args = ["site.yml"]
doLast {
copy {
from "build/.nojekyll", "build/CNAME"
into "build/www"
}
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions doc/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
** xref:ui/setup-ide.adoc[Setup IDE]
** xref:ui/architecture.adoc[Architecture]
** xref:ui/build.adoc[Build OpenEMS UI]
** xref:ui/implementing-a-widget.adoc[Implementing a UI Widget]
* OpenEMS Backend
** xref:backend/architecture.adoc[Architecture]
** xref:backend/backend-to-backend.adoc[Backend-to-Backend]
Expand Down
Loading

0 comments on commit c69b14a

Please sign in to comment.