Skip to content

Commit

Permalink
Properly manage Carbon patches w/out identifiers
Browse files Browse the repository at this point in the history
Make build tag optionally assignable through batch parameter (3rd)
  • Loading branch information
raulssorban committed Oct 21, 2023
1 parent 78bbf17 commit afbd2c1
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Carbon.Core/Carbon.Components/Carbon.Common
11 changes: 3 additions & 8 deletions Carbon.Core/Carbon/src/Hooks/HookEx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,18 +119,13 @@ public HookEx(TypeInfo type)
TargetMethods = new();
TargetType = metadata.Target;

if (Attribute.IsDefined(type, typeof(HookAttribute.Identifier), false))
Identifier = type.GetCustomAttribute<HookAttribute.Identifier>()?.Value ?? $"{Guid.NewGuid():N}";

if (Attribute.IsDefined(type, typeof(HookAttribute.Options), false))
Options = type.GetCustomAttribute<HookAttribute.Options>()?.Value ?? HookFlags.None;
Identifier = type.GetCustomAttribute<HookAttribute.Identifier>()?.Value ?? $"{Guid.NewGuid():N}";
Options = type.GetCustomAttribute<HookAttribute.Options>()?.Value ?? HookFlags.None;
Checksum = type.GetCustomAttribute<HookAttribute.Checksum>()?.Value ?? default;

if (Attribute.IsDefined(type, typeof(HookAttribute.Dependencies), false))
Dependencies = type.GetCustomAttribute<HookAttribute.Dependencies>()?.Value ?? default;

if (Attribute.IsDefined(type, typeof(HookAttribute.Checksum), false))
Checksum = type.GetCustomAttribute<HookAttribute.Checksum>()?.Value ?? default;

if (Options.HasFlag(HookFlags.MetadataOnly))
{
SetStatus(HookState.Inactive);
Expand Down
2 changes: 1 addition & 1 deletion Tools/Build/win/build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ if "%1" EQU "" (
set BUILD_TARGET=%1
)

call "%~dp0publish_git.bat"
call "%~dp0publish_git.bat" %3

echo ** Set the build target config to %BUILD_TARGET%

Expand Down
11 changes: 9 additions & 2 deletions Tools/Build/win/publish_git.bat
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,15 @@ echo ** Comment done.
git log -1 --format=%%%ci HEAD > .gitdate
echo ** Date done.

git describe --tags > .gittag
echo ** Tag done.
if "%1" EQU "" (
git describe --tags > .gittag
echo ** Tag done.
) else (
echo %1 > .gittag
echo ** Tag done.
)



git remote get-url origin > .giturl
echo ** URL done.
Expand Down

0 comments on commit afbd2c1

Please sign in to comment.