diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dafe022c..495b617e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,7 @@ jobs: uses: actions/setup-java@v4 with: distribution: liberica - java-version: 11 + java-version: 17 - name: Setup Gradle uses: gradle/actions/setup-gradle@v4 @@ -71,7 +71,7 @@ jobs: uses: actions/setup-java@v4 with: distribution: liberica - java-version: 11 + java-version: 17 - name: Setup Gradle uses: gradle/actions/setup-gradle@v4 @@ -158,7 +158,7 @@ jobs: uses: actions/setup-java@v4 with: distribution: liberica - java-version: 11 + java-version: 17 - name: Setup Gradle uses: gradle/actions/setup-gradle@v4 diff --git a/build.gradle b/build.gradle index 9d15dda2..1abc266b 100644 --- a/build.gradle +++ b/build.gradle @@ -7,8 +7,8 @@ ext { } allprojects { - group 'imgui-java' - version 'git describe --tags --always'.execute().text.trim().substring(1) + group = 'imgui-java' + version = 'git describe --tags --always'.execute().text.trim().substring(1) repositories { mavenCentral() @@ -21,16 +21,19 @@ allprojects { into 'META-INF' } + def jdkMetadata = tasks.withType(JavaCompile).find().javaCompiler.get().metadata + def buildJdk = "${jdkMetadata.javaRuntimeVersion} (${jdkMetadata.vendor})".toString() + manifest { attributes ( 'Implementation-Title': project.name, 'Implementation-Version': project.version, 'Build-Timestamp': new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ").format(System.currentTimeMillis()), 'Build-Revision': 'git rev-parse HEAD'.execute().text.trim(), - 'Build-Jdk': "${System.getProperty('java.version')} (${System.getProperty('java.vendor')})", + 'Build-Jdk': buildJdk, 'Source-Compatibility': tasks.withType(JavaCompile).find().sourceCompatibility, 'Target-Compatibility': tasks.withType(JavaCompile).find().targetCompatibility, - 'Created-By': "Gradle ${gradle.gradleVersion}" + 'Created-By': "Gradle ${gradle.gradleVersion} " ) } } diff --git a/example/src/main/java/ExampleCanvasEditor.java b/example/src/main/java/ExampleCanvasEditor.java index 8d52a153..1124fcbc 100644 --- a/example/src/main/java/ExampleCanvasEditor.java +++ b/example/src/main/java/ExampleCanvasEditor.java @@ -65,9 +65,9 @@ public static void show(final ImBoolean showCanvaWindow) { ImGuiIO io = ImGui.getIO(); ImDrawList drawList = ImGui.getWindowDrawList(); drawList.addRectFilled(canvasP0.x, canvasP0.y, canvasP1.x, canvasP1.y, - ImColor.intToColor(50, 50, 50, 255)); + ImColor.rgba(50, 50, 50, 255)); drawList.addRect(canvasP0.x, canvasP0.y, canvasP1.x, canvasP1.y, - ImColor.intToColor(255, 255, 255, 255)); + ImColor.rgba(255, 255, 255, 255)); // This will catch our interactions ImGui.invisibleButton("canvas", canvasSize.x, canvasSize.y, @@ -112,27 +112,27 @@ public static void show(final ImBoolean showCanvaWindow) { float GRID_STEP = 64.0f; for (float x = fmodf(scrolling.x, GRID_STEP); x < canvasSize.x; x += GRID_STEP) { drawList.addLine(canvasP0.x + x, canvasP0.y, canvasP0.x + x, canvasP1.y, - ImColor.intToColor(200, 200, 200, 40)); + ImColor.rgba(200, 200, 200, 40)); } for (float y = fmodf(scrolling.y, GRID_STEP); y < canvasSize.y; y += GRID_STEP) { drawList.addLine(canvasP0.x, canvasP0.y + y, canvasP1.x, canvasP0.y + y, - ImColor.intToColor(200, 200, 200, 40)); + ImColor.rgba(200, 200, 200, 40)); } for (int n = 0; n < pointList.size(); n += 2) { drawList.addLine(origin.x + pointList.get(n).x, origin.y + pointList.get(n).y, origin.x + pointList.get(n + 1).x, origin.y + pointList.get(n + 1).y, - ImColor.intToColor(255, 255, 0, 255), thickness); + ImColor.rgba(255, 255, 0, 255), thickness); } drawList.popClipRect(); // Menu properties if (ImGui.beginPopup("context")) { addingLine = false; - if (ImGui.menuItem("Remove one", "", false, pointList.size() > 0)) { + if (ImGui.menuItem("Remove one", "", false, !pointList.isEmpty())) { pointList.remove(pointList.size() - 1); pointList.remove(pointList.size() - 1); } - if (ImGui.menuItem("Remove all", "", false, pointList.size() > 0)) { + if (ImGui.menuItem("Remove all", "", false, !pointList.isEmpty())) { pointList.clear(); } ImGui.endPopup(); diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 2c352119..a4b76b95 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 0aaefbca..cea7a793 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.10.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/imgui-binding/build.gradle b/imgui-binding/build.gradle index b719fb1b..fdd0f10e 100644 --- a/imgui-binding/build.gradle +++ b/imgui-binding/build.gradle @@ -15,8 +15,9 @@ java { } dependencies { - testImplementation 'org.junit.jupiter:junit-jupiter-api:5.11.3' - testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.11.3' + testImplementation("org.junit.jupiter:junit-jupiter-api:5.11.3") + testImplementation("org.junit.jupiter:junit-jupiter-engine:5.11.3") + testRuntimeOnly("org.junit.platform:junit-platform-launcher") } test { @@ -53,7 +54,7 @@ jar { processResources { filesMatching('**/imgui-java.properties') { filter(ReplaceTokens, tokens: [ - 'version': project.version + 'version': version ]) } }