Skip to content

Commit d33d776

Browse files
committed
Test fix
1 parent 798a9a6 commit d33d776

File tree

5 files changed

+12
-8
lines changed

5 files changed

+12
-8
lines changed

.github/workflows/gradle.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ jobs:
3333
sudo apt install gcc-12
3434
- name: Get libcurl for tests
3535
run: |
36-
cd annotation-processor-test/src/test/resources/libcurl && git clone https://github.com/curl/curl.git
36+
cd annotation-processor-test/src/test/resources/libcurl && git clone --depth 1 https://github.com/curl/curl.git
37+
- name: Get libvlc for tests
38+
run: |
39+
cd annotation-processor-test/src/test/resources/libvlc && git clone --depth 1 https://github.com/videolan/vlc.git
3740
- name: Getting linux header version for tests
3841
run: |
3942
echo "headerVersion=$(uname -r)" >> "$GITHUB_ENV"

annotation-processor-test/src/test/java/io/github/digitalsmile/gpio/libvlc/LibVLC.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,10 @@
1313
import io.github.digitalsmile.gpio.libvlc.opaque.LibvlcMediaT;
1414
import io.github.digitalsmile.gpio.libvlc.structs.LibvlcModuleDescriptionT;
1515

16-
@NativeMemory(headers = "/home/ds/vlc/include/vlc/vlc.h")
16+
@NativeMemory(headers = "libvlc/vlc/include/vlc/vlc.h")
1717
@NativeMemoryOptions(
18-
includes = "/home/ds/vlc/include",
19-
systemIncludes = "/usr/lib/llvm-15/lib/clang/15.0.7/include/",
20-
debugMode = true)
18+
includes = "libvlc/vlc/include",
19+
systemIncludes = "/usr/lib/gcc/x86_64-linux-gnu/12/include/")
2120
@Structs
2221
@Enums
2322
@Unions

annotation-processor-test/src/test/java/io/github/digitalsmile/gpio/types/all/GPIOTypesAll.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import io.github.digitalsmile.annotation.structure.Structs;
77
import io.github.digitalsmile.annotation.structure.Unions;
88

9-
@NativeMemory(headers = "/usr/src/linux-headers-6.2.0-39/include/uapi/linux/gpio.h")
9+
@NativeMemory(headers = "/usr/src/linux-headers-{version}/include/uapi/linux/gpio.h")
1010
@NativeMemoryOptions(
1111
processRootConstants = true
1212
)
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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ private List<NativeMemoryNode> processHeaderFiles(Element element, String[] head
127127
List<String> systemIncludes = Collections.emptyList();
128128
if (options != null) {
129129
rootConstants = options.processRootConstants();
130-
includes = Arrays.stream(options.includes()).map(p -> "-I" + p).toList();
130+
includes = getHeaderPaths(options.includes()).stream().map(p -> "-I" + p.toFile().getAbsolutePath()).toList();
131131
systemIncludes = Arrays.stream(options.systemIncludes()).map(p -> "-isystem" + p).toList();
132132
debug = options.debugMode();
133133
}
@@ -306,7 +306,7 @@ private OriginalType getBoundsOriginalType(ExecutableElement functionElement) {
306306

307307
private FileObject tmpFile;
308308

309-
private List<Path> getHeaderPaths(String[] headerFiles) {
309+
private List<Path> getHeaderPaths(String... headerFiles) {
310310
List<Path> paths = new ArrayList<>();
311311
for (String headerFile : headerFiles) {
312312
var beginVariable = headerFile.indexOf("${");

0 commit comments

Comments
 (0)