Skip to content

Commit

Permalink
chore(build): update to Gradle 8.12 and set CI to use JDK 17
Browse files Browse the repository at this point in the history
Upgraded the build system to Gradle 8.12 and updated the CI pipeline to use JDK 17 for improved compatibility and performance.
  • Loading branch information
SpaiR committed Dec 27, 2024
1 parent 9a77b8d commit 19a2c77
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 18 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
11 changes: 7 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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} "
)
}
}
Expand Down
14 changes: 7 additions & 7 deletions example/src/main/java/ExampleCanvasEditor.java
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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();
Expand Down
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.10.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
7 changes: 4 additions & 3 deletions imgui-binding/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -53,7 +54,7 @@ jar {
processResources {
filesMatching('**/imgui-java.properties') {
filter(ReplaceTokens, tokens: [
'version': project.version
'version': version
])
}
}

0 comments on commit 19a2c77

Please sign in to comment.