Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into merges/release/6.x-to…
Browse files Browse the repository at this point in the history
…-main
  • Loading branch information
JoeRobich committed Feb 28, 2022
2 parents c8685d7 + 2dee26f commit 340502a
Show file tree
Hide file tree
Showing 43 changed files with 789 additions and 335 deletions.
5 changes: 0 additions & 5 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@

<Import Project="Sdk.props" Sdk="Microsoft.DotNet.Arcade.Sdk" />

<PropertyGroup>
<!-- Disable until they are better supported in tooling. -->
<DisableImplicitNamespaceImports>true</DisableImplicitNamespaceImports>
</PropertyGroup>

<!-- Nuget settings -->
<PropertyGroup>
<!-- Use Directory.Packages.props for nuget package versions -->
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Note: if the user specifies a severity here it is used for both style and analyz
- `--diagnostics`: A space separated list of diagnostic ids to use as a filter when fixing code style or 3rd party issues.
- `--severity`: The severity of diagnostics to fix. Allowed values are info, warn, and error.

#### Unique options for `dotnet cleanup analyzers`
#### Unique options for `dotnet format analyzers`
- `--diagnostics`: A space separated list of diagnostic ids to use as a filter when fixing code style or 3rd party issues.
- `--severity`: The severity of diagnostics to fix. Allowed values are info, warn, and error.

Expand All @@ -93,7 +93,7 @@ Add `format` after `dotnet` and before the command arguments that you want to ru
| `dotnet format <workspace> --severity error` | Formats, fixes codestyle errors, and fixes 3rd party analyzer errors. |
| `dotnet format whitespace <workspace> --folder` | Formats a particular folder and subfolders. |
| `dotnet format style <workspace>` | Fixes only codestyle analyzer warnings. |
| `dotnet format style <workspace> --serverity error --no-restore` | Fixes only codestyle analyzer errors without performing an implicit restore. |
| `dotnet format style <workspace> --severity error --no-restore` | Fixes only codestyle analyzer errors without performing an implicit restore. |
| `dotnet format style <workspace> --diagnostics IDE0005` | Fixes only codestyle analyzer warnings for the IDE0005 diagnostic. |
| `dotnet format analyzers <workspace> --severity error` | Fixes only 3rd party analyzer errors. |
| `dotnet format --include Program.cs Utility\Logging.cs` | Formats the files Program.cs and Utility\Logging.cs |
Expand All @@ -105,12 +105,12 @@ Add `format` after `dotnet` and before the command arguments that you want to ru

#### How to install Development Builds

Development builds of `dotnet-format` are being hosted on Azure Packages. You can visit the [dotnet-format Azure Packages page](https://dev.azure.com/dnceng/public/_packaging?_a=package&feed=dotnet6&view=versions&package=dotnet-format&protocolType=NuGet).
Development builds of `dotnet-format` are being hosted on Azure Packages. You can visit the [dotnet-format Azure Packages page](https://dev.azure.com/dnceng/public/_packaging?_a=package&feed=dotnet7&view=versions&package=dotnet-format&protocolType=NuGet).

You can install the latest build of the tool using the following command.

```console
dotnet tool install -g dotnet-format --version "6.*" --add-source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json
dotnet tool install -g dotnet-format --version "7.*" --add-source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet7/nuget/v3/index.json
```

Note: After installing .NET 6 Preview 7 SDK or higher you will need to run the dotnet-format global tool by invoking `dotnet-format`. Invoking `dotnet format` will invoke the SDK's copy of dotnet-format.
Expand All @@ -122,8 +122,8 @@ You can build and package the tool using the following commands. The instruction
```console
build -pack
# The final line from the build will read something like
# Successfully created package '..\artifacts\packages\Debug\Shipping\dotnet-format.6.0.0-dev.nupkg'.
# Use the value that is in the form `6.0.0-dev` as the version in the next command.
# Successfully created package '..\artifacts\packages\Debug\Shipping\dotnet-format.7.0.0-dev.nupkg'.
# Use the value that is in the form `7.0.0-dev` as the version in the next command.
dotnet tool install --add-source .\artifacts\packages\Debug\Shipping -g dotnet-format --version <version>
dotnet format
```
Expand All @@ -136,4 +136,4 @@ You can uninstall the tool using the following command.

```console
dotnet tool uninstall -g dotnet-format
```
```
2 changes: 2 additions & 0 deletions azure-pipelines-official.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ stages:
/p:DotnetPublishUsingPipelines=true
displayName: Build

- template: eng\common\templates\steps\generate-sbom.yml

- task: PublishTestResults@2
displayName: Publish XUnit Test Results
inputs:
Expand Down
33 changes: 30 additions & 3 deletions docs/integrations.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ Add following to your build file:
arguments: '--verify-no-changes'
```
These instructions originally authored by [leotsarev](https://github.com/joinrpg/joinrpg-net/).
Expand All @@ -58,6 +57,34 @@ Add the following block to the `repos` section of your `.pre-commit-config.yaml`
hooks:
- id: dotnet-format
```
Note that this will install dotnet format to an isolated environment, using the system installation of the dotnet CLI. See the [pre-commit.com documentation](https://pre-commit.com/#dotnet) for more details.
Note that this will compile and install dotnet format to an isolated environment, using the system installation of the dotnet CLI. See the [pre-commit.com documentation](https://pre-commit.com/#dotnet) for more details. The problem is that dotnet format is using *preview* SDK (even for 5.x versions), and you have to install preview SDK on your machine for compiling it. Another option is to use local feature of pre-commit, as follows:

```yaml
- repo: local
hooks:
#Use dotnet format already installed on your machine
- id: dotnet-format
name: dotnet-format
language: system
entry: dotnet format --include
types_or: ["c#", "vb"]
```

These instructions originally authored by [rkm](https://github.com/rkm) & [leotsarev](https://github.com/joinrpg/joinrpg-net/).


## Rider reformat on save

1. Open Settings -> Tools -> File Watchers
1. Press The “Plus Sign” to Add a Custom watcher
1. Set the name to i.e. “dotnet format on save”
1. FileType: C#
1. Scope: Open Files
1. Program: Write dotnet-format
1. Arguments: $SolutionPath$ --verbosity diagnostic --include $FileRelativePath$
1. (Optionally) Append --fix-style warning to fix any style issues automatically on save.
1. (Optionally) Append --fix-analyzers warning to fix any analyzer warnings on save.
1. Disable all advanced option checkboxes.
1. All other values were left default

These instructions originally authored by [rkm](https://github.com/rkm)
These instructions originally authored by [Nils Henrik Hals](https://strepto.github.io/Pause/blog/dotnet-format-rider/).
4 changes: 2 additions & 2 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
</Dependency>
</ProductDependencies>
<ToolsetDependencies>
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="6.0.0-beta.22122.7">
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="7.0.0-beta.22124.4">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>7215d8265a7fbcd022eb72ff7a6e2048444c985f</Sha>
<Sha>f7136626d0109856df867481219eb7366951985d</Sha>
</Dependency>
</ToolsetDependencies>
</Dependencies>
2 changes: 1 addition & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<PropertyGroup>
<MajorVersion>6</MajorVersion>
<MajorVersion>7</MajorVersion>
<MinorVersion>0</MinorVersion>
<!-- Build release-only package. -->
<PreReleaseVersionLabel>
Expand Down
1 change: 0 additions & 1 deletion eng/common/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@ function InitializeCustomToolset {
}

function Build {

InitializeToolset
InitializeCustomToolset

Expand Down
35 changes: 35 additions & 0 deletions eng/common/cross/arm/tizen-build-rootfs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/usr/bin/env bash
set -e

__ARM_HARDFP_CrossDir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
__TIZEN_CROSSDIR="$__ARM_HARDFP_CrossDir/tizen"

if [[ -z "$ROOTFS_DIR" ]]; then
echo "ROOTFS_DIR is not defined."
exit 1;
fi

TIZEN_TMP_DIR=$ROOTFS_DIR/tizen_tmp
mkdir -p $TIZEN_TMP_DIR

# Download files
echo ">>Start downloading files"
VERBOSE=1 $__ARM_HARDFP_CrossDir/tizen-fetch.sh $TIZEN_TMP_DIR
echo "<<Finish downloading files"

echo ">>Start constructing Tizen rootfs"
TIZEN_RPM_FILES=`ls $TIZEN_TMP_DIR/*.rpm`
cd $ROOTFS_DIR
for f in $TIZEN_RPM_FILES; do
rpm2cpio $f | cpio -idm --quiet
done
echo "<<Finish constructing Tizen rootfs"

# Cleanup tmp
rm -rf $TIZEN_TMP_DIR

# Configure Tizen rootfs
echo ">>Start configuring Tizen rootfs"
ln -sfn asm-arm ./usr/include/asm
patch -p1 < $__TIZEN_CROSSDIR/tizen.patch
echo "<<Finish configuring Tizen rootfs"
170 changes: 170 additions & 0 deletions eng/common/cross/arm/tizen-fetch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
#!/usr/bin/env bash
set -e

if [[ -z "${VERBOSE// }" ]] || [ "$VERBOSE" -ne "$VERBOSE" ] 2>/dev/null; then
VERBOSE=0
fi

Log()
{
if [ $VERBOSE -ge $1 ]; then
echo ${@:2}
fi
}

Inform()
{
Log 1 -e "\x1B[0;34m$@\x1B[m"
}

Debug()
{
Log 2 -e "\x1B[0;32m$@\x1B[m"
}

Error()
{
>&2 Log 0 -e "\x1B[0;31m$@\x1B[m"
}

Fetch()
{
URL=$1
FILE=$2
PROGRESS=$3
if [ $VERBOSE -ge 1 ] && [ $PROGRESS ]; then
CURL_OPT="--progress-bar"
else
CURL_OPT="--silent"
fi
curl $CURL_OPT $URL > $FILE
}

hash curl 2> /dev/null || { Error "Require 'curl' Aborting."; exit 1; }
hash xmllint 2> /dev/null || { Error "Require 'xmllint' Aborting."; exit 1; }
hash sha256sum 2> /dev/null || { Error "Require 'sha256sum' Aborting."; exit 1; }

TMPDIR=$1
if [ ! -d $TMPDIR ]; then
TMPDIR=./tizen_tmp
Debug "Create temporary directory : $TMPDIR"
mkdir -p $TMPDIR
fi

TIZEN_URL=http://download.tizen.org/snapshots/tizen
BUILD_XML=build.xml
REPOMD_XML=repomd.xml
PRIMARY_XML=primary.xml
TARGET_URL="http://__not_initialized"

Xpath_get()
{
XPATH_RESULT=''
XPATH=$1
XML_FILE=$2
RESULT=$(xmllint --xpath $XPATH $XML_FILE)
if [[ -z ${RESULT// } ]]; then
Error "Can not find target from $XML_FILE"
Debug "Xpath = $XPATH"
exit 1
fi
XPATH_RESULT=$RESULT
}

fetch_tizen_pkgs_init()
{
TARGET=$1
PROFILE=$2
Debug "Initialize TARGET=$TARGET, PROFILE=$PROFILE"

TMP_PKG_DIR=$TMPDIR/tizen_${PROFILE}_pkgs
if [ -d $TMP_PKG_DIR ]; then rm -rf $TMP_PKG_DIR; fi
mkdir -p $TMP_PKG_DIR

PKG_URL=$TIZEN_URL/$PROFILE/latest

BUILD_XML_URL=$PKG_URL/$BUILD_XML
TMP_BUILD=$TMP_PKG_DIR/$BUILD_XML
TMP_REPOMD=$TMP_PKG_DIR/$REPOMD_XML
TMP_PRIMARY=$TMP_PKG_DIR/$PRIMARY_XML
TMP_PRIMARYGZ=${TMP_PRIMARY}.gz

Fetch $BUILD_XML_URL $TMP_BUILD

Debug "fetch $BUILD_XML_URL to $TMP_BUILD"

TARGET_XPATH="//build/buildtargets/buildtarget[@name=\"$TARGET\"]/repo[@type=\"binary\"]/text()"
Xpath_get $TARGET_XPATH $TMP_BUILD
TARGET_PATH=$XPATH_RESULT
TARGET_URL=$PKG_URL/$TARGET_PATH

REPOMD_URL=$TARGET_URL/repodata/repomd.xml
PRIMARY_XPATH='string(//*[local-name()="data"][@type="primary"]/*[local-name()="location"]/@href)'

Fetch $REPOMD_URL $TMP_REPOMD

Debug "fetch $REPOMD_URL to $TMP_REPOMD"

Xpath_get $PRIMARY_XPATH $TMP_REPOMD
PRIMARY_XML_PATH=$XPATH_RESULT
PRIMARY_URL=$TARGET_URL/$PRIMARY_XML_PATH

Fetch $PRIMARY_URL $TMP_PRIMARYGZ

Debug "fetch $PRIMARY_URL to $TMP_PRIMARYGZ"

gunzip $TMP_PRIMARYGZ

Debug "unzip $TMP_PRIMARYGZ to $TMP_PRIMARY"
}

fetch_tizen_pkgs()
{
ARCH=$1
PACKAGE_XPATH_TPL='string(//*[local-name()="metadata"]/*[local-name()="package"][*[local-name()="name"][text()="_PKG_"]][*[local-name()="arch"][text()="_ARCH_"]]/*[local-name()="location"]/@href)'

PACKAGE_CHECKSUM_XPATH_TPL='string(//*[local-name()="metadata"]/*[local-name()="package"][*[local-name()="name"][text()="_PKG_"]][*[local-name()="arch"][text()="_ARCH_"]]/*[local-name()="checksum"]/text())'

for pkg in ${@:2}
do
Inform "Fetching... $pkg"
XPATH=${PACKAGE_XPATH_TPL/_PKG_/$pkg}
XPATH=${XPATH/_ARCH_/$ARCH}
Xpath_get $XPATH $TMP_PRIMARY
PKG_PATH=$XPATH_RESULT

XPATH=${PACKAGE_CHECKSUM_XPATH_TPL/_PKG_/$pkg}
XPATH=${XPATH/_ARCH_/$ARCH}
Xpath_get $XPATH $TMP_PRIMARY
CHECKSUM=$XPATH_RESULT

PKG_URL=$TARGET_URL/$PKG_PATH
PKG_FILE=$(basename $PKG_PATH)
PKG_PATH=$TMPDIR/$PKG_FILE

Debug "Download $PKG_URL to $PKG_PATH"
Fetch $PKG_URL $PKG_PATH true

echo "$CHECKSUM $PKG_PATH" | sha256sum -c - > /dev/null
if [ $? -ne 0 ]; then
Error "Fail to fetch $PKG_URL to $PKG_PATH"
Debug "Checksum = $CHECKSUM"
exit 1
fi
done
}

Inform "Initialize arm base"
fetch_tizen_pkgs_init standard base
Inform "fetch common packages"
fetch_tizen_pkgs armv7hl gcc gcc-devel-static glibc glibc-devel libicu libicu-devel libatomic linux-glibc-devel keyutils keyutils-devel libkeyutils
Inform "fetch coreclr packages"
fetch_tizen_pkgs armv7hl lldb lldb-devel libgcc libstdc++ libstdc++-devel libunwind libunwind-devel lttng-ust-devel lttng-ust userspace-rcu-devel userspace-rcu
Inform "fetch corefx packages"
fetch_tizen_pkgs armv7hl libcom_err libcom_err-devel zlib zlib-devel libopenssl11 libopenssl1.1-devel krb5 krb5-devel

Inform "Initialize standard unified"
fetch_tizen_pkgs_init standard unified
Inform "fetch corefx packages"
fetch_tizen_pkgs armv7hl gssdp gssdp-devel tizen-release

9 changes: 9 additions & 0 deletions eng/common/cross/arm/tizen/tizen.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
diff -u -r a/usr/lib/libc.so b/usr/lib/libc.so
--- a/usr/lib/libc.so 2016-12-30 23:00:08.284951863 +0900
+++ b/usr/lib/libc.so 2016-12-30 23:00:32.140951815 +0900
@@ -2,4 +2,4 @@
Use the shared library, but some functions are only in
the static library, so try that secondarily. */
OUTPUT_FORMAT(elf32-littlearm)
-GROUP ( /lib/libc.so.6 /usr/lib/libc_nonshared.a AS_NEEDED ( /lib/ld-linux-armhf.so.3 ) )
+GROUP ( libc.so.6 libc_nonshared.a AS_NEEDED ( ld-linux-armhf.so.3 ) )
2 changes: 2 additions & 0 deletions eng/common/cross/armv6/sources.list.buster
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
deb http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi
deb-src http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi
Loading

0 comments on commit 340502a

Please sign in to comment.