Skip to content

Commit 98849bc

Browse files
committed
fixed gradle
1 parent 3f3c289 commit 98849bc

File tree

6 files changed

+20
-15
lines changed

6 files changed

+20
-15
lines changed

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ jobs:
154154
if: ${{ github.event.release.draft || github.event_name == 'workflow_dispatch' }}
155155
uses: actions/upload-artifact@v4
156156
with:
157-
name: java-library
157+
name: julia4j-crossplatform-jar
158158
path: build/libs/*.jar
159159
retention-days: 7
160160

build.gradle

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ publishing {
2828
}
2929
}
3030

31-
// Helper function to get Julia's lib directory
31+
// Helper function to get Julia's lib directory (cross-platform)
3232
def getJuliaLibPath() {
3333
def juliaCmd = [
3434
'julia',
@@ -52,21 +52,26 @@ def getOsName() {
5252
return 'other'
5353
}
5454

55-
test {
55+
tasks.test {
5656
useJUnitPlatform()
5757

58-
def juliaLibPath = getJuliaLibPath()
59-
def osName = getOsName()
58+
testClassesDirs = testing.suites.test.sources.output.classesDirs
59+
classpath = testing.suites.test.sources.runtimeClasspath
6060

61-
if (osName == 'mac') {
62-
def current = System.getenv('DYLD_LIBRARY_PATH')
63-
environment "DYLD_LIBRARY_PATH", juliaLibPath + (current ? ":" + current : "")
64-
} else if (osName == 'linux') {
65-
def current = System.getenv('LD_LIBRARY_PATH')
66-
environment "LD_LIBRARY_PATH", juliaLibPath + (current ? ":" + current : "")
67-
} else if (osName == 'windows') {
68-
def current = System.getenv('PATH') ?: ""
69-
environment "PATH", juliaLibPath + File.pathSeparator + current
61+
doFirst {
62+
def juliaLibPath = getJuliaLibPath()
63+
def osName = getOsName()
64+
65+
if (osName == 'mac') {
66+
def current = System.getenv('DYLD_LIBRARY_PATH')
67+
environment "DYLD_LIBRARY_PATH", juliaLibPath + (current ? ":" + current : "")
68+
} else if (osName == 'linux') {
69+
def current = System.getenv('LD_LIBRARY_PATH')
70+
environment "LD_LIBRARY_PATH", juliaLibPath + (current ? ":" + current : "")
71+
} else if (osName == 'windows') {
72+
def current = System.getenv('PATH') ?: ""
73+
environment "PATH", juliaLibPath + File.pathSeparator + current
74+
}
7075
}
7176
}
7277

src/main/java/org/julia/scripting/JuliaEngine.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
public class JuliaEngine extends AbstractScriptEngine {
1717
static {
1818
try {
19-
NativeUtils.loadLibraryFromJar(NativeUtils.libnameToPlatform("libjulia4j"));
19+
NativeUtils.loadLibraryFromJar(NativeUtils.libnameToPlatform("julia4j"));
2020
} catch (IOException e) {
2121
e.printStackTrace();
2222
}

src/main/resources/native/64/darwin/.gitkeep

Whitespace-only changes.

src/main/resources/native/64/linux/.gitkeep

Whitespace-only changes.

src/main/resources/native/64/windows/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)