Commit Graph
485 Commits
Author SHA1 Message Date
Justin Van Patten 6a06651851 ZipFile: Reduce allocations in IsDirEmpty
- Use Directory.EnumerateFileSystemEntries to avoid the extra
allocations associated with the FileInfo/DirectoryInfo instance
created by DirectoryInfo.EnumerateFileSystemInfos.
- Use the default overload of EnumerateFileSystemEntries, which uses
SearchOption.TopDirectoryOnly, as SearchOption.AllDirectories is not
necessary here and AllDirectories currently has more allocations than
TopDirectoryOnly on Windows.
- Use the enumerator directly to avoid the unnecessary call to
Current.


Commit migrated from https://github.com/dotnet/corefx/commit/d58c7702905122ff053b6f2b61e88d92e0c4dad3
2015-08-06 14:05:29 -07:00
stephentoub d6467ac0af Use RuntimeInformation across corefx for platform detection
This commit deletes our temporary Interop.PlatformDetection.cs mechanism and replaces usage of it with usage of System.Runtime.InteropServices.RuntimeInformation.dll.


Commit migrated from https://github.com/dotnet/corefx/commit/6861b625b391566544be9a60356c8c03b15e5fb5
2015-08-06 10:25:17 -04:00
Eric Mellino 66969e748b Re-lock dependencies with latest xunit
Commit migrated from https://github.com/dotnet/corefx/commit/795cbc75f8e167047a7c19cd7e21e99b9b9f4308
2015-08-03 16:40:33 -07:00
Eric Mellino 219af47e0c Update test dependencies
Fixes all test warnings about 'different versions of the same dependent
assembly'


Commit migrated from https://github.com/dotnet/corefx/commit/b84f53f744ba0418255cbe471b783dde2a700a8e
2015-08-03 13:44:34 -07:00
Eric Mellino c0015fc582 Move all tests to latest xunit beta
Commit migrated from https://github.com/dotnet/corefx/commit/7c12b0120834f92d5c591124f692ea1b64c6a877
2015-08-03 11:27:48 -07:00
Eric St. John 47aaf9fcf8 Use stable package dependencies and move our packages to post-stable versions
This change modifies the build to consume the stable version where available.

This disables building the dowlevel packages since we shipped them once as stable and we're done.
From here on out, we'll only build the latest version (except for a servicing event, which would
be handled by syncing to a hash).

I can't rev the package versions in the normal way yet (by modifying the assembly version of the contents)
because that turned out to be too big of a problem to tackle in this change. Instead I added a
parameter to the task that calculates package versions to do the rev for anything that was
stable, but only when building the package itself, not when calculating the dependencies.
This has the downside of not permitting a dependency on a incremented pre-release version if we've
shipped a stable version, but that is a small point in time problem until I can rev the assembly
versions.

[tfs-changeset: 1508664]


Commit migrated from https://github.com/dotnet/corefx/commit/ee1ec2891c7c65b46fa9dfb078636be503bb2a60
2015-07-31 15:47:51 -07:00
stephentoub bab02c72eb Ensure all Common includes use a <Link/>
Modifies various .csproj files to ensure that all Includes for files under Common use a <Link/> so that Visual Studio shows the files under a Common folder rather than flattened in the root.

Fixes dotnet/corefx#144


Commit migrated from https://github.com/dotnet/corefx/commit/264d92084d6c6366c3c23edaaab54a32f61d501b
2015-07-15 10:21:33 -04:00
stephentoub b8325ef207 Two minor path-related changes
- System.IO.Compression.ZipFile was unnecessarily including PathInternals.Windows/Unix.cs

- A System.Runtime test for PathTooLongException was passing but for the wrong reason: on Windows it was testing a path longer than max path, whereas on Unix it happened to be passing because of limitations on directory length in a path.  I've tweaked it to avoid assumptions about max path length.

I found these by scrubbing through all of corefx looking for additional uses of max path.  The only other one now outside of System.IO.FileSystem / System.Runtime.Extensions and the associated interop files is in Semaphore, which limits a semaphore name to be MAX_PATH.  We'll need to address that separately when we determine how best to handle named synchronization primitives on Unix (the limit is unlikely to be the MAX_PATH equivalent on Unix.)


Commit migrated from https://github.com/dotnet/corefx/commit/d18f1a39625ce4fad0fe5419eb090332cb2db0e2
2015-07-10 15:29:41 -04:00
Nick Guerrera f11f9a5741 Merge pull request dotnet/corefx#2158 from dotnet-bot/from-tfs
Merge changes from TFS

Commit migrated from https://github.com/dotnet/corefx/commit/f3a7195e5f4a4bfb0cd00cbabe2a3d6059965c91
2015-06-24 17:50:22 -07:00
Nick Guerrera 5290bd052a Merge pull request dotnet/corefx#2156 from nguerrera/update-packages
Update packages to latest

Commit migrated from https://github.com/dotnet/corefx/commit/53b3e95a234ca4d87e42d32d6213b42e54160f4f
2015-06-24 17:49:50 -07:00
Eric St. John 4761fadfd9 Fix style of ZipFile.c_pathSeparator
[tfs-changeset: 1493462]


Commit migrated from https://github.com/dotnet/corefx/commit/5f069b56f722b18dbb4b746b038f6bdf876ff563
2015-06-24 17:10:38 -07:00
Nick Guerrera 4c28436d2e Update package dependency versions
Commit migrated from https://github.com/dotnet/corefx/commit/0c6b87e4e67e80b5d751bcd6883ca6e89fb68157
2015-06-24 14:04:15 -07:00
Eric St. John 718b669fdf Use slash instead of backslash when creating ZipFiles
Per the .ZIP File Format Specification 4.4.17.1 all slashes should be forward slashes, not back slashes.  https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT
This change needs to also be made to desktop and quirked, which is being tracked as a separate bug.

[tfs-changeset: 1493255]


Commit migrated from https://github.com/dotnet/corefx/commit/7b9331e89a795c72709aef38898929e74c343dfb
2015-06-24 10:04:04 -07:00
Matt Mitchell 9d11745057 Update build tools. Contains changes to support FreeBSD in xunit.
Float package versions to get the latest version of the netcore extensions (has FreeBSD support)


Commit migrated from https://github.com/dotnet/corefx/commit/c760824a531ffc3981148a8ef9b97f56af9ff643
2015-06-23 16:06:50 -07:00
Eric StJohn 1a58e04134 Update corefx packages to version 23011
Commit migrated from https://github.com/dotnet/corefx/commit/3bb2f035a7c1f6168a6bd34fbf3851f7eedf76bf
2015-06-19 16:33:53 -07:00
stephentoub 8eeec0143e Remove <AllowUnsafeBlocks/> from various test projects
Most test projects don't need unsafe code, but many were forced to allow unsafe blocks due to Interop.PlatformDetection.cs using pointers, and others were allowing it for no apparent reason.  I've modified Interop.PlatformDetection.cs to not use unsafe code, and updated the relevant test projects accordingly. (Eventually we'll switch it over to using the new RuntimeInformation assembly, anyway.)


Commit migrated from https://github.com/dotnet/corefx/commit/3ae04f6ec948331c85c5f8441cd6d9eda868603f
2015-06-16 09:59:32 -04:00
Jan Henke e132e05058 Add FreeBSD references to System.IO.Compression.ZipFile assembly.
Commit migrated from https://github.com/dotnet/corefx/commit/0d78900c0db2679ceec10dbfb3a68d6d3720ae5e
2015-06-14 22:05:53 +02:00
stephentoub 92e0e0a8f3 Refactor PathInternal.*.cs partial files
To better support additional platform implementations and to help the FreeBSD port folks make forward progress, I'm refactoring our PathInternal.*.cs files to make it easier to share portions of it across platforms.


Commit migrated from https://github.com/dotnet/corefx/commit/f16697a6d6195fc1162c3691eb8c4be0388780f7
2015-06-14 14:23:00 -04:00
stephentoub 68b0c18d2d Update all project.lock.json files
Used:
build.cmd /t:RestorePackage /p:LockDependencies=true


Commit migrated from https://github.com/dotnet/corefx/commit/76fcb7ab9444f68577ca0ec17055ca8c4e574b75
2015-06-10 10:19:11 -04:00
stephentoub 8cf85d2d52 Modify ZipFile tests to remove temporary garbage
The System.IO.Compression.ZipFile tests were leaving behind lots of temporary files and directories.  I've modified the tests to delete these when the tests completes.

As long as I was modifying the tests, I also boosted the code coverage of ZipFile and ZipFileExtensions to 100% (the library itself isn't at 100% because of the SR file and some unused code in a shared common file).

And I fixed up a few "String"=>"string"s I saw along the way.


Commit migrated from https://github.com/dotnet/corefx/commit/28d96af2ccd6d1f2e3f0ce4788fc8ec21fd15a76
2015-06-06 18:32:55 -04:00
stephentoub 200cfdfdb7 Update project.jsons to use xunit.netcore.extensions "1.0.0-prerelease-*"
Some of the project.json files were referencing xunit.netcore.extensions with ""1.0.0-prerelease" rather than "1.0.0-prerelease-*".  As a result, I was unable to use more recent additions, like PlatformID.AnyUnix.  This change just updates them to use the -* versions, and changes the few remaining places that were using PlatformID.Linux | PlatformID.OSX to instead use PlatformID.AnyUnix.  The project.lock.json files were automatically updated by my building locally.


Commit migrated from https://github.com/dotnet/corefx/commit/f28722e261368de16adc2600fa1f1d3c0993ee8d
2015-06-03 12:31:17 -04:00
Eric StJohn e8454e28a5 Update projects to latest CoreFx packages
This is the result of build /t:RestorePackages /p:LockDependencies=true from the root.

This adds all missing project.lock.json files and updates existing ones to the latest package versions.


Commit migrated from https://github.com/dotnet/corefx/commit/38e0d2a0f8513afe6dc7d86a67e5776ab7b99df1
2015-05-27 12:18:06 -07:00
Eric St. John a8788d6383 Lock dependencies to ensure we build against a predictable package version
This change adds the lock files to repo to ensure we build against a stable set of dependencies.  To explicitly update dependencies use build.cmd /T:RestorePackages /P:LockDependencies=true and this will pick up the latest depenedencies.

Existing projects adding new dependencies will automatically update the lock file incrementally.

New projects should make sure to check their lock file in with locked set to true.

[tfs-changeset: 1474296]


Commit migrated from https://github.com/dotnet/corefx/commit/d2fbc005707933db1cebca035d6cd6073af6cae4
2015-05-21 15:23:27 -07:00
Eric St. John de6614c63a Update to latest CoreFx packages
Latest packages are now on dotnet-core myget feed.

This should address a many of the warnings in the build.  I will follow up with another change to address the rest.

This change brings in the latest build tools with updates to consume "latest" packages (* versions).

I've updated every project in the repo to use * versioning for dependencies.

The new packages can be used to resolve runtime assets as well (like clrcompression.dll) so I have removed the custom code in System.IO.Compression to copy this dll.  Instead the test project references the actual System.IO.Compression package and sets the correct runtime IDs to pull out the resources.  The System.IO.Compression.dll from the package is not used since the project reference takes precedence.

I had to workaround an issue in System.Xml.XmlSerializer with the current packages: System.Runtime.WindowsRuntime 4.0.0 has a depedendency on "windows" package which doesn't exist.  This was caused by our auto-generation task not filtering the winrt reference in the reference assembly's surface area.  I've fixed this in a separate change and we can remove the workaround once we have a new set of packages.  https://github.com/dotnet/corefx/issues/1761

I also had to add a dependency to System.Security.Cryptography.Hashing.Algorithms\tests due to an issue with DNX.  It's not honoring the dependency group with no targetFramework when another dependency group exists in the nuspec.  This is inconsistent with nuget v2 and should be fixed in DNX.  https://github.com/aspnet/dnx/issues/1881

[tfs-changeset: 1471885]


Commit migrated from https://github.com/dotnet/corefx/commit/08c0d8628ef621fbd44d7aaa85b3239616a6b108
2015-05-15 12:40:33 -07:00
Lakshmi Priya Sekar 2a499c5cbf Remove XunitTraitDiscoverers from corefx and reference the nuget package xunit.netcore.extensions.
Commit migrated from https://github.com/dotnet/corefx/commit/03e32211d668ee215f32c599849987cb7d9d4e2a
2015-05-07 16:15:32 -07:00
Eric StJohn 5db3ae33bf Convert all remaining package dependencies to project.json
DNX and BuildTools now support all of the nuget v2 conventions that we depend on so we can
move all remaining nuget v2 packages to the project.json file and eliminate packages.config.

This change also adds "frameworks" to the project.json so that dnu restore can calculate
applicable assets.  I am not yet using "runtimes" in the project.json since we are still resolving
our runtime assets manually (eg: build tools copies known files from packages).  A future
change will move us to using our runtime packages and add runtimes sections to projects
as appropriate.


Commit migrated from https://github.com/dotnet/corefx/commit/eb35a304c7e89e8b4335ed13c5d23706360d49a4
2015-05-05 12:36:57 -07:00
Stephen Toub 964b3dea7d Add PlatformID.AnyUnix
There are ~110 tests that have been disabled with an ActiveIssue for PlatformID.Linux | PlatformID.OSX.  To simplify this and to avoid lots of additional churn when additional Unix-based platforms are added, I've added PlatformID.AnyUnix = Linux | OSX, and replaced all usage of Linux | OSX with just AnyUnix.  When new platforms are added, we can simply add to the enum, expand the meaning of AnyUnix, and most tests meant to be disabled for Unix will automatically be disabled.


Commit migrated from https://github.com/dotnet/corefx/commit/c96932da11940e0bae05de8e364eac90a6e1786b
2015-04-29 07:22:40 -04:00
Stephen Toub 3d0b5d9428 Disable Unicode compression tests failing in CI
In dotnet/corefx#1523 I re-enabled several compression tests that we'd previously disabled due to the default string marshaling encoding on Linux not being UTF8, and once it was, these tests were passing for me locally.  However, there's obviously some difference between my machine setup and the CI machine setup that's causing these Unicode tests to fail during CI but not for me locally.  Since we know we need a complete globalization implementation on Linux and OSX (dotnet/corefx#846) such that it's not surprising these tests are failing (it's more surprising they're passing for me locally), I'm disabling these Unicode tests on all but Windows for now.  This commit disables not only those from dotnet/corefx#1523 but all of the tests using the unicode.zip file.


Commit migrated from https://github.com/dotnet/corefx/commit/185667984a6b3175e28806304b756eb95730a6f1
2015-04-27 16:29:05 -04:00
Stephen Toub 743f6eba73 Replace a few more asserts with Debug.Assert
Some more Contract.Assert calls have snuck in.  As with the others and for consistency across corefx, replacing them with Debug.Assert.

Eventually we'll want a Roslyn analyzer to flag these.


Commit migrated from https://github.com/dotnet/corefx/commit/41fb9665e15d61b2796383c4bc7f5d9d352e77ab
2015-04-24 08:24:49 -04:00
Stephen Toub 728f66e386 Merge pull request dotnet/corefx#1495 from stephentoub/zipfile_tests
Fix casing failures in ZipFile tests on Linux

Commit migrated from https://github.com/dotnet/corefx/commit/e7ae55631b3cbb9cb9b26ea013981b87e4bb5b4e
2015-04-24 07:03:04 -04:00
Stephen Toub cf28068f87 Add .sln for System.IO.Compression.ZipFile
And fix the associated platform options for the src .csproj.


Commit migrated from https://github.com/dotnet/corefx/commit/816b84b9cc281e71c99d258ebf29940f4463832a
2015-04-23 22:09:11 -04:00
Stephen Toub 4507de6294 Fix casing failures in ZipFile tests on Linux
A few of the System.IO.Compression.ZipFile tests are failing on Linux due to casing differences between the file names in the archives and those used in the tests.  This just tweaks the names in the tests to match.


Commit migrated from https://github.com/dotnet/corefx/commit/6ce9bb6d57067c931838d17394a40ed8b9a4a44c
2015-04-23 22:01:21 -04:00
Matt Cohn f91f684fb6 Move file system case sensitivity policy to common source
Move the file system case sensitivity policy from an internal
FileSystem property to the common linked-source internal class
PathInternals.  This allows System.IO.Compression.ZipFile to use
the same policy.  We will need to update this when we add the ability
to detect the case sensitivity of the file system, rather than
assuming based on operating system.


Commit migrated from https://github.com/dotnet/corefx/commit/aa6a0d40d2abd6b2ebdac0234d3dfc73aae35b12
2015-04-21 15:41:30 -07:00
Matt Cohn 0c598853ef Simplify error handling in ZipFile (no desired behavior change)
Commit migrated from https://github.com/dotnet/corefx/commit/b6d349b2becac28d66b13892d86cec474b4e3326
2015-04-21 15:41:29 -07:00
dotnet-bot 0da83498b5 Initial commit of System.IO.Compression.ZipFile product and tests
Commit migrated from https://github.com/dotnet/corefx/commit/ba89471a316353f45601b3e271f589090eb0b612
2015-04-21 15:41:22 -07:00