Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does `<<=` mean in SBT?

Tags:

scala

sbt

I see this <<= symbol in lot of SBT code, but I don't what it does.

I tried googling for this symbol as well but I did not get any answers.

Can you please point me to some documentation or an example which clearly explains what does this symbol mean and what does it do?

like image 804
Knows Not Much Avatar asked May 08 '16 21:05

Knows Not Much


1 Answers

Oh, the deep explanation is quite complicated.

Basically, the signature is:

def <<= (app: Initialize[Task[S]]): Setting[Task[S]]  =  macro std.TaskMacro.itaskAssignPosition[S] 

So it involves this macro:

/* Implementations of <<= macro variations for tasks and settings. These just get the source position of the call site.*/

    def itaskAssignPosition[T: c.WeakTypeTag](c: Context)(app: c.Expr[Initialize[Task[T]]]): c.Expr[Setting[Task[T]]] =
        settingAssignPosition(c)(app)

I already used this kind of operator when dealing with AspectJ compilation:

products in Compile <<= products in Aspectj

Basically, it means: base the code source on the AspectJ source files (generated with a plugin), not the classical ones.

I interpret it as a kind of "replaceAll/erase":
Replace bunch of files to compile by the files involving AspectJ annotations.

like image 150
Mik378 Avatar answered Oct 11 '22 13:10

Mik378