This message was deleted.
# community-support
s
This message was deleted.
c
I can’t seem to figure out what ‘model’ is (it doesn’t auto-complete under build.gradle.kts) nor can I figure out what it is
c
model
is perhaps extension of some type, or perhaps something else (Groovy, my old friend…) - perhaps dig through the plugin source to see what it is.
c
I have been and it’s a mess, the gradle src has no example in anything that isn’t groovy
e
c
according to a println in groovy, model is a
Copy code
DefaultProjectStateRegistry$ProjectStateImpl
but not sure if I’ve got that right
t
Note that has been deprecated for some years already (see the top of the page linked by ephemient above), so the IntelliJ doc is outdated.
c
@Thomas Broyer I completely missed that, thanks. 100% will focus on the new plugins instead of the older ones.
Ahh right now I recall why I was looking into alternative ways of specifying c libraries:
Copy code
An exception occurred applying plugin request [id: 'cpp-library']
> Failed to apply plugin 'org.gradle.cpp-library'.
   > Could not create an instance of type org.gradle.language.cpp.internal.DefaultCppLibrary.
      > Could not create an instance of type org.gradle.language.internal.DefaultLibraryDependencies.
         > Cannot add a configuration with name 'implementation' as a configuration with that name already exists.
If you’re creating a jni-jar you’d have to build the native and the jar in separate projects?
c
that will happen when mixing the java and cpp plugins - which is unusual, as a project generally builds one type of things. yes, separate projects is the answer.
c
I’ve had better luck using JNA for some things (where possible / appropriate) rather than JNI.
c
Super in the weeds but in this case I need jni (can’t use panama) for awt/swing interop.
c
gotcha.
Tho the whole goal would be to have access to the HWND (on windows) and then start using opengl/vulkan via panama. Unfortunately there’s no panama support for awt/swing in it’s current form.
👍 1
@ephemient thanks for the link to that plugin, the example documentation seems to work perfectly. Also clion seems to work with gradle well enough, so that part works too
Last bit I’d like to get working is somehow get the native headers generated by the java project copied over (via components/artifacts) to the cpp side
c
First time working with cross-project publications (that aren’t jars) so I’m sure it’s a little rough but it works. Perhaps there’s something redundant in there but the headers seem to resolve.
For shared outputs is it expected for a file to be copied from one project subdir to another project? Or is it fine that it references the files directly? In this case it seems like my one project is reaching into the other projects build-dir.
v
File-wise that's fine
You also don't copy the dependencies into your project but directly use it from the Gradle cache dir