Skip to content

Commit

Permalink
Merge latest standalone-template into feature/DllImportGenerator (#1031)
Browse files Browse the repository at this point in the history
* Fix runsettings generation

* Update standalone-template for recent infrastructure changes (#1024)

* Update to Arcade 6.0.0-beta.21226.16

* Update dependency for using custom runtime version

* Update README

* Don't use custom runtime in Ancillary.Interop

Co-authored-by: Santiago Fernandez Madero <[email protected]>
  • Loading branch information
elinor-fung and safern authored Apr 28, 2021
1 parent 88a7894 commit 57b11ae
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<RootNamespace>System.Runtime.InteropServices</RootNamespace>
<Nullable>enable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<UseCustomRuntimeVersion>false</UseCustomRuntimeVersion>
</PropertyGroup>

</Project>
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,35 @@
# Standalone Experiments

This branch contains a template for standalone experiments, which means that experiments that are a library, which doesn't depend on runtime changes and doesn't need the overhead of having all the runtime, libraries and installer code, can use this minimal template.
This branch contains a template for standalone experiments, which means that experiments that are a library, which doesn't depend on runtime changes. This minimal template allows such experiments to avoid the overhead of having all the runtime, libraries and installer code.

## Create your experiment

1. Create a new branch from this branch and make sure the branch name follows the naming guidelines to get CI and Official Build support. The name should use the `feature/` prefix.

2. Identify whether you need to consume new APIs or features from `dotnet/runtime` and need to be able to consume these on a faster cadence than using a daily SDK build:
- I don't need to depend on `dotnet/runtime`:
1. Update the `global.json` file and specify the minimum required `dotnet` tool and SDK version that you need to build and run tests.
2. Remove the `runtimes` section under `tools`.
3. Set `UseCustomRuntimeVersion` property to `false` in `Directory.Build.props`
1. Update the `global.json` file:
- Specify the minimum required `dotnet` tool and SDK version that you need to build and run tests
- Remove the `runtimes` section under `tools`
2. Set `UseCustomRuntimeVersion` property to `false` in `Directory.Build.props`
3. Remove the `VS.Redist.Common.NetCore.SharedFramework.x64.6.0` dependency from `Version.Details.xml` and the corresponding property from `Version.props`
- I do need to depend on `dotnet/runtime`:
1. Set a DARC dependency from `dotnet/runtime` to your branch in this repository. For more information on how to do it, see [here](https://github.com/dotnet/arcade/blob/master/Documentation/Darc.md#darc)
1. Set a DARC dependency from `dotnet/runtime` to your branch in this repository. For more information on how to do it, see [here](https://github.com/dotnet/arcade/blob/main/Documentation/Darc.md#darc)


> Note that if you want to run `dotnet test` in you test projects you will need to either first run `build.cmd/sh` or install the runtime version specified by `MicrosoftNETCoreAppVersion` property in `Versions.props` in your global dotnet install. If you run `build.cmd/sh` arcade infrastructure will make sure that the repo `dotnet` SDK found in `<RepoRoot>\.dotnet` folder, has this runtime installed. Then during the build of the test projects, we generate a `.runsettings` file that points to this `dotnet` SDK.

> For both options above, you can choose whether your experiment needs arcade latest features, to do that, set the required DARC subscription from `dotnet/arcade` to this repository following these [instructions](https://github.com/dotnet/arcade/blob/master/Documentation/Darc.md#darc).
> For both options above, you can choose whether your experiment needs arcade latest features, to do that, set the required DARC subscription from `dotnet/arcade` to this repository following these [instructions](https://github.com/dotnet/arcade/blob/main/Documentation/Darc.md#darc).
3. Set the right version for your library. In order to do that, set the following properties in `Versions.props`:
- `VersionPrefix`: the version prefix for the produced nuget package.
- `MajorVersion/MinorVersion/PatchVersion`: Properties that control file version.
- `PreReleaseVersionLabel`: this is the label that your package will contain when producing a non stable package. i.e: `MyExperiment.1.0.0-alpha-23432.1.nupkg`.

4. Choose the right set of platforms for CI and Official Builds by tweaking `eng/pipelines/runtimelab.yml` file.
4. Choose the right set of platforms for CI and Official Builds by tweaking `eng/pipelines/runtimelab.yml` file.

5. Rename `Experimental.sln`, `Experimental.csproj` and `Experimental.Tests.csproj` to your experiment name.
5. Rename `Experimental.sln`, `Experimental.csproj` and `Experimental.Tests.csproj` to your experiment name.

The package produced from your branch will be published to the the [`dotnet-experimental`](https://dev.azure.com/dnceng/public/_packaging?_a=feed&feed=dotnet-experimental) feed.

Expand Down
10 changes: 6 additions & 4 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<Dependencies>
<ProductDependencies>
<Dependency Name="Microsoft.NETCore.App" Version="6.0.0-alpha.1.20514.9">
<!-- This VS redist package is used as a way to get a non-shipping version number
when using a custom runtime version. -->
<Dependency Name="VS.Redist.Common.NetCore.SharedFramework.x64.6.0" Version="6.0.0-preview.5.21226.5">
<Uri>https://github.com/dotnet/runtime</Uri>
<Sha>d67cc2cceb4dc8ecd15f5b6663d93f79de3954fd</Sha>
<Sha>ac82799250fe42c8ba2941aef487aca94ecf04cc</Sha>
</Dependency>
</ProductDependencies>
<ToolsetDependencies>
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="6.0.0-beta.21222.1">
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="6.0.0-beta.21226.16">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>b7279bb45342c948ab46fea2d08ec17ae2f2a1bf</Sha>
<Sha>bfd2d598fb91f8e21fa1dbe9ced70df203fe7eda</Sha>
</Dependency>
</ToolsetDependencies>
</Dependencies>
4 changes: 3 additions & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
<UseVSTestRunner>true</UseVSTestRunner>
<UsingToolXliff>false</UsingToolXliff>
<!-- Libs -->
<MicrosoftNETCoreAppVersion>6.0.0-alpha.1.20554.9</MicrosoftNETCoreAppVersion>
<MicrosoftNETTestSdkVersion>16.7.1</MicrosoftNETTestSdkVersion>
<VSRedistCommonNetCoreSharedFrameworkx6460Version>6.0.0-preview.5.21226.5</VSRedistCommonNetCoreSharedFrameworkx6460Version>
<XUnitVersion>2.4.1</XUnitVersion>
<XUnitRunnerVisualStudioVersion>2.4.3</XUnitRunnerVisualStudioVersion>
<!-- Roslyn dependencies -->
Expand All @@ -28,5 +28,7 @@
<BenchmarkDotNetVersion>0.12.1</BenchmarkDotNetVersion>
<CoverletVersion>1.3.0</CoverletVersion>
<DNNEVersion>1.0.16</DNNEVersion>
<!-- Set the custom NETCoreApp version based on the VS redist package version -->
<MicrosoftNETCoreAppVersion>$(VSRedistCommonNetCoreSharedFrameworkx6460Version)</MicrosoftNETCoreAppVersion>
</PropertyGroup>
</Project>
12 changes: 7 additions & 5 deletions eng/common/templates/job/onelocbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ parameters:
LclSource: lclFilesInRepo
LclPackageId: ''
RepoType: gitHub
condition: ''

jobs:
- job: OneLocBuild

dependsOn: ${{ parameters.dependsOn }}

displayName: OneLocBuild
Expand All @@ -36,14 +37,15 @@ jobs:
- ${{ if eq(parameters.UseCheckedInLocProjectJson, 'true') }}:
- name: _GenerateLocProjectArguments
value: ${{ variables._GenerateLocProjectArguments }} -UseCheckedInLocProjectJson


steps:
- task: Powershell@2
inputs:
filePath: $(Build.SourcesDirectory)/eng/common/generate-locproject.ps1
arguments: $(_GenerateLocProjectArguments)
displayName: Generate LocProject.json
condition: ${{ parameters.condition }}

- task: OneLocBuild@2
displayName: OneLocBuild
Expand All @@ -62,20 +64,20 @@ jobs:
${{ if eq(parameters.RepoType, 'gitHub') }}:
repoType: ${{ parameters.RepoType }}
gitHubPatVariable: "${{ parameters.GithubPat }}"
condition: always()
condition: ${{ parameters.condition }}

- task: PublishBuildArtifacts@1
displayName: Publish Localization Files
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)/loc'
PublishLocation: Container
ArtifactName: Loc
condition: always()
condition: ${{ parameters.condition }}

- task: PublishBuildArtifacts@1
displayName: Publish LocProject.json
inputs:
PathtoPublish: '$(Build.SourcesDirectory)/Localize/'
PublishLocation: Container
ArtifactName: Loc
condition: always()
condition: ${{ parameters.condition }}
3 changes: 2 additions & 1 deletion eng/testing/runsettings.targets
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<RunSettingsInputFilePath>$(MSBuildThisFileDirectory).runsettings</RunSettingsInputFilePath>
<RunSettingsAppOutputFilePath>$(OutDir).runsettings</RunSettingsAppOutputFilePath>
<RunSettingsAppOutputFilePath>$(OutputPath).runsettings</RunSettingsAppOutputFilePath>

<RunSettingsOutputFilePath>$(RunSettingsAppOutputFilePath)</RunSettingsOutputFilePath>

Expand All @@ -13,6 +13,7 @@
</PropertyGroup>

<Target Name="GenerateRunSettingsFile"
Condition="'$(MSBuildRestoreSessionId)' == '' and '$(IsCrossTargetingBuild)' != 'true'"
Inputs="$(RunSettingsInputFilePath)"
Outputs="$(RunSettingsOutputFilePath)">

Expand Down
6 changes: 3 additions & 3 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"sdk": {
"version": "6.0.100-preview.2.21155.3",
"version": "6.0.100-preview.3.21202.5",
"allowPrerelease": true,
"rollForward": "major"
},
"tools": {
"dotnet": "6.0.100-preview.2.21155.3",
"dotnet": "6.0.100-preview.3.21202.5",
"runtimes": {
"dotnet": [
"$(MicrosoftNETCoreAppVersion)"
]
}
},
"msbuild-sdks": {
"Microsoft.DotNet.Arcade.Sdk": "6.0.0-beta.21222.1"
"Microsoft.DotNet.Arcade.Sdk": "6.0.0-beta.21226.16"
}
}

0 comments on commit 57b11ae

Please sign in to comment.