Skip to content

Commit

Permalink
Merge pull request #134 from Lombiq/issue/OSOE-819-re
Browse files Browse the repository at this point in the history
OSOE-819: Use source generator for version
  • Loading branch information
sarahelsaig committed May 3, 2024
2 parents 8b0e6fa + cf6a1b5 commit bb8f5f0
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
19 changes: 19 additions & 0 deletions Lombiq.VueJs/Lombiq.VueJs.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,17 @@
<DefaultItemExcludes>$(DefaultItemExcludes);.git*;node_modules\**</DefaultItemExcludes>
</PropertyGroup>

<PropertyGroup>
<SourceGeneratorLocation>$(SolutionDir)src\Libraries\Lombiq.HelpfulLibraries\Lombiq.HelpfulLibraries.SourceGenerators\bin\Debug\netstandard2.0\Lombiq.HelpfulLibraries.SourceGenerators.dll</SourceGeneratorLocation>
<SourceGeneratorLocation Condition=" '$(Configuration)' != 'Debug' ">
$(SolutionDir)src\Libraries\Lombiq.HelpfulLibraries\Lombiq.HelpfulLibraries.SourceGenerators\bin\Release\netstandard2.0\Lombiq.HelpfulLibraries.SourceGenerators.dll
</SourceGeneratorLocation>
</PropertyGroup>

<Target Name="CustomBeforeCompile" BeforeTargets="Compile">
<MSBuild Condition="!Exists('$(SourceGeneratorLocation)')" Projects="..\..\..\Libraries\Lombiq.HelpfulLibraries\Lombiq.HelpfulLibraries.SourceGenerators\Lombiq.HelpfulLibraries.SourceGenerators.csproj" />
</Target>

<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
Expand Down Expand Up @@ -61,11 +72,19 @@
<PackageReference Include="Lombiq.NodeJs.Extensions" Version="2.1.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\Libraries\Lombiq.HelpfulLibraries\Lombiq.HelpfulLibraries.Attributes\Lombiq.HelpfulLibraries.Attributes.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="true" />
<ProjectReference Include="..\..\..\Libraries\Lombiq.HelpfulLibraries\Lombiq.HelpfulLibraries.SourceGenerators\Lombiq.HelpfulLibraries.SourceGenerators.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
</ItemGroup>

<Import Condition="'$(NuGetBuild)' != 'true'" Project="..\..\..\Utilities\Lombiq.NodeJs.Extensions\Lombiq.NodeJs.Extensions\Lombiq.NodeJs.Extensions.targets" />

<!-- Execute Lombiq.NodeJs separately, to avoid inheriting these instructions in projects that consume Lombiq.VueJs. -->
<Target Name="BuildLocalScripts" AfterTargets="NpmInstall">
<Exec Command="npm explore nodejs-extensions -- pnpm build" />
</Target>

<ItemGroup>
<AdditionalFiles Include="package.json"/>
</ItemGroup>
</Project>
8 changes: 4 additions & 4 deletions Lombiq.VueJs/ResourceManagementOptionsConfiguration.cs
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
using Microsoft.Extensions.Options;
using Lombiq.HelpfulLibraries.Attributes;
using Microsoft.Extensions.Options;
using OrchardCore.ResourceManagement;
using static Lombiq.VueJs.Constants.FeatureIds;
using static Lombiq.VueJs.Constants.ResourceNames;

namespace Lombiq.VueJs;

public class ResourceManagementOptionsConfiguration : IConfigureOptions<ResourceManagementOptions>
[ConstantFromJson("VueVersion", "package.json", "vue")]
public partial class ResourceManagementOptionsConfiguration : IConfigureOptions<ResourceManagementOptions>
{
private const string Root = $"~/{Area}/";
private const string Js = Root + "js/";
private const string Vendors = Root + "vendors/";

// Always keep the version in sync with the value in package.json.
private const string VueVersion = "3.4.21";
private const string VueCdnRoot = $"https://unpkg.com/vue@{VueVersion}/dist/";

private static readonly ResourceManifest _manifest = new();
Expand Down

0 comments on commit bb8f5f0

Please sign in to comment.