Skip to content

Commit

Permalink
Merge branch 'release/1.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] committed Jun 5, 2021
2 parents a019189 + 416eea5 commit 79a4f9a
Show file tree
Hide file tree
Showing 9 changed files with 89 additions and 1,068 deletions.
47 changes: 0 additions & 47 deletions BossExperts.dpk

This file was deleted.

959 changes: 0 additions & 959 deletions BossExperts.dproj

This file was deleted.

Binary file removed BossExperts.res
Binary file not shown.
2 changes: 2 additions & 0 deletions Source/Core/BE.Commands.Interfaces.pas
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ interface
function Uninstall(AComplete: TProc = nil): IBECommands; overload;
function Uninstall(ADependency: TBEModelDependency; AComplete: TProc = nil): IBECommands; overload;

function RemoveCache(AComplete: TProc = nil): IBECommands;

function BossInstalled: Boolean;
end;

Expand Down
23 changes: 15 additions & 8 deletions Source/Core/BE.Commands.ProcessDelphi.pas
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ type TBECommandsProcessDelphi = class(TInterfacedObject, IBECommands)
function Uninstall(AComplete: TProc = nil): IBECommands; overload;
function Uninstall(ADependency: TBEModelDependency; AComplete: TProc = nil): IBECommands; overload;

function RemoveCache(AComplete: TProc = nil): IBECommands;
function BossInstalled: Boolean;
public
constructor create(Path: string);
Expand Down Expand Up @@ -66,33 +67,39 @@ constructor TBECommandsProcessDelphi.create(Path: string);
function TBECommandsProcessDelphi.Init: IBECommands;
begin
result := Self;
RunCommand('boss init', nil);
RunCommand(BOSS_INIT, nil);
end;

function TBECommandsProcessDelphi.Install(AComplete: TProc = nil): IBECommands;
begin
result := Self;

RunCommand('boss install', AComplete);
RunCommand(BOSS_INSTALL, AComplete);
end;

function TBECommandsProcessDelphi.Install(ADependency: TBEModelDependency; AComplete: TProc): IBECommands;
begin
result := Self;
RunCommand(Format('boss install %s', [ADependency.ToString]).Trim, AComplete);
RunCommand(Format('%s %s', [BOSS_INSTALL, ADependency.ToString]).Trim, AComplete);
end;

function TBECommandsProcessDelphi.Login(Host: String): IBECommands;
begin
result := Self;
RunCommand(Format('boss login %s', [Host]), nil);
RunCommand(Format('%s %s', [BOSS_LOGIN, Host]), nil);
end;

class function TBECommandsProcessDelphi.New(Path: string): IBECommands;
begin
result := Self.create(Path);
end;

function TBECommandsProcessDelphi.RemoveCache(AComplete: TProc = nil): IBECommands;
begin
Result := Self;
RunCommand(BOSS_REMOVE_CACHE, AComplete);
end;

procedure TBECommandsProcessDelphi.RunCommand(ACommand: String; AComplete: TProc);
var
{$IF CompilerVersion <= 26.0}
Expand Down Expand Up @@ -136,25 +143,25 @@ procedure TBECommandsProcessDelphi.RunCommand(ACommand: String; AComplete: TProc
function TBECommandsProcessDelphi.Uninstall(AComplete: TProc = nil): IBECommands;
begin
result := Self;
RunCommand('boss uninstall', AComplete);
RunCommand(BOSS_UNINSTALL, AComplete);
end;

function TBECommandsProcessDelphi.Uninstall(ADependency: TBEModelDependency; AComplete: TProc = nil): IBECommands;
begin
result := Self;
RunCommand(Format('boss uninstall %s', [ADependency.name]).Trim, AComplete);
RunCommand(Format('%s %s', [BOSS_UNINSTALL, ADependency.name]).Trim, AComplete);
end;

function TBECommandsProcessDelphi.Update(AComplete: TProc = nil): IBECommands;
begin
result := Self;
RunCommand('boss update', AComplete);
RunCommand(BOSS_UPDATE, AComplete);
end;

function TBECommandsProcessDelphi.Update(ADependency: TBEModelDependency; AComplete: TProc): IBECommands;
begin
result := Self;
RunCommand(Format('boss update %s', [ADependency.ToString]).Trim, AComplete);
RunCommand(Format('%s %s', [BOSS_UPDATE, ADependency.ToString]).Trim, AComplete);
end;

end.
22 changes: 11 additions & 11 deletions Source/Core/BE.Constants.pas
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,27 @@ interface
BOSS_UNINSTALL_POSITION = BOSS_POSITION + 50;
BOSS_DEPENDENCIES_SEPARATOR_POSITION = BOSS_POSITION + 60;
BOSS_DEPENDENCIES_POSITION = BOSS_POSITION + 70;
BOSS_CACHE_SEPARATOR_POSITION = BOSS_POSITION + 80;
BOSS_REMOVE_CACHE_POSITION = BOSS_POSITION + 90;

BOSS_CAPTION = 'Boss';
BOSS_VERB = 'Boss';

BOSS_INIT_CAPTION = 'Init';
BOSS_INIT_VERB = 'BossInit';

BOSS_DEPENDENCIES_CAPTION = 'Dependencies...';
BOSS_DEPENDENCIES_VERB = 'Dependencies';

BOSS_INSTALL_CAPTION = 'Install';
BOSS_INSTALL_VERB = 'Install';

BOSS_UPDATE_CAPTION = 'Update';
BOSS_UPDATE_VERB = 'Update';

BOSS_UNINSTALL_CAPTION = 'Uninstall';
BOSS_UNINSTALL_VERB = 'Uninstall';
BOSS_REMOVE_CACHE_CAPTION = 'Remove Cache';

BOSS_JSON = 'boss.json';

// Boss Commands
BOSS_INIT = 'boss init';
BOSS_LOGIN = 'boss login';
BOSS_INSTALL = 'boss install';
BOSS_UPDATE = 'boss update';
BOSS_UNINSTALL = 'boss uninstall';
BOSS_REMOVE_CACHE = 'boss config cache rm';

implementation

end.
3 changes: 2 additions & 1 deletion Source/Core/BE.Model.pas
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ interface
System.Generics.Collections,
System.SysUtils,
System.IniFiles,
BE.Constants,
BE.Helpers.Json,
ToolsAPI;

Expand Down Expand Up @@ -108,7 +109,7 @@ class function TBEModel.LoadDependencies(Project: IOTAProject): TBEModel;
begin
result := TBEModel.create;
try
jsonFile := ExtractFilePath(Project.FileName) + 'boss.json';
jsonFile := ExtractFilePath(Project.FileName) + BOSS_JSON;
if not FileExists(jsonFile) then
exit;

Expand Down
99 changes: 58 additions & 41 deletions Source/IDE/BE.ContextMenu.pas
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,6 @@ TBEContextMenuBossInit = class(TBEContextMenu, IOTALocalMenu, IOTAProjectManag
constructor create(Project: IOTAProject); override;
end;

TBEContextMenuInstallSeparator = class(TBEContextMenu, IOTALocalMenu, IOTAProjectManagerMenu)
public
constructor create(Project: IOTAProject); override;
end;

TBEContextMenuInstall = class(TBEContextMenu, IOTALocalMenu, IOTAProjectManagerMenu)
protected
procedure Execute(const MenuContextList: IInterfaceList); override;
Expand All @@ -111,19 +106,28 @@ TBEContextMenuUninstall = class(TBEContextMenu, IOTALocalMenu, IOTAProjectMana
constructor create(Project: IOTAProject); override;
end;

TBEContextMenuDependenciesSeparator = class(TBEContextMenu, IOTALocalMenu, IOTAProjectManagerMenu)
TBEContextMenuDependencies = class(TBEContextMenu, IOTALocalMenu, IOTAProjectManagerMenu)
protected
procedure Execute(const MenuContextList: IInterfaceList); override;

public
constructor create(Project: IOTAProject); override;
end;

TBEContextMenuDependencies = class(TBEContextMenu, IOTALocalMenu, IOTAProjectManagerMenu)
TBEContextMenuCacheRemove = class(TBEContextMenu, IOTALocalMenu, IOTAProjectManagerMenu)
protected
procedure Execute(const MenuContextList: IInterfaceList); override;

public
constructor create(Project: IOTAProject); override;
end;

TBEContextMenuSeparator = class(TBEContextMenu, IOTALocalMenu, IOTAProjectManagerMenu)
public
constructor create(Project: IOTAProject; Position: Integer); reintroduce;
class function New(Project: IOTAProject; Position: Integer): IOTAProjectManagerMenu;
end;

var
IndexContextMenuBoss: Integer = -1;

Expand Down Expand Up @@ -151,12 +155,14 @@ procedure TBEContextMenuWizard.AddMenu(const Project: IOTAProject;

ProjectManagerMenuList.Add(TBEContextMenuBoss.New(Project));
ProjectManagerMenuList.Add(TBEContextMenuBossInit.New(Project));
ProjectManagerMenuList.Add(TBEContextMenuInstallSeparator.New(Project));
ProjectManagerMenuList.Add(TBEContextMenuSeparator.New(Project, BOSS_INSTALL_SEPARATOR_POSITION));
ProjectManagerMenuList.Add(TBEContextMenuInstall.New(Project));
ProjectManagerMenuList.Add(TBEContextMenuUpdate.New(Project));
ProjectManagerMenuList.Add(TBEContextMenuUninstall.New(Project));
ProjectManagerMenuList.Add(TBEContextMenuDependenciesSeparator.New(Project));
ProjectManagerMenuList.Add(TBEContextMenuSeparator.New(Project, BOSS_DEPENDENCIES_SEPARATOR_POSITION));
ProjectManagerMenuList.Add(TBEContextMenuDependencies.New(Project));
ProjectManagerMenuList.Add(TBEContextMenuSeparator.New(Project, BOSS_CACHE_SEPARATOR_POSITION));
ProjectManagerMenuList.Add(TBEContextMenuCacheRemove.New(Project));
end;

class function TBEContextMenuWizard.New: IOTAProjectMenuItemCreatorNotifier;
Expand All @@ -171,7 +177,7 @@ constructor TBEContextMenuBoss.create(Project: IOTAProject);
inherited create(Project);
FPosition := BOSS_POSITION;
FCaption := BOSS_CAPTION;
FVerb := BOSS_VERB;
FVerb := BOSS_CAPTION;
end;

{ TBEContextMenu }
Expand Down Expand Up @@ -312,8 +318,8 @@ constructor TBEContextMenuInstall.create(Project: IOTAProject);
inherited create(Project);
FPosition := BOSS_INSTALL_POSITION;
FCaption := BOSS_INSTALL_CAPTION;
FVerb := BOSS_INSTALL_VERB;
FParent := BOSS_VERB;
FVerb := BOSS_INSTALL_CAPTION;
FParent := BOSS_CAPTION;
end;

procedure TBEContextMenuInstall.Execute(const MenuContextList: IInterfaceList);
Expand All @@ -329,8 +335,8 @@ constructor TBEContextMenuBossInit.create(Project: IOTAProject);
inherited create(Project);
FCaption := BOSS_INIT_CAPTION;
FPosition:= BOSS_INIT_POSITION;
FVerb := BOSS_INIT_VERB;
FParent := BOSS_VERB;
FVerb := BOSS_INIT_CAPTION;
FParent := BOSS_CAPTION;

FChecked := FBossCommand.BossInstalled;
end;
Expand All @@ -349,8 +355,8 @@ constructor TBEContextMenuUninstall.create(Project: IOTAProject);
inherited create(Project);
FCaption := BOSS_UNINSTALL_CAPTION;
FPosition:= BOSS_UNINSTALL_POSITION;
FVerb := BOSS_UNINSTALL_VERB;
FParent := BOSS_VERB;
FVerb := BOSS_UNINSTALL_CAPTION;
FParent := BOSS_CAPTION;

end;

Expand All @@ -367,8 +373,8 @@ constructor TBEContextMenuUpdate.create(Project: IOTAProject);
inherited create(Project);
FCaption := BOSS_UPDATE_CAPTION;
FPosition:= BOSS_UPDATE_POSITION;
FVerb := BOSS_UPDATE_VERB;
FParent := BOSS_VERB;
FVerb := BOSS_UPDATE_CAPTION;
FParent := BOSS_CAPTION;
end;

procedure TBEContextMenuUpdate.Execute(const MenuContextList: IInterfaceList);
Expand All @@ -377,48 +383,59 @@ procedure TBEContextMenuUpdate.Execute(const MenuContextList: IInterfaceList);
FBossCommand.Update(Self.DoRefreshProject);
end;

{ TBEContextMenuInstallSeparator }
{ TBEContextMenuDependencies }

constructor TBEContextMenuInstallSeparator.create(Project: IOTAProject);
constructor TBEContextMenuDependencies.create(Project: IOTAProject);
begin
inherited create(Project);
FCaption := '-';
FVerb := '-';
FPosition := BOSS_INSTALL_SEPARATOR_POSITION;
FParent := BOSS_VERB;
FCaption := BOSS_DEPENDENCIES_CAPTION;
FVerb := BOSS_DEPENDENCIES_CAPTION;
FPosition := BOSS_DEPENDENCIES_POSITION;
FParent := BOSS_CAPTION;
end;

{ TBEContextMenuDependenciesSeparator }
procedure TBEContextMenuDependencies.Execute(const MenuContextList: IInterfaceList);
begin
VerifyBoss;
BEWizardForms := TBEWizardForms.create(nil, FBossCommand, FProject);
try
BEWizardForms.ShowModal;
finally
BEWizardForms.Free;
end;
end;

constructor TBEContextMenuDependenciesSeparator.create(Project: IOTAProject);
{ TBEContextMenuSeparator }

constructor TBEContextMenuSeparator.create(Project: IOTAProject; Position: Integer);
begin
inherited create(Project);
FPosition := Position;
FCaption := '-';
FVerb := '-';
FPosition := BOSS_DEPENDENCIES_SEPARATOR_POSITION;
FParent := BOSS_VERB;
FParent := BOSS_CAPTION;
end;

{ TBEContextMenuDependencies }
class function TBEContextMenuSeparator.New(Project: IOTAProject; Position: Integer): IOTAProjectManagerMenu;
begin
result := Self.create(Project, Position);
end;

constructor TBEContextMenuDependencies.create(Project: IOTAProject);
{ TBEContextMenuCacheRemove }

constructor TBEContextMenuCacheRemove.create(Project: IOTAProject);
begin
inherited create(Project);
FCaption := BOSS_DEPENDENCIES_CAPTION;
FVerb := BOSS_DEPENDENCIES_VERB;
FPosition := BOSS_DEPENDENCIES_POSITION;
FParent := BOSS_VERB;
FCaption := BOSS_REMOVE_CACHE_CAPTION;
FVerb := BOSS_REMOVE_CACHE_CAPTION;
FPosition := BOSS_REMOVE_CACHE_POSITION;
FParent := BOSS_CAPTION;
end;

procedure TBEContextMenuDependencies.Execute(const MenuContextList: IInterfaceList);
procedure TBEContextMenuCacheRemove.Execute(const MenuContextList: IInterfaceList);
begin
VerifyBoss;
BEWizardForms := TBEWizardForms.create(nil, FBossCommand, FProject);
try
BEWizardForms.ShowModal;
finally
BEWizardForms.Free;
end;
FBossCommand.RemoveCache(Self.DoRefreshProject);
end;

initialization
Expand Down
2 changes: 1 addition & 1 deletion boss.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"homepage": "",
"mainsrc": "Source",
"projects": [
"BossExperts.dproj"
"Source/BossExperts.dproj"
],
"dependencies": {}
}

0 comments on commit 79a4f9a

Please sign in to comment.