What is the best way to get Ivy classifiers for project dependency?

26 views
Skip to first unread message

Ezh

unread,
Aug 15, 2012, 2:15:13 AM8/15/12
to simple-b...@googlegroups.com
Hi all,

I suspect that there is no one depends their tasks on cross-publish. It is about my previous question. So sad.

I read IvyActions.scala. SBT realy simple, but there isn't much code comments ;-) I got standard update-sbt-classifiers and add to it library-dependencies. Neither original update-sbt-classifiers nor original update-classifiers fetch sources for library-dependencies. This is my way to do it:

myTask = (ivySbt, classifiersModule in updateSbtClassifiers, updateConfiguration,
    ivyScala
, target in LocalRootProject, appConfiguration, alignPath, libraryDependencies, streams) map {
     
(is, origClassifiersModule, c, ivyScala, out, app, path, libDeps, s) =>
        withExcludes
(out, origClassifiersModule.classifiers, lock(app)) { excludes =>
         
import origClassifiersModule.{ id => origClassifiersModuleID, modules => origClassifiersModuleDeps }
         
// do default update-sbt-classifiers with libDeps
          val extClassifiersModuleDeps
= origClassifiersModuleDeps ++ libDeps
          val customConfig
= GetClassifiersConfiguration(origClassifiersModule, excludes, c, ivyScala)
          val customBaseModuleID
= restrictedCopy(origClassifiersModuleID, true).copy(name = origClassifiersModuleID.name + "$" + label)
          val customIvySbtModule
= new is.Module(InlineConfiguration(customBaseModuleID, ModuleInfo(customBaseModuleID.name), extClassifiersModuleDeps).copy(ivyScala = ivyScala))
          val customUpdateReport
= IvyActions.update(customIvySbtModule, c, s.log)
          val newConfig
= customConfig.copy(module = origClassifiersModule.copy(modules = customUpdateReport.allModules))
          val report
= IvyActions.updateClassifiers(is, newConfig, s.log)
         
... now process customUpdateReport
}

Is there more simple way? Google search don't much know about GetClassifiersConfiguration. It would be wonderful to have such simple solution like SBT itself.

Thank you,
Alexey
Reply all
Reply to author
Forward
0 new messages