克隆git后如何构建MSBuild.exe

时间:2018-06-30 12:21:30

标签: windows git msbuild

我试图在Windows 10中不安装任何Microsoft Visual Studio的情况下获取MSBuild.exe,我发现可以从此处获取MSBuild.exe的git:

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    firstTimeUser();
    ActivityToolbar =  (Toolbar) findViewById(R.id.toolbar);
    ActivitySpinner = (Spinner) findViewById(R.id.spinner);

    ActivityToolbar.setTitle(R.string.app_name);
    ActivityAdapter = ArrayAdapter.createFromResource(this, R.array.languages, R.layout.drop_menu);
    ActivityAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
    ActivitySpinner.getBackground().setColorFilter(getResources().getColor(R.color.white), PorterDuff.Mode.SRC_ATOP);
    ActivitySpinner.setAdapter(ActivityAdapter);

    listeners();

    recyclerView = (RecyclerView) findViewById(R.id.recycler_view);
    recyclerView.setHasFixedSize(true);

    if(this.getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) {
        recyclerView.setLayoutManager(new GridLayoutManager(this, 2));
    } else {
        recyclerView.setLayoutManager(new GridLayoutManager(this, 4));
    }

    categoryAdapter = new CategoryAdapter(this, null);
    recyclerView.setAdapter(categoryAdapter);

    getLoaderManager().initLoader(CATEGORY_LOADER, null, this);
}

public void listeners() {
    ActivitySpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
        @Override
        public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
            categoryAdapter.changeLang(ActivitySpinner.getSelectedItem().toString());
                getLoaderManager().restartLoader(CATEGORY_LOADER, null, MainActivity.this);
        }

        @Override
        public void onNothingSelected(AdapterView<?> parent) {

        }
    });

}

@Override
public Loader<Cursor> onCreateLoader(int id, Bundle args) {


    String[] data = {
                CategoryContract.CategoryEntry._ID,
                CategoryContract.CategoryEntry.COLUMN_IMAGE_PATH,
                CategoryContract.CategoryEntry.COLUMN_CONTENT_EN,
                CategoryContract.CategoryEntry.COLUMN_CONTENT_HI
    };

    return new CursorLoader(
            this,
            CategoryContract.CategoryEntry.CONTENT_URI,
            data,
            null,
            null,
            null
    );
}

@Override
protected void onResume() {
    super.onResume();
    loader_flag = 0;
}

@Override
public void onLoadFinished(Loader<Cursor> loader, Cursor data) {
    categoryAdapter.swapCursor(data);

}

@Override
public void onLoaderReset(Loader<Cursor> loader) {
    categoryAdapter.swapCursor(null);
}

但是克隆分支后,我不知道如何构建MSBuild.exe。存储库中的说明是使用Visual Studio 2017进行构建。但是我读到可以在不安装任何Visual Studio的情况下获取MSBuild.exe。

我真的很陌生,所以关于这个话题也许有人问过类似的问题,但我找不到。任何帮助表示赞赏。

1 个答案:

答案 0 :(得分:1)

不要尝试自己构建MsBuild,这只是您所需工具的一部分。

  

但是我读到可以在不安装任何Visual Studio的情况下获取MSBuild.exe。

是的,您应该安装“ Microsoft Build Tools”。

使用您喜欢的搜索引擎进行查找或查看:

How can I install the VS2017 version of msbuild on a build server without installing the IDE?