使用以下语法在线找到使用MSBuild在解决方案中构建Visual Studio 2008项目的方法:
public class ChatFragment extends Fragment {
//ChatBroadCastReceiver mReceiver;
private EditText et_chat;
Bundle mailData;
String caller_mail;
private ListView chatListview;
private ChatWindowAdapter chatWindowAdapter;
private List<ChatSession>PreviousChatSession;
private List<ChatInfo> chatListItems;
Button chat_send;
public ChatFragment() {
}
public BroadcastReceiver mReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
Log.i("chat","I am in BroadCastReceiver");
String msg = intent.getStringExtra("msg");
Toast.makeText(getActivity(),msg,Toast.LENGTH_LONG).show();
}
};
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mReceiver = new ChatBroadCastReceiver();
//getActivity().registerReceiver(new ChatBroadCastReceiver(),new IntentFilter("chatupdater"));
LocalBroadcastManager.getInstance(getActivity()).registerReceiver(new ChatBroadCastReceiver(),new IntentFilter("chatupdater"));
Log.i("chat", "I am in onCreate");
}
但是我的项目名称包含空格,所以我尝试过:
msbuild Solution.sln /t:"ProjectName:Rebuild"
这绝对与报价有关。要么将Rebuild作为项目名称的一部分而失败,要么抱怨语法,要么将Rebuild分离出来,它会将整个解决方案重建为一个单独的目标。如果我只是从命令中删除重建目标,它可以正常工作。
msbuild Solution.sln /t:"Project Two:Rebuild"
msbuild Solution.sln /t:"Project Two":Rebuild
msbuild Solution.sln /t:""Project Two":Rebuild"
msbuild Solution.sln /t:"Project Two" /t:Rebuild
但这意味着我无法在我的脚本中选择Build或Rebuild,我必须使用默认值。
有办法吗?
由于