Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
jskeet committed Dec 12, 2024
1 parent e7e1cbb commit 2bd7db2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ private int BuildUnconfigured(Dictionary<string, string> options, string generat
FileName = "/usr/bin/dotnet",
WorkingDirectory = apiRoot
};
var processArguments = new List<string> { "dotnet", relativeDirectory };
var processArguments = new List<string> { "build", relativeDirectory };
processArguments.ForEach(psi.ArgumentList.Add);

var process = Process.Start(psi)!;
Expand Down
13 changes: 9 additions & 4 deletions tools/Google.Cloud.Tools.ReleaseManager/GenerateApisCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,14 @@ private int ExecuteForUnconfigured(string[] args)
}
Directory.CreateDirectory(tempOutputDirectory);

// Extract CommonResourcesConfig.json from this assembly, and dump it in the temp output directory.
// This isn't great, but it's the only way of generating unconfigured without causing other problems.
using (var commonResourcesInput = typeof(GenerateApisCommand).Assembly.GetManifestResourceStream("Google.Cloud.Tools.ReleaseManager.CommonResourcesConfig.json"))
{
using var commonResourcesOutput = File.Create(Path.Combine(tempOutputDirectory, "CommonResourcesConfig.json"));
commonResourcesInput.CopyTo(commonResourcesOutput);
}

foreach (var arg in args)
{
GenerateUnconfigured(arg);
Expand Down Expand Up @@ -500,10 +508,7 @@ private void GenerateUnconfigured(string arg)
yield return ("transport", "grpc");
yield return ("rest-numeric-enums", "True");
yield return ("service-config", configFiles[0]);
// We may not have a CommonResourceConfig.json file, unless we bake that into this tool or the generator image.
// It shouldn't stop anything from working; it just reduces the similarity between configured/unconfigured generation.
// TODO: Work out what to do about this.
// yield return ("common-resources-config", "CommonResourcesConfig.json");
yield return ("common-resources-config", Path.Combine(tempOutputDirectory, "CommonResourcesConfig.json"));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<ProjectReference Include="..\Google.Cloud.Tools.Common\Google.Cloud.Tools.Common.csproj" />
<ProjectReference Include="..\Google.Cloud.Tools.VersionCompat\Google.Cloud.Tools.VersionCompat.csproj" />
<EmbeddedResource Include="History/*.json" />
<EmbeddedResource Include="..\..\generator-input\CommonResourcesConfig.json" />

<!--
- Refer to Grpc.Net.Client explicitly, so that smoke tests load the same TFM as
Expand Down

0 comments on commit 2bd7db2

Please sign in to comment.