Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-user] Tycho and Kotlin

Hi,
AFAIK dependencies injected from Tycho are in SYSTEM resolution scope. Some non-OSGI maven plugins instead only consider COMPILE scope and therefore do not pick dependencies.

The scope of the Kotlin compiler plugin is COMPILE:

@Mojo(name = "compile", defaultPhase = LifecyclePhase.COMPILE, requiresDependencyResolution = ResolutionScope.COMPILE
 (https://github.com/JetBrains/kotlin/blob/master/libraries/tools/kotlin-maven-plugin/src/main/java/org/jetbrains/kotlin/maven/K2JVMCompileMojo.java).

Is MavenProject.getCompileClasspathElements() delivering a different result than project.getDependencies() when resolving dependencies and therefore picks up these SYSTEM dependencies?


Kind regards
Henrik


Am 23.05.2017 um 09:35 schrieb Sievers, Jan:
However - for our projects whose dependencies are MANIFEST-based and rely on Tycho/OSGi for dependency resolution/target platform 
computation, I'm wondering if we've hit a roadblock - as Kotlin needs to compile the Java bytecode prior to the other (Tycho/Maven)
compilers kicking in, but if any of those Kotlin classes depend on the OSGi dependencies, our concern is that it won't be able to resolve 
them - so it's a bit of a chicken/egg problem.
Tycho injects the resolved OSGi dependencies back into the maven project model so other (non-OSGi aware) maven plugins have access to the OSGi compile classpath. I know that e.g. the PMD and sonar plugins rely on this when run on a Tycho project.
So in principle it should be possible to run another compiler as long as it's getting its compilation classpath from
maven's standard project model 

MavenProject.getCompileClasspathElements()

You could bind this compiler to a phase prior to compile to make sure it runs before tycho-compiler-plugin.
Note that I don't know anything about kotlin so I may be completely wrong.

Regards,
Jan





_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user


-- 
Entimo AG
Stralauer Platz 33 - 34 | 10243 Berlin | Germany
Tel: +49.30.52 00 24 133 | Fax: +49.30.52 00 24 101
hst@xxxxxxxxxx | http://www.entimo.com/

Vorstand: Jürgen Spieler (Vors.), Marianne Neumann
Aufsichtratsvorsitzender: Erika Tannenbaum

Sitz der Gesellschaft: Berlin, Germany | Handelsregister: HRB Berlin-Charlottenburg 85073

Back to the top