New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create tooling API model for native domain #673
Comments
@lacasseio can you add what's needed for the model here? |
"Should we explicitly deny users from passing compiler/linker flags when a strong model exists? Or should we allow both configurations to coexists with a single query method?" There is always a need for an "escape" mode which could used to match situation not supported/planned by the strong model. |
Good question @zosrothko. In general, we avoid providing escape hatch and prefer an use case centric solution. This may block unsupported/unplanned situation, however, we have to keep in mind that in Gradle, everything we allow a user to do needs to have tested and be supported. Escape hatch adds a lot of implicit burdens when it comes to maintenance. In our experience, Gradle is flexible enough that you can workaround most limitation in face of an unplanned situation. The best example is the native samples. They offer possibilities around common cases that aren't in the core of Gradle but are still able to make them work. This issue is centered around the tooling API which allows us to provide a stable API over a less stable model. |
I updated the description to include what information the tooling API model should be looking at providing. |
Could you also expose the information about mapping of source file( The current experimental builder uses |
PR gradle/gradle#6195 adds an initial C++ tooling model plus integration with the new C++ plugins (but not the software model plugins). I think the PR covers most of the stuff listed above. Something this PR does not handle is any custom compiler args attached to compile tasks. For example, the tooling model builder does not handle extracting the @vladsoroka would you mind taking a look at the new model and letting us know whether this will work for you? The model will be included in the Gradle 4.10 release but will be incubating. We can make whatever changes you need for 4.11 and we can look at making the APIs stable. The new model types are here: https://github.com/gradle/gradle/tree/release/subprojects/tooling-api/src/main/java/org/gradle/tooling/model/cpp The tests are exercising it here: https://github.com/gradle/gradle/tree/release/subprojects/tooling-native/src/crossVersionTest/groovy/org/gradle/language/cpp/tooling/r410 |
I've closed this issue. We will add new issues for any changes or fixes we need to do. |
reopening until the CI coverage for the new project has been set up. |
Cool! I'll check the new API asap! |
This is done now. |
@adammurdoch I've tested the new api using the local dev CLion builds and it looks fine to me. Thank you so much! I will update bundled gradle tooling jars for IDEA/CLion 2018.3 nightly builds when the Gradle 4.10 release will be shipped. |
As the native plugins are getting closer to be stable, more are more users will rely on ways to query the native model to extend or use it either through plugins or the tooling API.
Expected Behavior
Users should be able to query all information about the choice Gradle made during configuration without relying on internal API.
Current Behavior
No tooling API model exists for the native domain. Some information is unavailable to query such as the toolchain tool executable name configuration, while others require more processing like includes path as nothing prevent a user from specifying them as compiler flags.
Contract
CppCompile#getIncludes()
,-I
flags, -iquote` flags)CppCompile#getSystemIncludes()
-isystem
flags)-F
)CppCompile#getMacros()
,-D
flags,-U
flags)getParentFile()
of the compiler toolFile
.CppCompile#getSources()
)AbstractLinkTask#getLinkedFile()
orCreateStaticLibrary#getBinaryFile()
)CppBinary#getBaseName()
)CppBinary#getName()
). Note: this name maybe best without the target name from above included in.The text was updated successfully, but these errors were encountered: