简体   繁体   English

什么``=`在SBT中意味着什么?

[英]What does `<<=` mean in SBT?

I see this <<= symbol in lot of SBT code, but I don't what it does. 我在很多SBT代码中看到了这个<<=符号,但我不知道它的作用。

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? 能否请您指出一些文档或一个清楚解释这个符号含义的例子以及它的作用?

Further to pfn's comment , this is described in the 0.12 docs under More Kinds of Settings . pfn的评论之后 ,这将在更多种类设置下的0.12文档中进行描述。 I guess it was dropped from the 0.13 docs because the same behaviour can now be defined in terms of := . 我想这是从0.13文档中删除的,因为现在可以用以下方式定义相同的行为:=

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: 在处理AspectJ编译时我已经使用过这种运算符:

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. 基本上,它意味着:将代码源基于AspectJ源文件(使用插件生成),而不是经典的。

I interpret it as a kind of "replaceAll/erase": 我把它解释为一种“replaceAll / erase”:
Replace bunch of files to compile by the files involving AspectJ annotations. 替换一堆文件以通过涉及AspectJ注释的文件进行编译。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM