Skip to content

Commit 79ba946

Browse files
committed
Test fix
1 parent 5e414cd commit 79ba946

File tree

4 files changed

+16
-3
lines changed

4 files changed

+16
-3
lines changed

.github/workflows/gradle.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ jobs:
2828
with:
2929
java-version: '22'
3030
distribution: 'corretto'
31+
- name: Get GCC 12 for system header files
32+
run: |
33+
sudo apt install gcc-12
34+
- name: Get libcurl for tests
35+
run: |
36+
cd annotation-processor-test/src/test/resources/libclang && git clone https://github.com/curl/curl.git
3137
- name: Getting linux header version for tests
3238
run: |
3339
echo "headerVersion=$(uname -r)" >> "$GITHUB_ENV"

annotation-processor-test/src/test/java/io/github/digitalsmile/gpio/libcurl/Libcurl.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
import io.github.digitalsmile.gpio.libcurl.enums.CURLoption;
1414
import io.github.digitalsmile.gpio.libcurl.opaque.CURL;
1515

16-
@NativeMemory(headers = "/home/ds/curl/include/curl/curl.h")
16+
@NativeMemory(headers = "libcurl/curl/include/curl/curl.h")
1717
@NativeMemoryOptions(systemIncludes = {
18-
"/usr/lib/llvm-15/lib/clang/15.0.7/include/"
19-
})
18+
"/usr/lib/gcc/x86_64-linux-gnu/12/include/"
19+
}, debugMode = true)
2020
@Structs({
2121
@Struct(name = "CURL", javaName = "CurlInstance")
2222
})
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*
2+
!.gitignore

annotation-processor/src/main/java/io/github/digitalsmile/NativeProcessor.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,11 @@ private List<Path> getHeaderPaths(String[] headerFiles) {
343343
var main = rootPath.resolve("src", "main");
344344
var headerFileSplit = headerFile.split(Pattern.quote(File.separator));
345345
headerPath = main.resolve("resources", headerFileSplit);
346+
if (!headerPath.toFile().exists()) {
347+
var test = rootPath.resolve("src", "test");
348+
headerFileSplit = headerFile.split(Pattern.quote(File.separator));
349+
headerPath = test.resolve("resources", headerFileSplit);
350+
}
346351
}
347352
}
348353
paths.add(headerPath);

0 commit comments

Comments
 (0)