Giter Site home page Giter Site logo

Comments (5)

prokod avatar prokod commented on May 30, 2024

Hi,

I am not sure I follow you on that one. api is not used as means to influence the scope on pom file. It is there to help library developers to declare that those dependencies that are marked as api should be transitively added to classpath through all the dependency tree consuming the relevant developed lib as the user interface of that lib uses types from that api marked dependency/ies.
I hope this is clear enough.

If you can clarify what exactly you are trying to achieve (maybe adding some sample project) I can maybe try and give you better guidance.

Any how in general I do plan to add this. Even sooner then later if it will get up voted :)

Cheers

from gradle-crossbuild-scala.

Arthurm1 avatar Arthurm1 commented on May 30, 2024

Hi

Is it still on the cards to add this? It would be handy if it was 😃

Currently if you use implementation to declare the Scala library dependency...

dependencies {
    implementation ("org.scala-lang:scala-library:2.13.3")
}

Gradle gives an error on compile because it can't find the scala-library version...

A problem occurred configuring project ':Foo'.
> assert possibleDefaultScalaVersions.size() > 0
         |                            |      |
         []                           0      false

  Could not discover default scala version. Scala library dependency is missing ?

It works fine if the Scala library is declared using compile...

dependencies {
    compile ("org.scala-lang:scala-library:2.13.3")
}

Also, for the dependencies that include ? Gradle can't resolve api dependencies...

  ./gradlew clean Foo:dependencies

gives...

compileClasspath - Compile classpath for source set 'main'.
+--- com.typesafe.scala-logging:scala-logging_?:3.9.2 FAILED

when the dependency is declared with api like...

api("com.typesafe.scala-logging:scala-logging_?:3.9.2")

but works when the dependency is declared using compile...

compile("com.typesafe.scala-logging:scala-logging_?:3.9.2")

then no error...

compileClasspath - Compile classpath for source set 'main'.
\--- com.typesafe.scala-logging:scala-logging_2.13:3.9.2

from gradle-crossbuild-scala.

prokod avatar prokod commented on May 30, 2024

Hi @Arthurm1 :)
I would like first to point out that from version 0.12 onwards you do not need use ? for scala 3rd party libs. You can choose one scala version which is naturally the default scala version of your project and the replacement of the scala version while you cross building is done anyhow.

I will try and clear some time to evaluate the work needed. Keep tuned ;)

from gradle-crossbuild-scala.

loicdescotte avatar loicdescotte commented on May 30, 2024

Hi,

api [...] is there to help library developers to declare that those dependencies that are marked as api should be transitively added to classpath through all the dependency tree

I think that is something very useful for lib developpers, as it avoids lib users to add all the transitive dependencies (and to know what lib they need to add).

It would be great to have this feature compatibility for cross building scala libs :)

from gradle-crossbuild-scala.

prokod avatar prokod commented on May 30, 2024

Reclosing after adding correct fix milestone

from gradle-crossbuild-scala.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.