diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index eeca6781f..3f81fcee6 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -22,15 +22,16 @@ jobs: steps: - name: "Checkout Branch" - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: "Setup Java" - uses: actions/setup-java@v1 + uses: actions/setup-java@v4 with: - java-version: 17 + distribution: 'temurin' + java-version: '21' - name: Setup Gradle cache - uses: actions/cache@v2.1.2 + uses: actions/cache@v4 with: path: ~/.gradle key: ${{ runner.os }}-gradle-${{ hashFiles('build.gradle') }} @@ -41,7 +42,7 @@ jobs: run: ./gradlew build -x test - name: Upload Gradle reports - uses: actions/upload-artifact@v2.2.4 + uses: actions/upload-artifact@v4 if: ${{ failure() }} with: name: Build Backend Reports @@ -58,15 +59,16 @@ jobs: steps: - name: "Checkout Branch" - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: "Setup Java" - uses: actions/setup-java@v1 + uses: actions/setup-java@v4 with: - java-version: 17 + distribution: 'temurin' + java-version: '21' - name: Setup Gradle cache - uses: actions/cache@v2.1.2 + uses: actions/cache@v4 with: path: ~/.gradle key: ${{ runner.os }}-gradle-${{ hashFiles('build.gradle') }} @@ -79,7 +81,7 @@ jobs: RUN_LONG_INTEGRATION_TESTS: false - name: Upload Gradle reports - uses: actions/upload-artifact@v2.2.4 + uses: actions/upload-artifact@v4 if: ${{ failure() }} with: name: Test Backend Reports diff --git a/.github/workflows/publish-jars.yml b/.github/workflows/publish-jars.yml index cde426ae3..09ffb8108 100644 --- a/.github/workflows/publish-jars.yml +++ b/.github/workflows/publish-jars.yml @@ -13,14 +13,18 @@ jobs: contents: read packages: write steps: - - uses: actions/checkout@v2 + - name: Checkout + uses: actions/checkout@v4 + - name: Set up Java - uses: actions/setup-java@v2 + uses: actions/setup-java@v4 with: - java-version: '17' + java-version: '21' distribution: 'adopt' + - name: Validate Gradle wrapper uses: gradle/wrapper-validation-action@v1 + - name: Publish Packages uses: gradle/gradle-build-action@v2 with: diff --git a/build.gradle.kts b/build.gradle.kts index a242c8a0b..bc1c56615 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -17,6 +17,6 @@ nexusPublishing { tasks.withType(KotlinCompile::class).all { kotlinOptions { - jvmTarget = "17" + jvmTarget = "21" } } diff --git a/buildSrc/src/main/kotlin/org.openbase.jul.gradle.kts b/buildSrc/src/main/kotlin/org.openbase.jul.gradle.kts index 7e6c81d1b..a286c413f 100644 --- a/buildSrc/src/main/kotlin/org.openbase.jul.gradle.kts +++ b/buildSrc/src/main/kotlin/org.openbase.jul.gradle.kts @@ -20,7 +20,7 @@ group = "org.openbase" val releaseVersion = !version.toString().endsWith("-SNAPSHOT") java { - sourceCompatibility = JavaVersion.VERSION_17 + sourceCompatibility = JavaVersion.VERSION_21 targetCompatibility = sourceCompatibility withSourcesJar() withJavadocJar() @@ -28,9 +28,9 @@ java { dependencies { api("org.openbase:jps:_") - api("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.20") + api("org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.0.0") api("kr.pe.kwonnam.slf4j-lambda:slf4j-lambda-core:0.1") - implementation("org.jetbrains.kotlin:kotlin-script-runtime:1.9.20") + implementation("org.jetbrains.kotlin:kotlin-script-runtime:2.0.0") testImplementation("org.junit.jupiter:junit-jupiter:[5.8,5.9-alpha)") testImplementation("org.junit.jupiter:junit-jupiter-api:[5.8,5.9-alpha)") testImplementation(Testing.mockK) @@ -41,7 +41,7 @@ dependencies { tasks.withType { kotlinOptions { - jvmTarget = "17" + jvmTarget = "21" } } diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index d64cd4917..2c3521197 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index b82aa23a4..09523c0e5 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index 1aa94a426..f5feea6d6 100755 --- a/gradlew +++ b/gradlew @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -55,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -84,7 +86,8 @@ done # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) -APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s +' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum diff --git a/gradlew.bat b/gradlew.bat index 6689b85be..9b42019c7 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -13,6 +13,8 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem @if "%DEBUG%"=="" @echo off @rem ########################################################################## @@ -43,11 +45,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -57,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail diff --git a/module/visual/swing/src/main/java/org/openbase/jul/visual/swing/engine/draw2d/AbstractResourcePanel.kt b/module/visual/swing/src/main/java/org/openbase/jul/visual/swing/engine/draw2d/AbstractResourcePanel.kt index 66668a434..40abf8b0f 100644 --- a/module/visual/swing/src/main/java/org/openbase/jul/visual/swing/engine/draw2d/AbstractResourcePanel.kt +++ b/module/visual/swing/src/main/java/org/openbase/jul/visual/swing/engine/draw2d/AbstractResourcePanel.kt @@ -67,6 +67,31 @@ abstract class AbstractResourcePanel: Res private val CHILDREN_MONITOR = Any() var objectType: ObjectType + constructor( + resource: R, + placementPolygon: Polygon?, + objectType: ObjectType, + parentResourcePanel: PRP?, + drawLayer: DrawLayer? = null, + parentPanel: ResourceDisplayPanel, + linkAsChild: Boolean = false, + ) { + this.resource = resource + this.objectType = objectType + this.state = VisibleResourcePanelState.Unselected + this.mouseState = VisibleResourcePanelMouseState.Untouched + this.parentResourcePanel = parentResourcePanel?: this as PRP + this.parentPanel = parentPanel + this.placementPolygon = placementPolygon + this.boundingBox = placementPolygon!!.bounds2D + this.transformedBoundingBox = Rectangle2D.Double() + this.jComponents = ArrayList() + this.childrens = LinkedList() + if(linkAsChild) { + this.parentResourcePanel.addChild(this, drawLayer!!) + } + } + constructor(resource: R, placementPolygon: Polygon, imageURI: String?, parentPanel: ResourceDisplayPanel) : this( resource, placementPolygon, @@ -99,19 +124,17 @@ abstract class AbstractResourcePanel: Res parentPanel ) - constructor(resource: R, placementPolygon: Polygon, objectType: ObjectType, parentPanel: ResourceDisplayPanel) { - this.resource = resource - this.objectType = objectType - this.state = VisibleResourcePanelState.Unselected - this.mouseState = VisibleResourcePanelMouseState.Untouched - this.parentResourcePanel = this as PRP - this.parentPanel = parentPanel - this.placementPolygon = placementPolygon - this.boundingBox = placementPolygon.bounds2D - this.transformedBoundingBox = Rectangle2D.Double() - this.jComponents = ArrayList() - this.childrens = LinkedList() - } + constructor(resource: R, + placementPolygon: Polygon, + objectType: ObjectType, + parentPanel: ResourceDisplayPanel + ) : this ( + resource = resource, + placementPolygon = placementPolygon, + objectType = objectType, + parentResourcePanel = null, + parentPanel = parentPanel, + ) constructor( resource: R, @@ -151,22 +174,16 @@ abstract class AbstractResourcePanel: Res placementPolygon: Polygon?, objectType: ObjectType, parentResourcePanel: PRP, - drawLayer: DrawLayer? - ) { - this.resource = resource - this.objectType = objectType - this.state = VisibleResourcePanelState.Unselected - this.mouseState = VisibleResourcePanelMouseState.Untouched - this.parentResourcePanel = parentResourcePanel - this.parentPanel = parentResourcePanel.parentPanel - this.placementPolygon = placementPolygon - this.boundingBox = placementPolygon!!.bounds2D - this.transformedBoundingBox = Rectangle2D.Double() - this.jComponents = ArrayList() - this.childrens = LinkedList() - this.parentResourcePanel.addChild(this, drawLayer!!) - assert(placementPolygon != null) - } + drawLayer: DrawLayer?, + ) : this ( + resource = resource, + placementPolygon = placementPolygon, + objectType = objectType, + parentResourcePanel = parentResourcePanel, + parentPanel = parentResourcePanel.parentPanel, + drawLayer = drawLayer, + linkAsChild = true, + ) override fun getName(): String { return resource.name diff --git a/versions.properties b/versions.properties index 23a133fae..447a55f14 100644 --- a/versions.properties +++ b/versions.properties @@ -11,7 +11,7 @@ version.junit.jupiter=5.10.1 version.java3d..j3d-core=1.3.1 plugin.io.github.gradle-nexus.publish-plugin=1.3.0 ## # available=2.0.0-rc-1 -version.kotlinx.coroutines=1.8.0 +version.kotlinx.coroutines=1.8.1 ## unused version.org.apache.commons..commons-collections4=4.4 ## unused @@ -42,8 +42,7 @@ version.org.controlsfx..controlsfx=11.2.0 version.org.codehaus.woodstox..woodstox-core-asl=[4.1,4.2-alpha) version.org.apache.commons..commons-lang3=3.13.0 version.mockk=1.13.8 -version.kotlin=1.9.20 -## # available=2.0.0-Beta1 +version.kotlin=2.0.0 version.kotest=5.6.2 ## # available=5.7.0 ## # available=5.7.1