假设我正在处理一个makefile,我在顶部有以下变量声明:
FILES = file1.cpp file2.cpp file3.cpp
Run Code Online (Sandbox Code Playgroud)
现在假设我想用特殊命令编译每一个而不指定每个目标,如下所示:
file1.o : file1.cpp
custom_command file1.cpp
file2.o : file2.cpp
custom_command file2.cpp
file3.o : file3.cpp
custom_command file3.cpp
Run Code Online (Sandbox Code Playgroud)
有没有更好的方法来使用$(FILES)我上面声明的变量?
就像是:
$(FILES:.cpp=.o) : $(FILES)
custom_command $(FILES)
Run Code Online (Sandbox Code Playgroud)
...只需要为$(FILES)变量中的每个文件执行此操作.
我有一个使用父ant文件的项目
与此类似:
<project name="some-portlet" basedir="." default="deploy">
<import file="../build-common-portlet.xml" />
<target name="test">
<echo message="do foo"/>
RUN TEST FROM PARENT HERE
</target>
</project>
Run Code Online (Sandbox Code Playgroud)
现在我想以这种方式覆盖父测试目标:
第一部分没问题,但我没有看到从父文件调用测试的方法
我希望目标也被命名为test,这样CI就可以简单地运行测试目标.
有没有办法在../build-common-portlet.xml中调用test?
是否可以为目标指定不同的名称或别名,以便可以使用原始目标名称或别名来调用它.
比如像
/very/long/path/my_binary: dep_a dep_b dep_c
# Compile
# Desired command
ALIAS my_binary = /very/long/path/my_binary
# NOTE: Notice the use of 'my_binary' in the dependencies
data1: my_binary datafile
# Build data file using compiled my_binary
Run Code Online (Sandbox Code Playgroud)
我尝试过使用.PHONY目标:
.PHONY: my_binary
my_binary: /very/long/path/my_binary
Run Code Online (Sandbox Code Playgroud)
从命令行调用时,这很有用:
# Runs rule 'my_binary' and then *only* runs rule '/very/long/path/my_binary'
# if the rule '/very/long/path/my_binary' needs updating.
make my_binary
Run Code Online (Sandbox Code Playgroud)
但是,当别名my_binary列为依赖项时,这不起作用:
# *Always* thinks that rule 'data1' needs updating, because it always thinks that …Run Code Online (Sandbox Code Playgroud) 我正在使用Makefiles.
但是,在执行任何目标之前,我需要执行一个命令(zsh脚本).我该怎么做呢?
谢谢!
我的一台开发机器遇到了一个相当令人不安的问题,我希望有人可以告诉我.
我有一个大型的Visual Studio 2010 VB解决方案,针对.NET Framework 4.0打开,可以在许多Visual Studio 2010安装中找到 - 除了一个.打开解决方案时出现"错误"(更多消息):
未安装项目目标框架
VB项目的目标是".NETFramework,Version = v4.0",它没有安装在这台机器上.你必须下载这个框架才能打开并构建这个项目.为了继续,你必须在下面选择一个选项.
这是一个完整上下文的截图:
http://img507.imageshack.us/i/errorlc.jpg/
我试过了:
在步骤2之后再次重试步骤1(未修复).
暂时使用的是.NET Framework清除工具,以便从计算机(包括注册表)中删除.NET Framework 4.0的所有痕迹,然后再次安装.NET Framework 4.0.但是错误已经恢复.
我不确定这是一个.NET Framework 4.0文件损坏的问题,在Visual Studio中是什么,或者只是Visual Studio找不到.NET Framework 4.0.(我找到了几个可能的'解释',但没有解决这个问题.
机器正在运行Windows 7(64位).
任何解决这个问题的想法都会受到热烈欢迎!
我有一个图像,当点击,我想链接到mailto:
<a id="mailto" href="mailto:hfms@live.com.my" target="_newtab" >
<img src="@Url.Content("~/Content/HomePage/email.png")" alt="email" /></a>
Run Code Online (Sandbox Code Playgroud)
但是,当前单击它后,它将启动电子邮件选项以选择mailto应用程序,一旦我选择,mailto链接将在当前选项卡中打开.这将导致用户离开应用程序.
所以,我希望页面发送电子邮件(通过gmail,yahoo等)在新标签页或窗口中打开.知道怎么做吗?我尝试了target ="_ newtab"和target ="_ blank",但两者都没有用.
任何帮助将不胜感激..谢谢......
(如果没有其他方法,jQuery方法也可以接受,谢谢)
我正在尝试使用 mapstruct 1.2.0.CR2 映射嵌套属性。(示例将customer.address.houseNumber映射到 userDTO.homeDTO.addressDTO.houseNo)。
期望:当 customer.address 为 null 时,我不想将 addressDTO 设置为 null。由于 addressDTO 包含“countyname”和其他已从其他不同源设置的属性。
请告知我是否可以设置某些属性/设置,以便当源为空时目标不会设置为空。
@Mapper( nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS )
public interface CustomerUserMapperNullCheck {
@Mapping(source="address", target="homeDTO.addressDTO" )
void mapCustomer(Customer customer, @MappingTarget UserDTO userDTO) ;
@Mapping(source="houseNumber", target="houseNo" )
void mapCustomerHouse(Address address, @MappingTarget AddressDTO addrDTO) ;
}
Run Code Online (Sandbox Code Playgroud)
我最初尝试像下面这样的单一映射
@Mapping(target="homeDTO.addressDTO.houseNo", source="address.houseNumber")
abstract void mapCustomerHouse(Customer customer, @MappingTarget UserDTO userDTO) ;
Run Code Online (Sandbox Code Playgroud)
然后尝试基于https://github.com/mapstruct/mapstruct/issues/649拆分映射。
两种方法都不会产生预期的结果/生成的方法代码
protected void customerToHomeDTO(Customer customer, HomeDTO mappingTarget) {
if ( customer == null ) {
return;
} …Run Code Online (Sandbox Code Playgroud) 请帮忙.
为什么jquery addClass()不能使用event.target?我已经制作了一个代码,并且它应该在单击时在目标上添加类,但它不起作用,并且它说,e.target.addClass它不是一个函数.
码:
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Class Test</title>
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<style>
.big {
font-size: 5em;
}
.small {
font-size: 1em;
}
</style>
</head>
<body>
<p>This is the text</p>
<script>
$(function() {
$("p").click(function(e) {
$("a").removeClass("big").addClass("small");
$("this").addClass("big"); //This doesn't work
e.target.addClass("big"); //nor this one
});
});
</script>
</body>
</html>
Run Code Online (Sandbox Code Playgroud) 在我的Xcode项目中,我有4种不同的方案(prod,dev,staging,staging2),它们会更改安装到手机的应用程序的软件包标识符.这样我可以并排安装所有4个版本,类似于这种技术.
现在我正在为iOS 8构建Today Extension.这是一个需要自己的bundle标识符的新Target.
Extension的Bundle Identifier必须以Parent App的Bundle Identifier为前缀,否则会抛出警告:
error: Embedded binary's bundle identifier is not prefixed with the parent app's bundle identifier.
Embedded Binary Bundle Identifier: com.company.app.TodayExtension
Parent App Bundle Identifier: com.company.app.staging
Run Code Online (Sandbox Code Playgroud)
在这种情况下,嵌入式二进制包标识符必须是com.company.app.staging.TodayExtension.
有没有办法我可以通过首先查看父目标的包标识符来配置我的今日扩展目标来设置其包标识符?也许通过自定义的运行脚本构建阶段?