+ All Categories
Home > Technology > Ceylon module repositories by Aleš Justin

Ceylon module repositories by Aleš Justin

Date post: 28-May-2015
Category:
Upload: unfromage
View: 9,811 times
Download: 2 times
Share this document with a friend
Description:
Discover how Ceylon modules are implemented.
Popular Tags:
12
Module repositories Aleš Justin, Red Hat
Transcript
Page 1: Ceylon module repositories by Aleš Justin

Module repositoriesAleš Justin, Red Hat

Page 2: Ceylon module repositories by Aleš Justin

Modules?• History • Java SDK monolith

• JSR-277, JSR-294, …

• OSGi !

• Should be part of the language! • Well, you cannot ignore legacy

• A ton of cool Java libs, … !

• It’s all about modules in Ceylon! • (at least that’s what Stéphane tells me ;-)

Page 3: Ceylon module repositories by Aleš Justin

Compiling the app?

• Something needs to know how to *find* dependent modules • Typechecker “talks” to Ceylon Module Repository (CMR)

!

• Once an app module is compiled, it goes into local module repo → *ready* to be used by other modules !

• But how do we share it “globally”?

Page 4: Ceylon module repositories by Aleš Justin

Running the app?

• Directly — MyApp::main(String… args) ? • BOOM!! … as nobody knows how to *load* dependent modules

!

• Custom “Runtime” • JBoss Modules based (WildFly AS proven; p2p classloading)

• “Talks” to CMR to lookup modules

• Lazy initialisation; build minimal transient closure of dependency info

Page 5: Ceylon module repositories by Aleš Justin

More module lookups

• IDE • Sources, module list view and compiling

• JavaScript backend • Lookup .js files

Page 6: Ceylon module repositories by Aleš Justin

Module lookup• <name,version> → module or <null> • No range lookup

• Set of repositories • Local

• Remote

• Type of repository • File system

• Maven

• WebDav

• Herd

• Remote → Local • Transferring module’ bytecode bits and *dependency info*

Page 7: Ceylon module repositories by Aleš Justin

Dependency info

• Native • import org.acme.poke “1.0”

• Maven • From pom.xml / via Aether

• JBoss Modules • module.xml

• Custom jar • module.properties

• OSGi (wip)

Page 8: Ceylon module repositories by Aleš Justin

Maven trouble?

• Some Maven pom.xml files are “invalid” • Transitive dependencies / flat classpath • 2nd level dep used directly

!

• Fix? • Current workaround = overrides.xml • Add

• Remove

• Replace

• Any better idea?

Page 9: Ceylon module repositories by Aleš Justin

Repositories configuration

• Default • Distrib, Project, User, Cache, Herd, …

• Add your own • —rep <repo config>

• Customise things in .ceylon/config

Page 10: Ceylon module repositories by Aleš Justin

Module sharing?

• Herd (http://modules.ceylon-lang.org/) • Upload your modules • Upload permission

• Dependency pre-check

• Integrity validation check

• Set-up your own Herd

!

• Query for modules • If supported by repository type

Page 11: Ceylon module repositories by Aleš Justin

Misc

• CMR, Runtime, Typechecker, … are also all modules • Can be used in the app; but not encouraged

• Language and JDK are added by default • Yes, even JDK is a module (actually multiple modules)

• Logging module(s) have special treatment • So all logs end-up at the same place — JBoss LogManager

• CMR is pluggable — RepositoryBuilder • Impl your own Repository

Page 12: Ceylon module repositories by Aleš Justin

Thanks! !

[email protected] Q&A anytime


Recommended