Skip to content

Commit

Permalink
Adding support for multiple URLs in new and update command (#102)
Browse files Browse the repository at this point in the history
* Starting

* working on it

* More

* More

* .

* Close

* Working!

* Adding better error for missing package

* PR feedback

* Updating notice, pipeline, and wingetcreate version

* Adding negative tests for various unmatched states, and fixing unmatched state reporting

* add multifile test to E2Etest

* change msix to multifile

* revert to commit  ad30c28

* revert to old setmockhttpresponsecontent

* copy always

* modify hash method

* comment out failing test

Co-authored-by: Ryan Fu <ryfu@microsoft.com>
  • Loading branch information
palenshus and ryfu-msft authored Jul 3, 2021
1 parent cd54329 commit 457094c
Show file tree
Hide file tree
Showing 30 changed files with 1,575 additions and 1,183 deletions.
31 changes: 0 additions & 31 deletions NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -502,37 +502,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


---------------------------------------------------------

---------------------------------------------------------

Microsoft.Windows.CsWinRT 1.2.3 - MIT



MIT License

Copyright (c) Microsoft Corporation.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE


---------------------------------------------------------

---------------------------------------------------------
Expand Down
8 changes: 4 additions & 4 deletions pipelines/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
revision: $[counter(variables['majorMinorBuildVersion'], 1)]

version: "$(majorMinorBuildVersion).$(revision)"
appxBundlePath: '$(appxPackageDir)\Microsoft.WindowsPackageManagerManifestCreator_$(version)_8wekyb3d8bbwe.appxbundle'
appxBundlePath: '$(appxPackageDir)\Microsoft.WindowsPackageManagerManifestCreator_$(version)_8wekyb3d8bbwe.msixbundle'
pool:
vmImage: $(vmImageName)

Expand Down Expand Up @@ -103,8 +103,8 @@ jobs:
/p:AppxPackageSigningEnabled=false'

- publish: $(appxBundlePath)
artifact: appxbundle
displayName: Publish appx bundle
artifact: msixbundle
displayName: Publish msix bundle

- task: ComponentGovernanceComponentDetection@0
displayName: Component Governance
Expand Down Expand Up @@ -139,6 +139,6 @@ jobs:
displayName: Run Tests
inputs:
testSelector: "testAssemblies"
testAssemblyVer2: 'src\WingetCreateTests\WingetCreateTests\bin\$(buildPlatform)\$(buildConfiguration)\net5.0-windows10.0.18362.0\WingetCreateTests.dll'
testAssemblyVer2: 'src\WingetCreateTests\WingetCreateTests\bin\$(buildPlatform)\$(buildConfiguration)\net5.0-windows10.0.17763.0\WingetCreateTests.dll'
runSettingsFile: 'src\WingetCreateTests\WingetCreateTests\Test.runsettings'
overrideTestrunParameters: '-WingetPkgsTestRepoOwner microsoft -WingetPkgsTestRepo winget-pkgs-submission-test -GitHubAppPrivateKey "$(GitHubApp_PrivateKey)"'
25 changes: 24 additions & 1 deletion src/WingetCreateCLI/Commands/BaseCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,29 @@ protected static async Task<string> DownloadPackageFile(string installerUrl)
}
}

/// <summary>
/// Download all packages specified by urls, and return list of downloaded file paths.
/// </summary>
/// <param name="urls">Urls for packages to download.</param>
/// <returns>List of file paths downloaded.</returns>
protected static async Task<IList<string>> DownloadInstallers(IEnumerable<string> urls)
{
var packageFiles = new List<string>();

foreach (var url in urls)
{
string packageFile = await DownloadPackageFile(url);
if (string.IsNullOrEmpty(packageFile))
{
return null;
}

packageFiles.Add(packageFile);
}

return packageFiles;
}

/// <summary>
/// Utilizes WingetUtil to validate a specified manifest.
/// </summary>
Expand Down Expand Up @@ -356,7 +379,7 @@ protected async Task<bool> GitHubSubmitManifests(Manifests manifests, string tok

if (this.OpenPRInBrowser)
{
Process.Start(new ProcessStartInfo(pullRequest.HtmlUrl) { UseShellExecute = true });
GitHubOAuth.OpenWebPage(pullRequest.HtmlUrl);
}

Logger.InfoLocalized(nameof(Resources.PullRequestURI_Message), pullRequest.HtmlUrl);
Expand Down
Loading

0 comments on commit 457094c

Please sign in to comment.