Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions build-tools/xaprepare/xaprepare/Steps/Step_GenerateCGManifest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ protected override async Task<bool> Execute (Context context)
using var json = File.CreateText (jsonPath);

json.WriteLine ("{");
json.WriteLine (" \"Registrations\": [");
json.WriteLine (" \"$schema\": \"https://json.schemastore.org/component-detection-manifest.json\",");
json.WriteLine (" \"version\": 1,");
json.WriteLine (" \"registrations\": [");

var properties = new Dictionary<string, string> ();

Expand Down Expand Up @@ -100,8 +102,8 @@ void WriteComponent (TextWriter json, CGManifestEntry entry, Dictionary<string,
entry.FillComponentProperties (properties);

json.WriteLine ($" {{");
json.WriteLine ($" \"Component\": {{");
json.WriteLine ($" \"Type\": \"{entry.Type.ToLowerInvariant ()}\",");
json.WriteLine ($" \"component\": {{");
json.WriteLine ($" \"type\": \"{entry.Type.ToLowerInvariant ()}\",");
json.WriteLine ($" \"{entry.Type}\": {{");
bool firstProp = true;
foreach (var key in properties.Keys.OrderBy (p => p, StringComparer.OrdinalIgnoreCase)) {
Expand All @@ -116,7 +118,7 @@ void WriteComponent (TextWriter json, CGManifestEntry entry, Dictionary<string,
json.WriteLine ();
json.WriteLine ($" }}");
json.WriteLine ($" }},");
json.WriteLine ($" \"DevelopmentDependency\":{dev}");
json.WriteLine ($" \"developmentDependency\":{dev}");
json.Write ($" }}");
}
}
Expand Down Expand Up @@ -145,7 +147,7 @@ public override string Name {
}
}

public override string Type => "Git";
public override string Type => "git";

public string RepositoryUrl {get; private set;} = String.Empty;
public string CommitHash {get; private set;} = String.Empty;
Expand All @@ -157,8 +159,8 @@ public override string Name {

public override void FillComponentProperties (Dictionary<string, string> properties)
{
properties ["RepositoryUrl"] = RepositoryUrl;
properties ["CommitHash"] = CommitHash;
properties ["repositoryUrl"] = RepositoryUrl;
properties ["commitHash"] = CommitHash;
}

const string Submodule = "submodule.external/";
Expand Down Expand Up @@ -256,7 +258,7 @@ sealed class MSBuildPackageReferenceInfo : CGManifestEntry {
string name;

public override string Name => name;
public override string Type => "Nuget";
public override string Type => "nuget";

public string Version {get; private set;}

Expand All @@ -268,8 +270,8 @@ sealed class MSBuildPackageReferenceInfo : CGManifestEntry {

public override void FillComponentProperties (Dictionary<string, string> properties)
{
properties ["Name"] = Name;
properties ["Version"] = Version;
properties ["name"] = Name;
properties ["version"] = Version;
}

static readonly XNamespace MSBuildXmlns = XNamespace.Get ("http://schemas.microsoft.com/developer/msbuild/2003");
Expand Down