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 vcxproj for yaml-cpp and add manifest helper lib with tests #14

Merged
merged 11 commits into from Dec 20, 2019

Conversation

yao-msft
Copy link
Contributor

This makes yaml-cpp code compiled as part of the AppInstallerClient solution.

@yao-msft yao-msft requested a review from a team as a code owner December 17, 2019 19:40
@@ -0,0 +1,12 @@
Do not change code under yaml-cpp directory. yaml-cpp directory contains yaml-cpp source code from https://github.com/jbeder/yaml-cpp.
Copy link
Member

@JohnMcPMS JohnMcPMS Dec 17, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do [](start = 0, length = 2)

Please rename to README.md and use markdown #Closed

<PlatformToolset>v140</PlatformToolset>
<PlatformToolset Condition="'$(VisualStudioVersion)' == '15.0'">v141</PlatformToolset>
<PlatformToolset Condition="'$(VisualStudioVersion)' == '16.0'">v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
Copy link
Member

@JohnMcPMS JohnMcPMS Dec 17, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CharacterSet [](start = 5, length = 12)

Please set the build to use C++17. If that does not work, we will need to investigate link compatibility. #Closed

@JohnMcPMS
Copy link
Member

JohnMcPMS commented Dec 17, 2019

You will need to update cgmanifest in the root to include this new dependency. #Closed

@JohnMcPMS
Copy link
Member

JohnMcPMS commented Dec 17, 2019

Please add at least a test binary that invokes this code to ensure that it is building and working properly. #Closed

Copy link
Member

@JohnMcPMS JohnMcPMS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🕐

@yao-msft
Copy link
Contributor Author

Chatted I'll check in this together with manifesthelper lib


In reply to: 566740080 [](ancestors = 566740080)

@yao-msft
Copy link
Contributor Author

yao-msft commented Dec 19, 2019

platform: 'x86'

John, is this a mistake we only build x86 here?
#WontFix


Refers to: azure-pipelines.yml:29 in a314fa1. [](commit_id = a314fa1, deletion_comment = False)

@yao-msft yao-msft changed the title Create vcxproj for yaml-cpp Create vcxproj for yaml-cpp and add manifest helper lib with tests Dec 19, 2019
@JohnMcPMS
Copy link
Member

platform: 'x86'

The packages get built in all of those from 'buildPlatform', but anything outside of those will be built x86. I haven't invested much into getting this exactly right atm.


In reply to: 567629920 [](ancestors = 567629920)


Refers to: azure-pipelines.yml:29 in a314fa1. [](commit_id = a314fa1, deletion_comment = False)

YAML::Node installerNode = installersNode[i];
ManifestInstaller installer;
installer.PopulateInstallerFields(installerNode);
this->Installers.push_back(installer);
Copy link
Member

@JohnMcPMS JohnMcPMS Dec 19, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

push_back [](start = 29, length = 9)

Use 'emplace_back(std::move(installer))' so that we don't have to make copies of all the strings #Resolved

#include "manifest.h"

// TODO: This is an example of a library function
void fnPackageManifestHelper()
Copy link
Member

@JohnMcPMS JohnMcPMS Dec 19, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fnPackageManifestHelper [](start = 5, length = 23)

What is this for? #Resolved

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Accidentally checked in, I thought I had removed it. I'll remove in the next push


In reply to: 360134880 [](ancestors = 360134880)


#include "pch.h"
#include "framework.h"
#include "yaml-cpp\yaml.h"
Copy link
Member

@JohnMcPMS JohnMcPMS Dec 19, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"yaml-cpp\yaml.h" [](start = 9, length = 17)

This should go into the pch #Resolved

{
Manifest manifest = Manifest::CreatePackageManifest("GoodManifest.yml");

REQUIRE(manifest.Id.compare("microsoft.msixsdk") == 0);
Copy link
Member

@JohnMcPMS JohnMcPMS Dec 19, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

compare [](start = 24, length = 7)

Do no use compare for this, simply do 'manifest.Id == "microsoft.msixsdk"' #Resolved


using namespace AppInstaller::Package::Manifest;

TEST_CASE("Read good package manifest and verify contents", "[PackageManifestHelper]")
Copy link
Member

@JohnMcPMS JohnMcPMS Dec 19, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read good package manifest and verify contents [](start = 11, length = 46)

This is the test case name, lets not put spaces in it. #Resolved

// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
#include "pch.h"
#include "yaml-cpp\yaml.h"
Copy link
Member

@JohnMcPMS JohnMcPMS Dec 19, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put in the pch #Resolved

std::string Version;

// Name subject to change
std::string ShortId;
Copy link
Contributor

@ranm-msft ranm-msft Dec 19, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ShortId [](start = 20, length = 7)

please add explanation + example #WontFix

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't the location for that kind of documentation.


In reply to: 360142170 [](ancestors = 360142170)

using namespace winrt;
using namespace Windows::Foundation;

int main(int argc, char** argv)
Copy link
Member

@JohnMcPMS JohnMcPMS Dec 19, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

main [](start = 4, length = 4)

Sooooo, I'm now thinking maybe we should collapse down to a single test binary... I'm not sure its worth it to have separate ones. #Resolved

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want me to do it now or later


In reply to: 360143037 [](ancestors = 360143037)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now is fine. If you want to just put the tests and TestData into the existing one, I can rename it in my PR once I merger your change in.


In reply to: 360147613 [](ancestors = 360147613,360143037)

}

Manifest Manifest::CreatePackageManifest(const std::string& inputFile)
{
Copy link
Contributor

@ranm-msft ranm-msft Dec 19, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{ [](start = 4, length = 1)

Add logging throughout the project ex. file path #Pending

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently only tracelogging is enabled. we'll add a logger wrapper and log in a following PR


In reply to: 360160037 [](ancestors = 360160037)

#include "ManifestInstaller.h"
#include "ManifestLocalization.h"

namespace AppInstaller::Package::Manifest
Copy link
Member

@JohnMcPMS JohnMcPMS Dec 19, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Package::Manifest [](start = 24, length = 17)

Could we just name this part YAML #Resolved

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Chatted offline and we'll use AppInstaller::Manifest


In reply to: 360168250 [](ancestors = 360168250)

Copy link
Member

@JohnMcPMS JohnMcPMS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@JohnMcPMS JohnMcPMS merged commit 595bb47 into microsoft:master Dec 20, 2019
@yao-msft yao-msft deleted the vcproj branch December 21, 2019 00:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants