`<<=` 在 SBT 中是什么意思? [英] What does `<<=` mean in SBT?

查看:37
本文介绍了`<<=` 在 SBT 中是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在很多 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?

推荐答案

哦,深层次的解释还是挺复杂的.

Oh, the deep explanation is quite complicated.

基本上,签名是:

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

所以它涉及到这个宏:

/* 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)

我在处理 AspectJ 编译时已经使用过这种运算符:

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

products in Compile <<= products in Aspectj

基本上,这意味着:将代码源基于 AspectJ 源文件(使用 插件),而不是经典的.

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

我将其解释为一种replaceAll/erase":
用涉及AspectJ注解的文件替换要编译的一堆文件.

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

这篇关于`&lt;&lt;=` 在 SBT 中是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆