gradle / gradle/gradle-native

Builds can depend on non-Gradle-built libraries

Open
#98 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
No language data
Stars
94
Forks
7
PR merge metrics
No merged PRs in 30d

Description

We need to support a way to declare dependencies on libraries that are not built by Gradle or do not need to be built at all (e.g., checked in binaries). A build author can do something "low level" by adding the appropriate -I or -L arguments as necessary, but this complicates how we would do up-to-date checks and know if it's safe to cache certain compilation tasks.

As a build author, I would like to be able to declare my dependencies on libraries (#165 covers system libraries) like any other Gradle dependency.


In the software model, we have the concept of a prebuilt library, but it has some downsides.

When you're configuring the headers of a prebuilt binary you're actually configuring the headers of the enclosing library, so something like

model {
    repositories {
        libs(PrebuiltLibraries) {
            util {
                binaries.withType(StaticLibraryBinary) {
                    headers.srcDir "3rd-party-lib/util/src/util/headers/$targetPlatform"
                }
            }
        }
    }
}

...looks like you're adding 3rd-party-lib/util/src/util/headers/$targetPlatform as an include path that's different for each target platform, but you're actually adding all platforms (order of include paths depends on the order the binaries are iterated over).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the software model's prebuilt library configuration and the dependency declarations described in the issue. Define how externally built or checked-in libraries should be declared, including target-specific headers and cache or up-to-date behavior; done means the model can represent these dependencies without mixing headers from other platforms.

Written by the indexing model from the issue text.

Assessment

Domain
build-system
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.