-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #234235 from raphaelr/mknugetsource-support-subdirs
buildDotnetModule: fix `projectReferences = [ ... ]`
- Loading branch information
Showing
9 changed files
with
78 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ callPackage }: | ||
|
||
{ | ||
project-references = callPackage ./project-references { }; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ProjectReferencesTest.Library.Hello(); |
10 changes: 10 additions & 0 deletions
10
pkgs/test/dotnet/project-references/application/Application.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<OutputType>exe</OutputType> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="../library/Library.csproj" /> | ||
<PackageReference Include="ProjectReferencesTest.Library" Version="*" Condition=" '$(ContinuousIntegrationBuild)'=='true' " /> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Tests the `projectReferences = [ ... ];` feature of buildDotnetModule. | ||
# The `library` derivation exposes a .nupkg, which is then consumed by the `application` derivation. | ||
# https://nixos.org/manual/nixpkgs/unstable/index.html#packaging-a-dotnet-application | ||
|
||
{ lib | ||
, dotnet-sdk | ||
, buildDotnetModule | ||
, runCommand | ||
}: | ||
|
||
let | ||
nugetDeps = ./nuget-deps.nix; | ||
|
||
# Specify the TargetFramework via an environment variable so that we don't | ||
# have to update the .csproj files when updating dotnet-sdk | ||
TargetFramework = "net${lib.versions.majorMinor (lib.getVersion dotnet-sdk)}"; | ||
|
||
library = buildDotnetModule { | ||
name = "project-references-test-library"; | ||
src = ./library; | ||
inherit nugetDeps TargetFramework; | ||
|
||
packNupkg = true; | ||
}; | ||
|
||
application = buildDotnetModule { | ||
name = "project-references-test-application"; | ||
src = ./application; | ||
inherit nugetDeps TargetFramework; | ||
|
||
projectReferences = [ library ]; | ||
}; | ||
in | ||
|
||
runCommand "project-references-test" { } '' | ||
${application}/bin/Application | ||
touch $out | ||
'' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
namespace ProjectReferencesTest; | ||
public static class Library | ||
{ | ||
public static void Hello() | ||
{ | ||
System.Console.WriteLine("Hello, World!"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<PackageId>ProjectReferencesTest.Library</PackageId> | ||
</PropertyGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# This file was automatically generated by passthru.fetch-deps. | ||
# Please dont edit it manually, your changes might get overwritten! | ||
|
||
{ fetchNuGet }: [ | ||
] |