@@ -46,8 +46,26 @@ dependencies {
4646}
4747
4848task 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/arm/lib" )
63+ }else {
64+ println " building2" ;
65+
66+ jniLibs = new File (buildDir. path + " /tiledb_jni" )
67+ tiledbLibs = new File (buildDir. path + " /install/lib" )
68+ }
5169
5270 onlyIf { ! buildDir. exists() || ! jniLibs. exists() || ! tiledbLibs. exists() }
5371 doFirst {
@@ -83,8 +101,26 @@ task cmakeTask(type: Exec) {
83101}
84102
85103task 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/arm/lib" )
118+ }else {
119+ println " building" ;
120+
121+ jniLibs = new File (buildDir. path + " /tiledb_jni" )
122+ tiledbLibs = new File (buildDir. path + " /install/lib" )
123+ }
88124
89125 onlyIf { ! buildDir. exists() || ! jniLibs. exists() || ! tiledbLibs. exists() }
90126 doFirst {
@@ -116,7 +152,7 @@ test {
116152 if (Os . isFamily(Os . FAMILY_WINDOWS )) {
117153 systemProperty " java.library.path" , " $buildDir \\ install\\ bin;$buildDir \\ tiledb_jni\\ Release"
118154 } 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/arm/lib: $b uildDir /tiledb_jni/arm "
120156 }
121157
122158 testLogging {
@@ -125,12 +161,19 @@ test {
125161}
126162
127163jar {
164+ // macOS arm
165+ into(new File (' arm/lib' ). toString()) {
166+ from file(" $buildDir /install/arm/lib/libtiledb.dylib" )
167+ from file(" $buildDir /tiledb_jni/arm/libtiledbjni.dylib" )
168+ }
169+
128170 into(new File (' lib' ). toString()) {
129- // Linux and macOS
171+ // Linux
130172 from file(" $buildDir /install/lib/libtiledb.so" )
131173 from file(" $buildDir /install/lib64/libtiledb.so" )
132174 from file(" $buildDir /tiledb_jni/libtiledbjni.so" )
133175
176+ // macOS intel
134177 from file(" $buildDir /install/lib/libtiledb.dylib" )
135178 from file(" $buildDir /install/lib64/libtiledb.dylib" )
136179 from file(" $buildDir /tiledb_jni/libtiledbjni.dylib" )
@@ -141,6 +184,7 @@ jar {
141184 from file(" $buildDir /tiledb_jni/Release/tiledbjni.dll" )
142185 }
143186
187+
144188 manifest {
145189 attributes(" Implementation-Title" : " Gradle" ,
146190 " Implementation-Version" : archiveVersion)
0 commit comments