Skip to content

Commit

Permalink
fixed multi ApiStudio code generation (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
arbs-io authored Jun 9, 2022
1 parent 364819c commit ab9cc2c
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 3 deletions.
Binary file modified api-studio.package-build.json
Binary file not shown.
4 changes: 3 additions & 1 deletion src/api-studio.code-generation/ApiStudioCompiler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,12 @@ private static void RemoveMissingItems(DTE dte, string apiStudioFilePath, CodeGe
var directoryInfo = new FileInfo(apiStudioFilePath).Directory;
if (directoryInfo != null)
{
// Only check for existing ApiStudio related file for the current model.
var modelName = Path.GetFileNameWithoutExtension(apiStudioFilePath);
var sourceDirectory = directoryInfo.FullName;
var ext = new List<string> { "cs" };
var existingFiles = Directory
.EnumerateFiles(sourceDirectory, "*.*", SearchOption.AllDirectories)
.EnumerateFiles(sourceDirectory, $"{modelName}*.*", SearchOption.AllDirectories)
.Where(s => ext.Contains(Path.GetExtension(s).TrimStart('.').ToLowerInvariant()))
.ToList();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ internal static List<SourceCodeEntity> Build(ApiStudio eai, string modelName)
.Replace("{{TOKEN_OAS_CONTACT_NAME}}", eai?.ContactName);

sourceList.Add(
new SourceCodeEntity($"{modelName}.OpenApiConfigurationOptions.cs", output, true));
new SourceCodeEntity("ApiStudio.OpenApiConfigurationOptions.cs", output, true));

return sourceList;
}
Expand Down
2 changes: 1 addition & 1 deletion src/api-studio.package/source.extension.vsixmanifest
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
<Metadata>
<Identity Id="4a6ef9c8-3428-4bd6-9b17-c57b4285bbd8" Version="2022.6.6.1324" Language="en-US" Publisher="Andrew Butson" />
<Identity Id="4a6ef9c8-3428-4bd6-9b17-c57b4285bbd8" Version="2022.6.9.1405" Language="en-US" Publisher="Andrew Butson" />
<DisplayName>Api Studio Extension for Visual Studio</DisplayName>
<Description xml:space="preserve">Api Studio is a productivity extension for Microsoft Visual Studio. The extension bridges the role of architect and developer, providing rapid prototyping and promoting industry best practices.</Description>
<PackageId>ApiStudio.VisualStudio</PackageId>
Expand Down
1 change: 1 addition & 0 deletions tools/vsixsigntool/vsix-sign.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ OpenVsixSignTool sign --sha1 1b2c3f93680cb70e928e7e2292aa9a1741d0df98 --timestam
$vsixHash = [PSCustomObject]@{}

Add-NoteProperty -InputObject $vsixHash -Property "signing.vsix" -Value "api-studio.package.vsix"
Add-NoteProperty -InputObject $vsixHash -Property "signing.version" -Value "manual-verification"
Add-NoteProperty -InputObject $vsixHash -Property "signing.timestamp" -Value (Get-Date -Format o | ForEach-Object { $_ -replace ":", "." })
Add-NoteProperty -InputObject $vsixHash -Property "hash.sha1" -Value (Get-FileHash $vsix -Algorithm SHA1).Hash
Add-NoteProperty -InputObject $vsixHash -Property "hash.sha256" -Value (Get-FileHash $vsix -Algorithm SHA256).Hash
Expand Down

0 comments on commit ab9cc2c

Please sign in to comment.