From 03e8c0189d17953b919c9f1da0b50e4ea4ed3cff Mon Sep 17 00:00:00 2001 From: kaklakariada Date: Sat, 21 Sep 2024 09:45:17 +0200 Subject: [PATCH] Fix build --- .vscode/launch.json | 16 ---------------- .vscode/settings.json | 4 ++-- build.gradle | 7 +++++-- src/main/java/org/itsallcode/jlua/Test.java | 9 --------- 4 files changed, 7 insertions(+), 29 deletions(-) delete mode 100644 .vscode/launch.json delete mode 100644 src/main/java/org/itsallcode/jlua/Test.java diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index fe81592..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "version": "0.2.0", - "configurations": [ - { - "type": "java", - "name": "Test", - "request": "launch", - "mainClass": "org.itsallcode.jlua.Test", - "projectName": "jlua", - "env": { - "LD_LIBRARY_PATH": "${workspaceFolder}/build/lua-install/lib/" - }, - "vmArgs": "--enable-preview --enable-native-access=ALL-UNNAMED -Djextract.trace.downcalls=true" - } - ] -} diff --git a/.vscode/settings.json b/.vscode/settings.json index 5511537..3994e27 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -17,8 +17,8 @@ "--enable-native-access=ALL-UNNAMED" ], "env": { - "LD_LIBRARY_PATH": "${workspaceFolder}/build/lua-install/lib/", - "DYLD_LIBRARY_PATH": "${workspaceFolder}/build/lua-install/lib/" + "LD_LIBRARY_PATH": "${workspaceFolder}/build/lua-libs/", + "DYLD_LIBRARY_PATH": "${workspaceFolder}/build/lua-libs/" } }, "files.exclude": { diff --git a/build.gradle b/build.gradle index 00b977d..1f3dd42 100644 --- a/build.gradle +++ b/build.gradle @@ -27,8 +27,8 @@ testing { testTask.configure { systemProperty 'java.util.logging.config.file', 'src/test/resources/logging.properties' systemProperty 'jextract.trace.downcalls', 'true' - environment "LD_LIBRARY_PATH", "${project.buildDir}/lua-install/lib/" - environment "DYLD_LIBRARY_PATH", "${project.buildDir}/lua-install/lib/" + environment "LD_LIBRARY_PATH", "${project.buildDir}/lua-libs/" + environment "DYLD_LIBRARY_PATH", "${project.buildDir}/lua-libs/" jvmArgs '--enable-native-access=ALL-UNNAMED' } } @@ -91,6 +91,9 @@ task buildLua(type: Exec) { } } +tasks.test.dependsOn(tasks.buildLua) +tasks.build.dependsOn(tasks.buildLua) + task cleanLua(type: Exec) { workingDir "${projectDir}/lua/src" commandLine 'make', 'clean' diff --git a/src/main/java/org/itsallcode/jlua/Test.java b/src/main/java/org/itsallcode/jlua/Test.java deleted file mode 100644 index e9b4fc0..0000000 --- a/src/main/java/org/itsallcode/jlua/Test.java +++ /dev/null @@ -1,9 +0,0 @@ -package org.itsallcode.jlua; - -public class Test { - public static void main(final String[] args) { - try (LuaInterpreter lua = LuaInterpreter.create()) { - lua.exec("print('hello world')"); - } - } -}