Skip to content

Commit 7190b51

Browse files
authored
chore(build): update to Gradle 8.12 and set CI to use JDK 17 (#308)
Upgraded the build system to Gradle 8.12 and updated the CI pipeline to use JDK 17 for improved compatibility and performance.
1 parent 9a77b8d commit 7190b51

File tree

6 files changed

+22
-18
lines changed

6 files changed

+22
-18
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
uses: actions/setup-java@v4
2525
with:
2626
distribution: liberica
27-
java-version: 11
27+
java-version: 17
2828

2929
- name: Setup Gradle
3030
uses: gradle/actions/setup-gradle@v4
@@ -71,7 +71,7 @@ jobs:
7171
uses: actions/setup-java@v4
7272
with:
7373
distribution: liberica
74-
java-version: 11
74+
java-version: 17
7575

7676
- name: Setup Gradle
7777
uses: gradle/actions/setup-gradle@v4
@@ -158,7 +158,7 @@ jobs:
158158
uses: actions/setup-java@v4
159159
with:
160160
distribution: liberica
161-
java-version: 11
161+
java-version: 17
162162

163163
- name: Setup Gradle
164164
uses: gradle/actions/setup-gradle@v4

build.gradle

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ ext {
77
}
88

99
allprojects {
10-
group 'imgui-java'
11-
version 'git describe --tags --always'.execute().text.trim().substring(1)
10+
group = 'imgui-java'
11+
version = 'git describe --tags --always'.execute().text.trim().substring(1)
1212

1313
repositories {
1414
mavenCentral()
@@ -21,16 +21,19 @@ allprojects {
2121
into 'META-INF'
2222
}
2323

24+
def jdkMetadata = tasks.withType(JavaCompile).find().javaCompiler.get().metadata
25+
def buildJdk = "${jdkMetadata.javaRuntimeVersion} (${jdkMetadata.vendor})".toString()
26+
2427
manifest {
2528
attributes (
2629
'Implementation-Title': project.name,
2730
'Implementation-Version': project.version,
2831
'Build-Timestamp': new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ").format(System.currentTimeMillis()),
2932
'Build-Revision': 'git rev-parse HEAD'.execute().text.trim(),
30-
'Build-Jdk': "${System.getProperty('java.version')} (${System.getProperty('java.vendor')})",
33+
'Build-Jdk': buildJdk,
3134
'Source-Compatibility': tasks.withType(JavaCompile).find().sourceCompatibility,
3235
'Target-Compatibility': tasks.withType(JavaCompile).find().targetCompatibility,
33-
'Created-By': "Gradle ${gradle.gradleVersion}"
36+
'Created-By': "Gradle ${gradle.gradleVersion} "
3437
)
3538
}
3639
}

example/src/main/java/ExampleCanvasEditor.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ public static void show(final ImBoolean showCanvaWindow) {
6565
ImGuiIO io = ImGui.getIO();
6666
ImDrawList drawList = ImGui.getWindowDrawList();
6767
drawList.addRectFilled(canvasP0.x, canvasP0.y, canvasP1.x, canvasP1.y,
68-
ImColor.intToColor(50, 50, 50, 255));
68+
ImColor.rgba(50, 50, 50, 255));
6969
drawList.addRect(canvasP0.x, canvasP0.y, canvasP1.x, canvasP1.y,
70-
ImColor.intToColor(255, 255, 255, 255));
70+
ImColor.rgba(255, 255, 255, 255));
7171

7272
// This will catch our interactions
7373
ImGui.invisibleButton("canvas", canvasSize.x, canvasSize.y,
@@ -112,27 +112,27 @@ public static void show(final ImBoolean showCanvaWindow) {
112112
float GRID_STEP = 64.0f;
113113
for (float x = fmodf(scrolling.x, GRID_STEP); x < canvasSize.x; x += GRID_STEP) {
114114
drawList.addLine(canvasP0.x + x, canvasP0.y, canvasP0.x + x, canvasP1.y,
115-
ImColor.intToColor(200, 200, 200, 40));
115+
ImColor.rgba(200, 200, 200, 40));
116116
}
117117
for (float y = fmodf(scrolling.y, GRID_STEP); y < canvasSize.y; y += GRID_STEP) {
118118
drawList.addLine(canvasP0.x, canvasP0.y + y, canvasP1.x, canvasP0.y + y,
119-
ImColor.intToColor(200, 200, 200, 40));
119+
ImColor.rgba(200, 200, 200, 40));
120120
}
121121
for (int n = 0; n < pointList.size(); n += 2) {
122122
drawList.addLine(origin.x + pointList.get(n).x, origin.y + pointList.get(n).y,
123123
origin.x + pointList.get(n + 1).x, origin.y + pointList.get(n + 1).y,
124-
ImColor.intToColor(255, 255, 0, 255), thickness);
124+
ImColor.rgba(255, 255, 0, 255), thickness);
125125
}
126126
drawList.popClipRect();
127127

128128
// Menu properties
129129
if (ImGui.beginPopup("context")) {
130130
addingLine = false;
131-
if (ImGui.menuItem("Remove one", "", false, pointList.size() > 0)) {
131+
if (ImGui.menuItem("Remove one", "", false, !pointList.isEmpty())) {
132132
pointList.remove(pointList.size() - 1);
133133
pointList.remove(pointList.size() - 1);
134134
}
135-
if (ImGui.menuItem("Remove all", "", false, pointList.size() > 0)) {
135+
if (ImGui.menuItem("Remove all", "", false, !pointList.isEmpty())) {
136136
pointList.clear();
137137
}
138138
ImGui.endPopup();

gradle/wrapper/gradle-wrapper.jar

79 Bytes
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

imgui-binding/build.gradle

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ java {
1515
}
1616

1717
dependencies {
18-
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.11.3'
19-
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.11.3'
18+
testImplementation("org.junit.jupiter:junit-jupiter-api:5.11.3")
19+
testImplementation("org.junit.jupiter:junit-jupiter-engine:5.11.3")
20+
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
2021
}
2122

2223
test {
@@ -53,7 +54,7 @@ jar {
5354
processResources {
5455
filesMatching('**/imgui-java.properties') {
5556
filter(ReplaceTokens, tokens: [
56-
'version': project.version
57+
'version': version
5758
])
5859
}
5960
}

0 commit comments

Comments
 (0)