Closed lucono closed 7 years ago
@lucono I don't think this is a bug in the Gradle plugin. The overrides file is not required to add transitive dependencies coming from a Ceylon direct dependency, because Ceylon should be already able to figure out those transitive dependencies (and in the case of com.example.b
, it should see its overrides file, which correctly adds maven-artifact
).
Does it compile in the command line when you add references to classes in maven-artifact
in code of the module com.example.a
? I would bet it will work fine.
@renatoathaydes, no it doesn't compile using Gradle. The transitive dependencies are not picked up through the overrides file of the direct Ceylon dependency.
@lucono So you're saying each overrides file needs to declare every possible transitive dependency, even of Ceylon dependencies? This is unexpected... It's doable, of course, but I can't believe Ceylon is not able to build the dependency tree when all information is already available.
@renatoathaydes From what I can see, that's the behavior. For Ceylon modules that have other Ceylon dependencies which re-export a maven dependency for which an overrides file entry exists to share that maven dependency's own transitive dependencies, the top-level Ceylon module does not seem to have visibility of the transitive maven dependencies declared shared
in those overrides files.
@lucono I had a play with that... I had assumed from what you're saying that Ceylon would normally figure out the transitive Maven dependencies of Ceylon dependencies, but with Gradle, it was not doing that.
For me, even direct transitive dependencies (like depending on a Maven dependency which has transitive dependencies) are not figured out regardless of which options I use (--flat-classpath
, --auto-export-maven-dependencies
etc)... so I can't even try to compile a Ceylon module which depends on another Ceylon module, which in turn has transitive Maven dependencies.
Do you agree with that?
But once I use this plugin to compile a Ceylon module which has a Maven dep with transitive Maven deps (which creates the proper overrides file), I have confirmed that Ceylon won't compile the module which depends on it.
It seems to me the only way to make this work would be to actually parse the overrides.xml file of the Ceylon dependency, then add its dependencies to the first module. But this probably needs to be recursive... but how would I find the overrides files of all dependencies? The dependencies may not be Gradle projects and may not be local projects, in which case I don't know how to get access to the overrides file (or even module.ceylon
, which I could also parse to get the dependencies).
So, I am not too sure there's a simple solution to this issue.
so I can't even try to compile a Ceylon module which depends on another Ceylon module, which in turn has transitive Maven dependencies.
Do you agree with that?
Yes, those are my findings as well.
This looks weird. Does it work if you have no override file? IMO it should just work.
@FroMage That's exactly what I said. Without the overrides file, I can't get anything at all to work.
OK, can you give me a clear example of what your module descriptors look like and the errors you get?
This is impossible to get right and after improvements in Ceylon 1.3.1, it has become unnecessary as Ceylon itself can do something to work around this issue.
In building a ceylon module A that imports another ceylon module B which
shared import
s a maven dependency C, the ceylon gradle plugin fails to include the transitive dependency graph for the maven dependency C which is re-exported by B when building the ceylon overrides.xml file for ceylon module A.Building module
com.example.b
produces an overrides file like the following:However, even though maven dependency
"artifact.group:maven-artifact" "1.0.0"
is re-exported by modulecom.example.b
, building modulecom.example.a
does not generate the<artifact>
entry for"artifact.group:maven-artifact" "1.0.0"
in the overrides.xml file for ceylon modulecom.example.a
.The problematic end result is that ceylon module
com.example.a
does not have visibility of types in the transitive dependency graph of"artifact.group:maven-artifact" "1.0.0"
even though it is re-exported by ceylon modulecom.example.b
which is directly imported bycom.example.a
.