Skip to content
This repository was archived by the owner on Nov 21, 2018. It is now read-only.

Use RuntimeFrameworkVersion instead for directory name #82

Merged
merged 7 commits into from
May 1, 2017

Conversation

pakrym
Copy link
Contributor

@pakrym pakrym commented Apr 28, 2017

No description provided.

@@ -17,6 +17,6 @@
</DepsFiles>
</ItemGroup>

<Copy SourceFiles="%(DepsFiles.FullPath)" DestinationFiles="$(DepsOutputPath)\%(DepsFiles.PackageName)\Microsoft.NETCore.App\2.0.0\deps.json" />
<Copy SourceFiles="%(DepsFiles.FullPath)" DestinationFiles="$(DepsOutputPath)\%(DepsFiles.PackageName)\Microsoft.NETCore.App\$(RuntimeFrameworkVersion)\deps.json" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@glennc also found that we need to add shared into this path. Also the file name needs to be .deps.json instead of just deps.json.

so DestinationFiles="$(DepsOutputPath)\%(DepsFiles.PackageName)shared\\Microsoft.NETCore.App\$(RuntimeFrameworkVersion)\%(DepsFiles.PackageName).deps.json"

Copy link

@muratg muratg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but make sure to get a sign-off from @JunTaoLuo before checking in.

@@ -7,16 +7,6 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="@(RuntimeStorePackageReference)" />
<PackageReference Include="@(RuntimeStorePackageReference)" Version="$(AspNetCoreVersion)" PrivateAssets="None" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why the version and private assets attributes?

@@ -0,0 +1,4 @@
public class Program
Copy link
Contributor

@JunTaoLuo JunTaoLuo Apr 29, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hate to put a copyright header on this but we probably should. Unless we start relocating these files out of src/ add copyright to every source code file.

<MsBuild Projects="$(MetaPackageFile)" Targets="CollectDeps" Properties="DepsOutputPath=$(DepsOutputPath)"/>

<!--- MSBuild caches things if you run inproc so have to use Exec -->
<Exec Command="dotnet msbuild /t:Restore;Rebuild;CollectDeps $(HostingStartupTemplateFile) /p:DepsOutputPath=$(DepsOutputPath);HostingStartupPackageName=%(HostingStartupPackageReference.Identity);HostingStartupPackageVersion=%(Version)"/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

</PropertyGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="10.0.1" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

put the version in dependencies.props.


<Target Name="CollectDeps">
<PropertyGroup>
<DestinationDepsFile>$(DepsOutputPath)\$(HostingStartupPackageName)\shared\Microsoft.NETCore.App\$(RuntimeFrameworkVersion)\deps.json</DestinationDepsFile>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

must have some kind of file name in front of deps.json. Could be as simple as app.deps.json

{
public static void Main(string[] args)
{
ChangeEntryPointLibraryName(args[0], null);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a little confused what is trying to be achieved here. From the code below it looks like you are only removing the target library which is the first entry under targets/tfm and libraries. In that case why bother with the second parameter? Also is it always guaranteed that the first entry is what we want to trim? Is it better to be logging for the specific package *HostingStartup.Template I presume?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, should have added WIP to commit message, I copied this from the code I wrote to build shared runtime I'm going to trim it today.

Copy link
Contributor

@JunTaoLuo JunTaoLuo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just one minor concern. Would be okay to merge and file issue to potentially update later.

string version = null;
foreach (JProperty target in deps["targets"])
{
var targetLibrary = target.Value.Children<JProperty>().FirstOrDefault();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this logic too fragile? Are we guaranteed that the first entry is always the one we want to remove? Should we not check the name of the assembly or something?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@pakrym pakrym merged commit 08ec9a7 into dev May 1, 2017
@JunTaoLuo JunTaoLuo deleted the pakrym/runtimeversion branch June 7, 2017 18:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants