Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create v1.12 of generated libraries, with two PCL profiles #718

Merged
merged 5 commits into from
Apr 4, 2016
Merged

Create v1.12 of generated libraries, with two PCL profiles #718

merged 5 commits into from
Apr 4, 2016

Conversation

mmdriley
Copy link
Contributor

@mmdriley mmdriley commented Apr 4, 2016

Since NuGet doesn't currently filter libraries based on their supported
target frameworks, these changes are necessary to ensure that
Install-Package Google.Apis.Storage.v1
still works in projects targeting .NET 4.0 now that new versions of the
support libraries no longer target .NET 4.0.

Profile259 supports newer frameworks and brings in the newest version
of the support libraries.

Profile328 is the "legacy" framework set and brings in the last version
of the support libraries that supported Net40: v1.10, referred to here
as oldCompatibleVersion for easier searchability.

Updated GeneratedLibraries.proj so it will build both projects.

Updated the .nuspec to include both built assemblies in the appropriate
portable-xyz directories.

Verified using test projects that the targetFramework values in
packages.config and the HintPaths in the .csprojs are correct
for the new project targets.

Also fixed a few issues with generated library builds.

mmdriley added 5 commits April 4, 2016 15:22
Since NuGet doesn't currently filter libraries based on their supported
target frameworks, these changes are necessary to ensure that
`Install-Package Google.Apis.Storage.v1`
still works in projects targeting .NET 4.0 now that new versions of the
support libraries no longer target .NET 4.0.

Profile259 supports newer frameworks and brings in the newest version
of the support libraries.

Profile328 is the "legacy" framework set and brings in the last version
of the support libraries that supported Net40: v1.10, referred to here
as oldCompatibleVersion for easier searchability.

Updated GeneratedLibraries.proj so it will build both projects.

Updated the .nuspec to include both built assemblies in the appropriate
portable-xyz directories.

Verified using test projects that the targetFramework values in
packages.config and the HintPaths in the .csprojs are correct
for the new project targets.
Private references are copied to the bin\ directory as part of build. That's
useful when the directory will be copied for deployment; less so when we're
only interested in adding the main assembly to a NuGet package.

Setting `<Private>False</Private>` avoids unnecessarily copying hundreds of
DLLs during the build.
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Apr 4, 2016
@chrsmith
Copy link
Contributor

chrsmith commented Apr 4, 2016

Matt spent 5 (10?) minutes walking me through the changes, and the test PCL project. It'll trust that this does what we think it does. I'm fine with this going on, but could you add a Markdown file in the repository explaining our NuGet+TargetFx schenanigans?

e.g. /docs/NuGetVersioning.md. Future generations of software engineers will thank you.

@mmdriley
Copy link
Contributor Author

mmdriley commented Apr 4, 2016

Will do.

@mmdriley mmdriley merged commit 384a927 into googleapis:master Apr 4, 2016
@mmdriley mmdriley mentioned this pull request Apr 4, 2016
@peleyal
Copy link
Collaborator

peleyal commented Apr 5, 2016

I didn't test it, but it seems like an elegant solution, thanks for fixing it so fast!!!!
I'm looking forward for 1.12.

Thanks again Matt 👍

@LindaLawton
Copy link
Collaborator

Verified you can install the package now targeting .net framework 4.0

PM> Install-Package Google.Apis.Analytics.v3
Attempting to resolve dependency 'Google.Apis (= 1.10.0)'.
Attempting to resolve dependency 'Google.Apis.Core (≥ 1.10.0)'.
Attempting to resolve dependency 'Microsoft.Bcl (≥ 1.1.10)'.
Attempting to resolve dependency 'Microsoft.Bcl.Build (≥ 1.0.14)'.
Attempting to resolve dependency 'Microsoft.Bcl.Async (≥ 1.0.168)'.
Attempting to resolve dependency 'Microsoft.Bcl.Build (≥ 1.0.21)'.
Attempting to resolve dependency 'Microsoft.Net.Http (≥ 2.2.29)'.
Attempting to resolve dependency 'Newtonsoft.Json (≥ 7.0.1)'.
Attempting to resolve dependency 'log4net (≥ 2.0.3)'.
Attempting to resolve dependency 'Zlib.Portable.Signed (≥ 1.11.0)'.
Attempting to resolve dependency 'Google.Apis.Auth (= 1.10.0)'.
Attempting to resolve dependency 'BouncyCastle (≥ 1.7.0)'.
Installing 'Microsoft.Bcl 1.1.10'.
You are downloading Microsoft.Bcl from Microsoft, the license agreement to which is available at http://go.microsoft.com/fwlink/?LinkId=329770. Check the package for additional dependencies, which may come with their own license agreement(s). Your use of the package and dependencies constitutes your acceptance of their license agreements. If you do not accept the license agreement(s), then delete the relevant components from your device.
Successfully installed 'Microsoft.Bcl 1.1.10'.
Installing 'Microsoft.Bcl.Async 1.0.168'.
You are downloading Microsoft.Bcl.Async from Microsoft, the license agreement to which is available at http://go.microsoft.com/fwlink/?LinkId=329770. Check the package for additional dependencies, which may come with their own license agreement(s). Your use of the package and dependencies constitutes your acceptance of their license agreements. If you do not accept the license agreement(s), then delete the relevant components from your device.
Successfully installed 'Microsoft.Bcl.Async 1.0.168'.
Installing 'Microsoft.Bcl.Build 1.0.21'.
You are downloading Microsoft.Bcl.Build from Microsoft, the license agreement to which is available at http://go.microsoft.com/fwlink/?LinkId=329770. Check the package for additional dependencies, which may come with their own license agreement(s). Your use of the package and dependencies constitutes your acceptance of their license agreements. If you do not accept the license agreement(s), then delete the relevant components from your device.
Successfully installed 'Microsoft.Bcl.Build 1.0.21'.
Installing 'Microsoft.Net.Http 2.2.29'.
You are downloading Microsoft.Net.Http from Microsoft, the license agreement to which is available at http://go.microsoft.com/fwlink/?LinkId=329770. Check the package for additional dependencies, which may come with their own license agreement(s). Your use of the package and dependencies constitutes your acceptance of their license agreements. If you do not accept the license agreement(s), then delete the relevant components from your device.
Successfully installed 'Microsoft.Net.Http 2.2.29'.
Installing 'Newtonsoft.Json 7.0.1'.
Successfully installed 'Newtonsoft.Json 7.0.1'.
Installing 'Google.Apis.Core 1.10.0'.
Successfully installed 'Google.Apis.Core 1.10.0'.
Installing 'log4net 2.0.3'.
Successfully installed 'log4net 2.0.3'.
Installing 'Zlib.Portable.Signed 1.11.0'.
You are downloading Zlib.Portable.Signed from AdvancedREI, onovotny, the license agreement to which is available at http://en.wikipedia.org/wiki/Zlib_License. Check the package for additional dependencies, which may come with their own license agreement(s). Your use of the package and dependencies constitutes your acceptance of their license agreements. If you do not accept the license agreement(s), then delete the relevant components from your device.
Successfully installed 'Zlib.Portable.Signed 1.11.0'.
Installing 'Google.Apis 1.10.0'.
Successfully installed 'Google.Apis 1.10.0'.
Installing 'BouncyCastle 1.7.0'.
Successfully installed 'BouncyCastle 1.7.0'.
Installing 'Google.Apis.Auth 1.10.0'.
Successfully installed 'Google.Apis.Auth 1.10.0'.
Installing 'Google.Apis.Analytics.v3 1.12.0.432'.
Successfully installed 'Google.Apis.Analytics.v3 1.12.0.432'.
Adding 'Microsoft.Bcl 1.1.10' to testing40.
Successfully added 'Microsoft.Bcl 1.1.10' to testing40.
Adding 'Microsoft.Bcl.Async 1.0.168' to testing40.
Successfully added 'Microsoft.Bcl.Async 1.0.168' to testing40.
Adding 'Microsoft.Bcl.Build 1.0.21' to testing40.
Successfully added 'Microsoft.Bcl.Build 1.0.21' to testing40.
Adding 'Microsoft.Net.Http 2.2.29' to testing40.
Successfully added 'Microsoft.Net.Http 2.2.29' to testing40.
Adding 'Newtonsoft.Json 7.0.1' to testing40.
Successfully added 'Newtonsoft.Json 7.0.1' to testing40.
Adding 'Google.Apis.Core 1.10.0' to testing40.
Successfully added 'Google.Apis.Core 1.10.0' to testing40.
Adding 'log4net 2.0.3' to testing40.
Successfully added 'log4net 2.0.3' to testing40.
Adding 'Zlib.Portable.Signed 1.11.0' to testing40.
Successfully added 'Zlib.Portable.Signed 1.11.0' to testing40.
Adding 'Google.Apis 1.10.0' to testing40.
Successfully added 'Google.Apis 1.10.0' to testing40.
Adding 'BouncyCastle 1.7.0' to testing40.
Successfully added 'BouncyCastle 1.7.0' to testing40.
Adding 'Google.Apis.Auth 1.10.0' to testing40.
Successfully added 'Google.Apis.Auth 1.10.0' to testing40.
Adding 'Google.Apis.Analytics.v3 1.12.0.432' to testing40.
Successfully added 'Google.Apis.Analytics.v3 1.12.0.432' to testing40.

I ran a dummy request using Oauth2 credentials (Didn't feel like testing everything else)

var service = Program.AuthenticateOauth(clientId, clientSecret, "Linda");
var lookStuff = service.Management.AccountSummaries.List().Execute();

However I have a question:

Lets say that my imba testing40 application now gets upgraded to .Net framework 4.5 that is after all what we are going to recommend people do. I set the project to framework 4.5 then run it. and it gives me errors

 Get-package -Updates

Doesn't seam to go and grab the 4.5 packages. Any one know how to upgrade the packages to the new framework? I am going to assume someone is going to ask this question on SO.

@mmdriley
Copy link
Contributor Author

mmdriley commented Apr 7, 2016

After changing a project to target net45, I've used this command in the Package Manager Console to reinstall the NuGet packages, adding references to different assemblies as appropriate:
Update-Package -ProjectName <project> -Reinstall

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants