mapbox / mapbox-sdk-cs

C# libraries for Mapbox API layer
https://mapbox.github.io/mapbox-sdk-cs/
Other
20 stars 11 forks source link

nuget command line unable to find latest nuget package #20

Closed isiyu closed 7 years ago

isiyu commented 7 years ago

@BergWerkGIS - I'm using the nuget osx command line, but is not able to find the latest versioned package. I'm trying to update the packages.config file and running nuget install. It can't find anything newer than 1.0.0-alpha02. Am i missing a step in publishing? The newer versions were being published via app veyor builds.

https://www.nuget.org/packages/MapboxSDKforUnityCore/1.0.0-alpha10

> nuget install
> Unable to find version '1.0.0-alpha10' of package 'MapboxSDKforUnityCore'.
> nuget install
> Installing 'MapboxSDKforUnityCore 1.0.0-alpha02'.
Added file 'DirectionResource.cs' to folder '/Users/siyusong/mapbox/mapbox-sdk-unity/MapboxSDKforUnityCore.1.0.0-alpha02/content/sdkproject/Assets/Mapbox/Assets/Core/Directions'.
Added file 'Directions.cs' to folder '/Users/siyusong/mapbox/mapbox-sdk-unity/MapboxSDKforUnityCore.1.0.0-alpha02/content/sdkproject/Assets/Mapbox/Assets/Core/Directions'.
Added file 'Overview.cs' to folder '/Users/siyusong/mapbox/mapbox-sdk-unity/MapboxSDKforUnityCore.1.0.0-alpha02/content/sdkproject/Assets/Mapbox/Assets/Core/Directions'.
Added file 'RoutingProfile.cs' to folder '/Users/siyusong/mapbox/m

I'm able to find the latest version in xamarin's nuget importer.

screen shot 2017-01-02 at 3 35 21 pm
wilhelmberg commented 7 years ago

Not sure why this doesn't work for you. Maybe you nuget.exe is out of date? Current version is 3.5. Get latest here: https://dist.nuget.org/win-x86-commandline/latest/nuget.exe

For me it looks like this:

c:\mb\mapbox-sdk-unity (master)
λ nuget install
Feeds used:
  C:\Users\bergw\.nuget\packages\
  https://api.nuget.org/v3/index.json
  C:\mb\_TEMP\vector-tiles-cs-NUGET
  C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\

Restoring NuGet package MapboxSDKforUnityCore.1.0.0-alpha10.
  GET https://api.nuget.org/v3-flatcontainer/mapboxsdkforunitycore/1.0.0-alpha10/mapboxsdkforunitycore.1.0.0-alpha10.nupkg
  OK https://api.nuget.org/v3-flatcontainer/mapboxsdkforunitycore/1.0.0-alpha10/mapboxsdkforunitycore.1.0.0-alpha10.nupkg 343ms
Installing MapboxSDKforUnityCore 1.0.0-alpha10.
Adding package 'MapboxSDKforUnityCore.1.0.0-alpha10' to folder 'c:\mb\mapbox-sdk-unity'
Added package 'MapboxSDKforUnityCore.1.0.0-alpha10' to folder 'c:\mb\mapbox-sdk-unity'

Xamarin finds it because you've checked the pre-release box:

image

What happens if you try:

nuget.exe install MapboxSDKforUnityCore -prerelease -version 1.0.0-alpha10 -verbosity detailed
wilhelmberg commented 7 years ago

Also works on my Ubuntu:

✔ ~/mapbox-sdk-unity [master {origin/master}|✔] 
13:03 $ ~/Downloads/nuget.exe install
Feeds used:
  https://api.nuget.org/v3/index.json

Restoring NuGet package MapboxSDKforUnityCore.1.0.0-alpha10.
  GET https://api.nuget.org/v3-flatcontainer/mapboxsdkforunitycore/1.0.0-alpha10/mapboxsdkforunitycore.1.0.0-alpha10.nupkg
  OK https://api.nuget.org/v3-flatcontainer/mapboxsdkforunitycore/1.0.0-alpha10/mapboxsdkforunitycore.1.0.0-alpha10.nupkg 454ms
Installing MapboxSDKforUnityCore 1.0.0-alpha10.
Adding package 'MapboxSDKforUnityCore.1.0.0-alpha10' to folder '/home/bergw/mapbox-sdk-unity'
Added package 'MapboxSDKforUnityCore.1.0.0-alpha10' to folder '/home/bergw/mapbox-sdk-unity'
wilhelmberg commented 7 years ago

@isiyu please look at my open PR: https://github.com/mapbox/mapbox-sdk-unity/pull/120/

I've added update-mapbox-unity-sdk-core.sh as the equivalent of the existing Windows batch file (update-mapbox-unity-sdk-core.bat).

If you have any MapboxSDKforUnityCore.1.0.0-* directories left from previous attempts, delete them manually then call it like so:

./update-mapbox-unity-sdk-core.sh 1.0.0-alpha10

Not the cleanest way but at least it is reproducible and removes some manual steps. We will certainly have to improve this, but I haven't found a way yet to restore the nupkg directly into sdkproject.

isiyu commented 7 years ago

@BergWerkGIS Thanks for checking this out! yep. looks like it was because i was using an old version of the nuget cli.

mapbox/mapbox-sdk-unity#120/ work for me for the most part, except the installation is a little weird for me on OS X, since it can't run the exe directly. The most direct way is running the exe from within mono like

mono /usr/local/bin/nuget.exe

The way I ended up having nuget cli installed is i have a file here that looks like, so I just had to rename nuget.exe to nuget here:

#!/bin/sh
exec /Library/Frameworks/Mono.framework/Versions/4.6.2/bin/mono $MONO_OPTIONS /Library/Frameworks/Mono.framework/Versions/4.6.2/lib/mono/nuget/NuGet.exe "$@"

Can we have the bash script look for nuget when nuget.exe doesn't exist? is there a cleaner solution?

wilhelmberg commented 7 years ago

@isiyu interesting: nuget vs nuget.exe.

I tried on Ubuntu and only nuget.exe worked, just nuget did not.

Looking for a Ubuntu/OSX solution ....

wilhelmberg commented 7 years ago

@isiyu I modified update-mapbox-unity-sdk-core.sh: https://github.com/mapbox/mapbox-sdk-unity/pull/120/files#diff-1ecec1fc0c80dab0d509292992ae986fR23

It now looks for nuget.exe and nuget. Worked for me on Ubuntu and OSX Sierrra.

Could you try again?

isiyu commented 7 years ago

worked for me! thanks @BergWerkGIS