Skip to content

Commit 65986cb

Browse files
committed
Altered how we locate an optional Harmony Core customization file. As previously, we first look in the templates directory, but if not found there we now also look in the current directory.
1 parent d1c02bc commit 65986cb

File tree

4 files changed

+21
-3
lines changed

4 files changed

+21
-3
lines changed

Documentation/CodeGen.chm

-116 Bytes
Binary file not shown.

Documentation/CodeGen.hsmx

614 Bytes
Binary file not shown.

HarmonyCoreCodeGen.Core/Model/Solution.dbl

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -868,7 +868,16 @@ namespace HarmonyCoreGenerator.Model
868868
end
869869
end
870870

871-
data customizationFile = Path.Combine(templatesFolder, "HarmonyCoreCustomization.json");
871+
;;Customization file defailts to templates directory
872+
data customizationFile = Path.Combine(templatesFolder, "HarmonyCoreCustomization.json")
873+
874+
;;If not there, look in the current directory
875+
if (!File.Exists(customizationFile))
876+
begin
877+
customizationFile = "HarmonyCoreCustomization.json"
878+
end
879+
880+
;;Do we have a customization file?
872881
if (File.Exists(customizationFile))
873882
begin
874883
data json = File.ReadAllText(customizationFile)

HarmonyCoreExtensions/Helpers.dbl

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,8 +343,17 @@ namespace HarmonyCoreExtensions
343343
required in fromkey, @RpsKey
344344
required in tokey, @RpsKey
345345
required in backLink, boolean
346-
proc
347-
data harmonyCustomizationFile = Path.Combine(context.TemplateFolder,"HarmonyCoreCustomization.json")
346+
proc
347+
348+
;;Customization file defailts to templates directory
349+
data harmonyCustomizationFile = Path.Combine(context.TemplateFolder, "HarmonyCoreCustomization.json")
350+
351+
;;If not there, look in the current directory
352+
if (!File.Exists(harmonyCustomizationFile))
353+
begin
354+
harmonyCustomizationFile = "HarmonyCoreCustomization.json"
355+
end
356+
348357
data relationLookup = ^as(context.Properties.GetOrAdd(^typeof(RelationLookup), lambda(lookupKey) { new RelationLookup(context, harmonyCustomizationFile) }), @RelationLookup)
349358
mreturn relationLookup.FindRelation(fromStructure.Name, tostr.Name, fromkey.Name, tokey.Name, backLink)
350359
endmethod

0 commit comments

Comments
 (0)