Skip to content

Commit

Permalink
Optional aggressive behavior for -vsw-priority, -notamd64 through…
Browse files Browse the repository at this point in the history
… `-force` key.

+'Algorithm of searching' in updated readme
  • Loading branch information
3F committed Dec 20, 2018
1 parent 9cce88b commit 9e8a5bb
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 13 deletions.
42 changes: 33 additions & 9 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,64 @@
# [hMSBuild](https://github.com/3F/hMSBuild)

A lightweight tool (~19 Kb compiled text-based embeddable batch-scripts that does not require powershell and dotnet-cli) - an easy helper for searching of available MSBuild tools. Supports tools from VS2017+ (does not require additional vswhere.exe [[?](https://github.com/Microsoft/vswhere/issues/41)]), VS2015 or less, and other versions from .NET Framework.
Compiled text-based embeddable pure batch-scripts (no powershell or dotnet-cli) for searching of available MSBuild tools. VS2017+ (does not require local vswhere.exe [[?](https://github.com/Microsoft/vswhere/issues/41)]), VS2015, VS2013, VS2010, other versions from .NET Framework. Contains [gnt.core](https://github.com/3F/GetNuTool) for work with NuGet packages and more...


[![Build status](https://ci.appveyor.com/api/projects/status/tusiutft7a0ei109/branch/master?svg=true)](https://ci.appveyor.com/project/3Fs/hmsbuild/branch/master) [![release-src](https://img.shields.io/github/release/3F/hMSBuild.svg)](https://github.com/3F/hMSBuild/releases/latest) [![License](https://img.shields.io/badge/License-MIT-74A5C2.svg)](https://github.com/3F/hMSBuild/blob/master/License.txt)
[![GetNuTool core](https://img.shields.io/badge/GetNuTool-v1.6.1-93C10B.svg)](https://github.com/3F/GetNuTool)

**Download:** [/releases](https://github.com/3F/hMSBuild/releases) [ **[latest](https://github.com/3F/hMSBuild/releases/latest)** ]
* [nightly builds](https://ci.appveyor.com/project/3Fs/hmsbuild/history) (see `/artifacts` page) - *it can be unstable or not work at all. Use this for tests of latest changes.*
**Download:** Latest stable batch-script [ [hMSBuild](https://3F.github.io/hMSBuild/releases/latest/) ]
* [/releases](https://github.com/3F/hMSBuild/releases) [ [latest](https://github.com/3F/hMSBuild/releases/latest) ]
* [nightly builds](https://ci.appveyor.com/project/3Fs/hmsbuild/history) (`/artifacts` page)
But remember: It can be unstable or not work at all. Use this for tests of latest changes.
* Artifacts [older than 6 months](https://www.appveyor.com/docs/packaging-artifacts/#artifacts-retention-policy) you can also find as `Pre-release` with mark `🎲 Nightly build` on [GitHub Releases](https://github.com/3F/hMSBuild/releases) page.


## Why hMSBuild ?

*because you need simple access to msbuild tools and more...*

Based on **GetNuTool core** https://github.com/3F/GetNuTool, and initially it was a more simplified msbuild-helper as part of this tool. But with latest changes from MS we extracted this into new project for more support of all this.
Based on **GetNuTool core** https://github.com/3F/GetNuTool

* Initially, it was part of this tool like a small msbuild-helper. Then, it has been extracted into the new project after major changes from MS for their products. Now we have more support of all this.

Today's [hMSBuild](https://github.com/3F/hMSBuild) provides flexible way to access to msbuild tools for any type of your projects. Just specify what you need in different environments. Look at *#Algorithm of searching* below.

[![{Screencast - hMSBuild in action. Demo via RunIlAsm error}](https://raw.githubusercontent.com/3F/hMSBuild/master/resources/screencast_hMSBuild_in_action.jpg)](https://www.youtube.com/watch?v=zUejJ4vUPGw&t=10)

### Features

**1 batch file and no anything else** for your happy build.
Just a **single batch file** and no more for your happy build.

Combine this with your other available scripts or just type `hMSBuild {arguments to original msbuild}` and have fun.

Combine with your other available scripts or just type `hMSBuild <args to msbuild.exe>` and have fun. Start with `hMSBuild -h`
Start with `hMSBuild -h`

### What supports ?

* Versions from VS2017+
* Full support even if you still have no any [local `vswhere.exe`](https://github.com/Microsoft/vswhere/issues/41) [[?](https://github.com/Microsoft/vswhere/issues/41)]

* Versions from VS2015, VS2013, .NET Framework

* Versions from VS2015, VS2013
* Versions from .NET Framework, including for VS2010

### Algorithm of searching

**v2.0+**

* Versions:
* VS2017+ ➟ VS2015, VS2013, ... ➟ .netfx
* Architectures (configure via `-notamd64` key):
* x64 ➟ x32
* Priorities (configure via `-vsw-priority` and `-stable` keys). *Specific workload components in more priority than pre-release products. See [Issue #8](https://github.com/3F/hMSBuild/issues/8)*

1. Stable releases with selected workload components (C++ etc) ➟ Same via beta releases if allowed.
1. Stable releases with any available components ➟ Same via beta releases if allowed.

## Usage

Usage is same as it would be same for msbuild. But you also have additional keys to access to GetNuTool core and to settings of hMSBuild:
Usage is same as it would be same for msbuild. But you also have an additional keys to configure hMSBuild and to access to GetNuTool.

v1.x
```
Usage: hMSBuild [args to hMSBuild] [args to msbuild.exe or GetNuTool core]
------
Expand Down
31 changes: 27 additions & 4 deletions frontend.bat
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ set "displayOnlyPath="
set "vswVersionUsr="
set "vswPriority="
set "kStable="
set "kForce="

set /a ERROR_SUCCESS=0
set /a ERROR_FAILED=1
Expand Down Expand Up @@ -112,6 +113,7 @@ echo -stable - It will ignore possible beta releases in last attempts
echo -eng - Try to use english language for all build messages.
echo -GetNuTool {args} - Access to GetNuTool core. https://github.com/3F/GetNuTool
echo -only-path - Only display fullpath to found MSBuild.
echo -force - Aggressive behavior for -vsw-priority, -notamd64, etc.
echo -debug - To show additional information from hMSBuild.
echo -version - Display version of hMSBuild.
echo -help - Display this help. Aliases: -help -h
Expand Down Expand Up @@ -264,6 +266,11 @@ set key=!arg[%idx%]!

set kStable=1

goto continue
) else if [!key!]==[-force] (

set kForce=1

goto continue
) else (

Expand Down Expand Up @@ -472,8 +479,15 @@ if not defined kStable if not defined vswPreRel (
)

if defined vswfilter (
set "vswfilter="
set "vswPreRel="
set _msgPrio=Tools was not found for: !vswfilter!

if defined kForce (
call :dbgprint "Ignored via -force. !_msgPrio!"
set "msbf=" & goto _vswbinReturn
)

call :warn "!_msgPrio!"
set "vswfilter=" & set "vswPreRel="
goto _vswAttempt
)

Expand Down Expand Up @@ -599,7 +613,12 @@ if exist "!_noamd!" (
exit /B 0
)

call :dbgprint "Return 64bit version. Found only this."
if defined kForce (
call :dbgprint "Ignored via -force. Only 64bit version was found for -notamd64"
set "%2=" & exit /B 0
)

call :warn "Return 64bit version. Found only this."
exit /B 0
:: :msbfound

Expand All @@ -617,10 +636,14 @@ exit /B 0
:: :batOrExe

:obsolete {in:old} {in:new} [{in:new2}]
echo [*] WARN: '%~1' is obsolete. Use alternative: %~2 %~3
call :warn "'%~1' is obsolete. Use alternative: %~2 %~3"
exit /B 0
:: :obsolete

:warn {in:msg}
echo [*] WARN: %~1
exit /B 0

:dbgprint {in:str} [{in:uneval1}, [{in:uneval2}]]
if defined hMSBuildDebug (
set msgfmt=%1
Expand Down

0 comments on commit 9e8a5bb

Please sign in to comment.