Hi,
I cant tell if this is working.
My file looks like
<?xml version="1.0" standalone="no"?>
<paths>
<NuGetRepository Include="file:///Users/JohnMoshakis/Documents/develop/Nancy/build/nuget/" />
</paths>
The file is here
~/Library/Application\ Support/RemObjects\ Software/Elements/
I have nupkg files there but I cant see them being picked up. Its just showing the versions from nuget.org
Cheers,
John
mh
(marc hoffman)
July 12, 2020, 3:23pm
2
I dont believe EBuild reads NuGet repositories anywhere from Application Support yet. Only the hardcoded ones and those specified in the project.
Do you mean adding NuGetRepository to the elements file ?
I had been reading the documentation page
https://docs.elementscompiler.com/Projects/References/PackageReferences/#q=nuget
I think it would be nice if it included examples
mh
(marc hoffman)
July 12, 2020, 9:09pm
5
its there at the very end:
You can also manually add package reference elements to your project file, e.g.:
<NuGetReference Include="Microsoft.NETCore.App:*" />
<GradleReference Include="com.android.support:support-v4:22.2.1" />
I meant the NuGetRepository. It mentions it can be added to the elements file but doesn’t say where
mh
(marc hoffman)
July 13, 2020, 2:29pm
7
Same as any other object. Elements project files are really simple. You can have settings (name/value pairs, the tag name is the setting name, last one wins) in PropertyGroup
tags, and objects (named objects of a type/kind determined by their tag) in ItemGroups
.
EBuild Objects & Settings explain this, but I’ll make a note to document the file format itself more specifically.
I added this to a console app
<ItemGroup>
<NuGetRepository Include="file:///Users/JohnMoshakis/Documents/develop/Nancy/build/nuget/" />
<Reference Include="mscorlib" />
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<NuGetReference Include="Nancy:[2.0.10]">
<Private>True</Private>
</NuGetReference>
</ItemGroup>
Fire seems to recognize that as a repository, I see this in the build output
-> Task RemObjects.EBuild.Elements.ElementsProcessNuGetReferences started for RemoteConsoleApplication, Echoes.
Registering NuGet Repository 'file:///Users/JohnMoshakis/Documents/develop/Nancy/build/nuget/'
E: Package Nancy matching version [2.0.10] was not found in any repositories.
The version number should be ok because I registered the same folder with visual studio for mac and that picks it up.
mh
(marc hoffman)
July 17, 2020, 1:02am
9
how does the structure inside /Users/JohnMoshakis/Documents/develop/Nancy/build/nuget/ look?
It just a collection of nupkg files
mh
(marc hoffman)
July 17, 2020, 11:25am
11
I don’t believe that’s how its supposed to be structured. it needs to have the extracted packages like the ~/.nuget/packages folder:
I know that the nupkg are just zip files but it doesnt look like just unzipping the nupkg is the way to go. Do you have code in ebuild that I can use to open the nupg and extract it ?
mh
(marc hoffman)
July 19, 2020, 5:32pm
13
I just until then, in rebuild. A plain rename-to-.zip and unzip (and make sure the folder name is correct) should do the trick.
If I Unzip the folder it looks like this
I just added it to the nancy folder in my .nuget. It sees that version but then when I add it I get
Package Nancy matching version [2.0.10] was not found in any repositories. Falling back to 0.23.2, for IDE use only.
This is what 2.0.0 looks like and that came from nuget
mh
(marc hoffman)
July 20, 2020, 11:29am
15
Ah yes. the way this works is, it doesn’t check all repositories for all versions. if checks all repositories until it finds the package and then it sees what versions are available (on that repository).
I’ll see if I can provide a way to override what repository to use for a specific package.
Thanks, logged as bugs://84687
bugs://84687 got closed with status fixed.
See https://docs.elementscompiler.com/Projects/References/PackageReferences/ , “Per-Reference Repositories” section. docs will update within 15.
1 Like