mirror of https://github.com/dotnet/tye.git
Browse Source
* Use out-of-proc MSBuild evaluation This allows for support for new SDKs/TFMs without needing tye to target those TFMs * Combine restore and metadata evaluation * Batch process projectspull/685/head
committed by
GitHub
18 changed files with 267 additions and 164 deletions
@ -0,0 +1,3 @@ |
|||||
|
@ECHO OFF |
||||
|
SETLOCAL |
||||
|
PowerShell -NoProfile -NoLogo -ExecutionPolicy ByPass -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = ''; [System.Threading.Thread]::CurrentThread.CurrentUICulture = ''; try { & '%~dp0clean.ps1' %*; exit $LASTEXITCODE } catch { write-host $_; exit 1 }" |
||||
@ -0,0 +1,42 @@ |
|||||
|
#requires -version 5 |
||||
|
|
||||
|
<# |
||||
|
.SYNOPSIS |
||||
|
Clean this repository. |
||||
|
|
||||
|
.DESCRIPTION |
||||
|
This script cleans this repository interactively, leaving downloaded infrastructure untouched. |
||||
|
Clean operation is interactive to avoid losing new but unstaged files. Press 'c' then [Enter] |
||||
|
to perform the proposed deletions. |
||||
|
|
||||
|
.EXAMPLE |
||||
|
Perform default clean operation. |
||||
|
|
||||
|
clean.ps1 |
||||
|
|
||||
|
.EXAMPLE |
||||
|
Clean everything but downloaded infrastructure and VS / VS Code folders. |
||||
|
|
||||
|
clean.ps1 -e .vs/ -e .vscode/ |
||||
|
#> |
||||
|
|
||||
|
[CmdletBinding(PositionalBinding = $false)] |
||||
|
param( |
||||
|
# Other lifecycle targets |
||||
|
[switch]$Help, # Show help |
||||
|
|
||||
|
# Capture the rest |
||||
|
[Parameter(ValueFromRemainingArguments = $true)] |
||||
|
[string[]]$GitArguments |
||||
|
) |
||||
|
|
||||
|
Set-StrictMode -Version 2 |
||||
|
$ErrorActionPreference = 'Stop' |
||||
|
|
||||
|
if ($Help) { |
||||
|
Get-Help $PSCommandPath |
||||
|
exit 0 |
||||
|
} |
||||
|
|
||||
|
git clean -dix -e .dotnet/ -e .tools/ @GitArguments |
||||
|
git checkout -- $(git ls-files -d) |
||||
@ -0,0 +1,38 @@ |
|||||
|
#!/usr/bin/env bash |
||||
|
|
||||
|
set -euo pipefail |
||||
|
|
||||
|
# |
||||
|
# Functions |
||||
|
# |
||||
|
__usage() { |
||||
|
echo "Usage: $(basename "${BASH_SOURCE[0]}") <Arguments> |
||||
|
|
||||
|
Arguments: |
||||
|
<Arguments>... Arguments passed to the 'git' command. Any number of arguments allowed. |
||||
|
|
||||
|
Description: |
||||
|
This script cleans the repository interactively, leaving downloaded infrastructure untouched. |
||||
|
Clean operation is interactive to avoid losing new but unstaged files. Press 'c' then [Enter] |
||||
|
to perform the proposed deletions. |
||||
|
" |
||||
|
} |
||||
|
|
||||
|
git_args=() |
||||
|
|
||||
|
while [[ $# -gt 0 ]]; do |
||||
|
case $1 in |
||||
|
-\?|-h|--help) |
||||
|
__usage |
||||
|
exit 0 |
||||
|
;; |
||||
|
*) |
||||
|
git_args[${#git_args[*]}]="$1" |
||||
|
;; |
||||
|
esac |
||||
|
shift |
||||
|
done |
||||
|
|
||||
|
# This incantation avoids unbound variable issues if git_args is empty |
||||
|
# https://stackoverflow.com/questions/7577052/bash-empty-array-expansion-with-set-u |
||||
|
git clean -dix -e .dotnet/ -e .tools/ ${git_args[@]+"${git_args[@]}"} |
||||
@ -0,0 +1,40 @@ |
|||||
|
<Project> |
||||
|
<Target Name="MicrosoftTye_GetProjectMetadata" DependsOnTargets="Restore;ResolveReferences;ResolvePackageDependenciesDesignTime;PrepareResources;GetAssemblyAttributes" > |
||||
|
<PropertyGroup> |
||||
|
<_MicrosoftTye_MetadataFile>$([System.IO.Path]::GetFullPath('$(IntermediateOutputPath)MicrosoftTye.ProjectMetadata.txt'))</_MicrosoftTye_MetadataFile> |
||||
|
<_MicrosoftTye_ProjectFrameworkReference>@(FrameworkReference, '%3B')</_MicrosoftTye_ProjectFrameworkReference> |
||||
|
</PropertyGroup> |
||||
|
|
||||
|
<ItemGroup> |
||||
|
<_MicrosoftTye_ProjectMetadata Include="AssemblyInformationalVersion: $(AssemblyInformationalVersion)" /> |
||||
|
<_MicrosoftTye_ProjectMetadata Include="InformationalVersion: $(InformationalVersion)" /> |
||||
|
<_MicrosoftTye_ProjectMetadata Include="Version: $(Version)" /> |
||||
|
<_MicrosoftTye_ProjectMetadata Include="TargetFrameworks: $(TargetFrameworks)" /> |
||||
|
<_MicrosoftTye_ProjectMetadata Include="RunCommand: $(RunCommand)" /> |
||||
|
<_MicrosoftTye_ProjectMetadata Include="RunArguments: $(RunArguments)" /> |
||||
|
<_MicrosoftTye_ProjectMetadata Include="TargetPath: $(TargetPath)" /> |
||||
|
<_MicrosoftTye_ProjectMetadata Include="PublishDir: $(PublishDir)" /> |
||||
|
<_MicrosoftTye_ProjectMetadata Include="AssemblyName: $(AssemblyName)" /> |
||||
|
<_MicrosoftTye_ProjectMetadata Include="IntermediateOutputPath: $(IntermediateOutputPath)" /> |
||||
|
<_MicrosoftTye_ProjectMetadata Include="TargetFramework: $(TargetFramework)" /> |
||||
|
<_MicrosoftTye_ProjectMetadata Include="_ShortFrameworkIdentifier: $(_ShortFrameworkIdentifier)" /> |
||||
|
<_MicrosoftTye_ProjectMetadata Include="_ShortFrameworkVersion: $(_ShortFrameworkVersion)" /> |
||||
|
<_MicrosoftTye_ProjectMetadata Include="_TargetFrameworkVersionWithoutV: $(_TargetFrameworkVersionWithoutV)" /> |
||||
|
<_MicrosoftTye_ProjectMetadata Include="FrameworkReference: $(_MicrosoftTye_ProjectFrameworkReference)" /> |
||||
|
<_MicrosoftTye_ProjectMetadata Include="ContainerBaseImage: $(ContainerBaseImage)" /> |
||||
|
<_MicrosoftTye_ProjectMetadata Include="ContainerBaseTag: $(ContainerBaseTag)" /> |
||||
|
<_MicrosoftTye_ProjectMetadata Include="MicrosoftNETPlatformLibrary: $(MicrosoftNETPlatformLibrary)" /> |
||||
|
<_MicrosoftTye_ProjectMetadata Include="_AspNetCoreAppSharedFxIsEnabled: $(_AspNetCoreAppSharedFxIsEnabled)" /> |
||||
|
<_MicrosoftTye_ProjectMetadata Include="UsingMicrosoftNETSdkWeb: $(UsingMicrosoftNETSdkWeb)" /> |
||||
|
</ItemGroup> |
||||
|
|
||||
|
<WriteLinesToFile |
||||
|
File="$(_MicrosoftTye_MetadataFile)" |
||||
|
Lines="@(_MicrosoftTye_ProjectMetadata)" |
||||
|
Overwrite="true" |
||||
|
WriteOnlyWhenDifferent="true"/> |
||||
|
|
||||
|
<Message Text="Microsoft.Tye metadata: $(MicrosoftTye_ProjectName): $(_MicrosoftTye_MetadataFile)" Importance="High"/> |
||||
|
|
||||
|
</Target> |
||||
|
</Project> |
||||
Loading…
Reference in new issue