Skip to content

Commit

Permalink
Merge pull request #48 from blipson89/releases/release-2.1.0
Browse files Browse the repository at this point in the history
Releases/release 2.1.0
  • Loading branch information
blipson89 committed Oct 9, 2021
2 parents a598d9d + 08627e0 commit 57a1c45
Show file tree
Hide file tree
Showing 28 changed files with 449 additions and 183 deletions.
20 changes: 15 additions & 5 deletions build.yaml
Expand Up @@ -4,12 +4,22 @@ pool:
jobs:
- job: Build
steps:
- task: GitVersion@5
- task: gitversion/setup@0
inputs:
runtime: 'core'
versionSpec: '5.x'
- task: gitversion/execute@0
displayName: "Update SharedAssemblyInfo version"
inputs:
useConfigFile: true
configFilePath: 'GitVersion.yml'
additionalArguments: '/updateassemblyinfo .\src\SharedAssemblyInfo.cs'
- task: gitversion/execute@0
displayName: "Update dotnet csproj assembly version"
inputs:
targetPath: '$(Build.SourcesDirectory)'
useConfigFile: true
configFilePath: 'GitVersion.yml'
updateAssemblyInfo: true
updateAssemblyInfoFilename: 'src/SharedAssemblyInfo.cs'
additionalArguments: '/updateprojectfiles'
- task: DotNetCoreCLI@2
displayName: "Dotnet Restore"
inputs:
Expand All @@ -31,7 +41,7 @@ jobs:
includeSymbols: true
nobuild: true
- task: DotNetCoreCLI@2
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main'))
condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'), startsWith(variables['Build.SourceBranch'], 'refs/heads/releases/')))
displayName: "Push to Artifact feed"
inputs:
command: 'push'
Expand Down
3 changes: 3 additions & 0 deletions src/Leprechaun.Cli/ConsoleArgs.cs
Expand Up @@ -25,5 +25,8 @@ class ConsoleArgs : IRuntimeArgs

[ValueArgument(typeof(string), 'p', "plugins", Description = "Path to the folder where plugins will be located. ./Leprechaun")]
public string PluginPath { get; set; }

[SwitchArgument('d', "debug", false, Description = "Prints out full stack traces for exceptions")]
public bool Debug { get; set; }
}
}
10 changes: 10 additions & 0 deletions src/Leprechaun.CodeGen.Roslyn/CSharpScriptCodeGeneratorContext.cs
@@ -1,4 +1,6 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Text;
using Leprechaun.Logging;
using Leprechaun.Model;
Expand All @@ -13,6 +15,12 @@ public CSharpScriptCodeGeneratorContext(ConfigurationCodeGenerationMetadata meta
{
Log = logger;
_metadata = metadata;
Version = GetVersion();
}

private string GetVersion()
{
return FileVersionInfo.GetVersionInfo(Assembly.GetEntryAssembly().Location).FileVersion;
}

public IReadOnlyCollection<TemplateCodeGenerationMetadata> Templates => _metadata.Metadata;
Expand All @@ -24,5 +32,7 @@ public CSharpScriptCodeGeneratorContext(ConfigurationCodeGenerationMetadata meta
public ILogger Log { get; }

public StringBuilder Code { get; } = new StringBuilder();

public string Version { get; }
}
}
Expand Up @@ -11,6 +11,7 @@
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Provides code generation to Leprechaun using C# scripts, executed with Roslyn.</description>
<tags>sitecore codegen leprechaun</tags>
<copyright>©2021 Ben Lipson</copyright>
<dependencies>
<dependency id="Leprechaun" version="$version$" />
</dependencies>
Expand Down

0 comments on commit 57a1c45

Please sign in to comment.