Skip to content

Commit

Permalink
1.17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
frhagn committed Dec 7, 2017
1 parent f60302d commit 050014d
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 6 deletions.
9 changes: 9 additions & 0 deletions docs/pages/changelog.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,15 @@
<div class="col-sm-10 col-sm-push-1">
<h1>Change log</h1>

<h3>Typewriter 1.17</h3>
<p class="lead">Option to not add generated files to the current project.</p>

<h4>1.17.0</h4>
<ul>
<li>Added option to not add generated files to the current project. (<a href="https://github.com/frhagn/Typewriter/pull/242">#242</a>)<br />
(Note: Typewriter will be unable to track generated files that's not added to the project.)</li>
</ul>

<h3>Typewriter 1.16</h3>
<p class="lead">Support for generating ValueTuples.</p>

Expand Down
18 changes: 15 additions & 3 deletions src/Typewriter/Generation/Template.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,12 @@ protected virtual void SaveFile(File file, string output, ref bool success)

var hasChanged = HasChanged(outputPath, output);

if (!ExtensionPackage.Instance.Options.AddGeneratedFilesToProject)
if (ExtensionPackage.Instance.Options.AddGeneratedFilesToProject == false)
{
if (hasChanged)
{
WriteFile(outputPath, output);
Log.Info($"Output file {outputPath} had been wrote.");
Log.Debug($"Output file '{outputPath}' saved.");
}
return;
}
Expand All @@ -172,7 +172,19 @@ protected virtual void SaveFile(File file, string output, ref bool success)
{
CheckOutFileFromSourceControl(outputPath);
WriteFile(outputPath, output);
item = FindProjectItem(outputPath) ?? _projectItem.ProjectItems.AddFromFile(outputPath);
item = FindProjectItem(outputPath);

if (item == null)
{
try
{
item = _projectItem.ProjectItems.AddFromFile(outputPath);
}
catch (Exception exception)
{
Log.Error($"Unable to add '{outputPath}' to project. {exception.Message}");
}
}
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion src/Typewriter/Properties/SharedAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@

[assembly: NeutralResourcesLanguage("en-US")]

[assembly: AssemblyVersion("1.16.0.*")]
[assembly: AssemblyVersion("1.17.0.*")]
2 changes: 1 addition & 1 deletion src/Typewriter/VisualStudio/ExtensionPackage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace Typewriter.VisualStudio
[Guid(Constants.ExtensionPackageId)]
[PackageRegistration(UseManagedResourcesOnly = true)]
[ProvideAutoLoad(VSConstants.UICONTEXT.SolutionExists_string)]
[InstalledProductRegistration("#110", "#112", "1.16.0", IconResourceID = 401)]
[InstalledProductRegistration("#110", "#112", "1.17.0", IconResourceID = 401)]
[ProvideLanguageService(typeof(LanguageService), Constants.LanguageName, 100, DefaultToInsertSpaces = true)]
[ProvideLanguageExtension(typeof(LanguageService), Constants.TemplateExtension)]
[ProvideMenuResource("Menus.ctmenu", 1)]
Expand Down
2 changes: 1 addition & 1 deletion src/Typewriter/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="45b6b392-ce2f-409c-a39f-bbf90b34349e" Version="1.16.0" Language="en-US" Publisher="frhagn" />
<Identity Id="45b6b392-ce2f-409c-a39f-bbf90b34349e" Version="1.17.0" Language="en-US" Publisher="frhagn" />
<DisplayName>Typewriter</DisplayName>
<Description xml:space="preserve">Typewriter generates TypeScript files from c# code files using TypeScript Templates. This allows you to create fully typed TypeScript representations of server side API that automatically updates when you make changes to your c# code.</Description>
<MoreInfo>http://frhagn.github.io/Typewriter/</MoreInfo>
Expand Down

0 comments on commit 050014d

Please sign in to comment.