File tree Expand file tree Collapse file tree 5 files changed +51
-21
lines changed Expand file tree Collapse file tree 5 files changed +51
-21
lines changed Original file line number Diff line number Diff line change 2727 <plugin >
2828 <groupId >org.bytedeco</groupId >
2929 <artifactId >javacpp</artifactId >
30+ <version >1.4.1</version >
3031 <configuration >
3132 <classPath >${project.build.outputDirectory} </classPath >
3233 <includePaths >
4344 </compilerOptions >
4445 </configuration >
4546 <executions >
47+ <execution >
48+ <id >javacpp.parser</id >
49+ <phase >generate-sources</phase >
50+ <goals >
51+ <goal >build</goal >
52+ </goals >
53+ <configuration >
54+ <skip >false</skip >
55+ <outputDirectory >${project.build.sourceDirectory} </outputDirectory >
56+ <!-- Change to your package name -->
57+ <classOrPackageName >pl.krzysg.MyCppLibConfig.*</classOrPackageName >
58+ </configuration >
59+ </execution >
4660 <execution >
4761 <id >process-classes</id >
4862 <phase >compile</phase >
5165 </goals >
5266 <configuration >
5367 <classOrPackageNames >
54- <classOrPackageName >pl.krzysg.MyCppLib </classOrPackageName >
68+ <classOrPackageName >MyCppTarget </classOrPackageName >
5569 </classOrPackageNames >
5670 </configuration >
5771 </execution >
Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ namespace MyCppLib {
1111 std::cout << " Hello world from CPP!" << std::endl;
1212 }
1313
14+ double xyz = 123 ;
15+
1416 };
1517}
1618
Original file line number Diff line number Diff line change 1- import pl .krzysg .MyCppLib .MyCppClass ;
21
32public class Main {
43
54 public static void main (String [] args ) {
65 System .out .println ("Hello world from Java!" );
7-
8- MyCppClass x = new MyCppClass ();
6+ MyCppTarget .MyCppClass x = new MyCppTarget .MyCppClass ();
97 x .foo ();
8+ System .out .println (x .xyz ());
9+ x .xyz (333 );
10+ System .out .println (x .xyz ());
1011 }
1112
1213}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ package pl .krzysg ;
2+
3+ import org .bytedeco .javacpp .annotation .Namespace ;
4+ import org .bytedeco .javacpp .annotation .Platform ;
5+ import org .bytedeco .javacpp .annotation .Properties ;
6+ import org .bytedeco .javacpp .tools .Info ;
7+ import org .bytedeco .javacpp .tools .InfoMap ;
8+ import org .bytedeco .javacpp .tools .InfoMapper ;
9+
10+ //@Platform(include="MyCppLib.h")
11+ //@Namespace("MyCppLib")
12+ //public class MyCppLib {
13+ // static public class MyCppClass extends Pointer {
14+ // static { Loader.load(); }
15+ // public MyCppClass() { allocate(); }
16+ // private native void allocate();
17+ //
18+ // // to access the member variable directly
19+ // public native void foo();
20+ // }
21+ //}
22+
23+ @ Properties (
24+ value = @ Platform (include ="MyCppLib.h" ), target = "MyCppTarget"
25+ )
26+ public class MyCppLibConfig implements InfoMapper {
27+ public void map (InfoMap infoMap ) {
28+ // infoMap.put(new Info("MyCppClass").pointerTypes("MyCppClass").define());
29+ }
30+ }
You can’t perform that action at this time.
0 commit comments