@@ -46,8 +46,26 @@ dependencies {
46
46
}
47
47
48
48
task cmakeTask (type : Exec ) {
49
- File jniLibs = new File (buildDir. path + " /tiledb_jni" )
50
- File tiledbLibs = new File (buildDir. path + " /install/lib" )
49
+ def osName = System . getProperty(' os.name' ). toLowerCase()
50
+ def arch = System . getProperty(' os.arch' ). toLowerCase()
51
+
52
+ println " arch: "
53
+ println arch;
54
+ println osName;
55
+
56
+ File jniLibs;
57
+ File tiledbLibs;
58
+
59
+ if (osName. contains(" mac" ) && arch. equals(" aarch64" )) {
60
+ println " mac arm building2" ;
61
+ jniLibs = new File (buildDir. path + " /tiledb_jni/arm" )
62
+ tiledbLibs = new File (buildDir. path + " /install/lib/arm" )
63
+ }else {
64
+ println " building2" ;
65
+
66
+ jniLibs = new File (buildDir. path + " /tiledb_jni" )
67
+ tiledbLibs = new File (buildDir. path + " /install/lib" )
68
+ }
51
69
52
70
onlyIf { ! buildDir. exists() || ! jniLibs. exists() || ! tiledbLibs. exists() }
53
71
doFirst {
@@ -83,8 +101,26 @@ task cmakeTask(type: Exec) {
83
101
}
84
102
85
103
task cmakeBuildTask (type : Exec ) {
86
- File jniLibs = new File (buildDir. path + " /tiledb_jni" )
87
- File tiledbLibs = new File (buildDir. path + " /install/lib" )
104
+ def osName = System . getProperty(' os.name' ). toLowerCase()
105
+ def arch = System . getProperty(' os.arch' ). toLowerCase()
106
+
107
+ println " arch: "
108
+ println arch;
109
+ println osName;
110
+
111
+ File jniLibs;
112
+ File tiledbLibs;
113
+
114
+ if (osName. contains(" mac" ) && arch. equals(" aarch64" )) {
115
+ println " mac arm building" ;
116
+ jniLibs = new File (buildDir. path + " /tiledb_jni/arm" )
117
+ tiledbLibs = new File (buildDir. path + " /install/lib/arm" )
118
+ }else {
119
+ println " building" ;
120
+
121
+ jniLibs = new File (buildDir. path + " /tiledb_jni" )
122
+ tiledbLibs = new File (buildDir. path + " /install/lib" )
123
+ }
88
124
89
125
onlyIf { ! buildDir. exists() || ! jniLibs. exists() || ! tiledbLibs. exists() }
90
126
doFirst {
@@ -116,7 +152,7 @@ test {
116
152
if (Os . isFamily(Os . FAMILY_WINDOWS )) {
117
153
systemProperty " java.library.path" , " $buildDir \\ install\\ bin;$buildDir \\ tiledb_jni\\ Release"
118
154
} else {
119
- systemProperty " java.library.path" , " $buildDir /install/lib:$buildDir /install/lib64:$buildDir /tiledb_jni"
155
+ systemProperty " java.library.path" , " $buildDir /install/lib:$buildDir /install/lib64:$buildDir /tiledb_jni: $b uildDir /install/lib/arm "
120
156
}
121
157
122
158
testLogging {
@@ -125,12 +161,19 @@ test {
125
161
}
126
162
127
163
jar {
164
+ // macOS arm
165
+ into(new File (' lib/arm' ). toString()) {
166
+ from file(" $buildDir /install/lib/arm/libtiledb.dylib" )
167
+ from file(" $buildDir /tiledb_jni/arm/libtiledbjni.dylib" )
168
+ }
169
+
128
170
into(new File (' lib' ). toString()) {
129
- // Linux and macOS
171
+ // Linux
130
172
from file(" $buildDir /install/lib/libtiledb.so" )
131
173
from file(" $buildDir /install/lib64/libtiledb.so" )
132
174
from file(" $buildDir /tiledb_jni/libtiledbjni.so" )
133
175
176
+ // macOS intel
134
177
from file(" $buildDir /install/lib/libtiledb.dylib" )
135
178
from file(" $buildDir /install/lib64/libtiledb.dylib" )
136
179
from file(" $buildDir /tiledb_jni/libtiledbjni.dylib" )
@@ -141,6 +184,7 @@ jar {
141
184
from file(" $buildDir /tiledb_jni/Release/tiledbjni.dll" )
142
185
}
143
186
187
+
144
188
manifest {
145
189
attributes(" Implementation-Title" : " Gradle" ,
146
190
" Implementation-Version" : archiveVersion)
0 commit comments