mirror of https://gitlab.com/basile.b/dexed.git
started to wrap DUB format as a TComponent
This commit is contained in:
parent
96c8c3ea7b
commit
4580f60911
|
@ -140,7 +140,7 @@
|
||||||
<PackageName Value="LCL"/>
|
<PackageName Value="LCL"/>
|
||||||
</Item6>
|
</Item6>
|
||||||
</RequiredPackages>
|
</RequiredPackages>
|
||||||
<Units Count="34">
|
<Units Count="35">
|
||||||
<Unit0>
|
<Unit0>
|
||||||
<Filename Value="coedit.lpr"/>
|
<Filename Value="coedit.lpr"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
|
@ -353,6 +353,11 @@
|
||||||
<ResourceBaseClass Value="Form"/>
|
<ResourceBaseClass Value="Form"/>
|
||||||
<UnitName Value="ce_todolist"/>
|
<UnitName Value="ce_todolist"/>
|
||||||
</Unit33>
|
</Unit33>
|
||||||
|
<Unit34>
|
||||||
|
<Filename Value="..\src\ce_dubwrap.pas"/>
|
||||||
|
<IsPartOfProject Value="True"/>
|
||||||
|
<UnitName Value="ce_dubwrap"/>
|
||||||
|
</Unit34>
|
||||||
</Units>
|
</Units>
|
||||||
</ProjectOptions>
|
</ProjectOptions>
|
||||||
<CompilerOptions>
|
<CompilerOptions>
|
||||||
|
|
|
@ -8,7 +8,7 @@ uses
|
||||||
{$ENDIF}{$ENDIF}
|
{$ENDIF}{$ENDIF}
|
||||||
Interfaces, Forms, lazcontrols, runtimetypeinfocontrols, ce_observer, ce_libman,
|
Interfaces, Forms, lazcontrols, runtimetypeinfocontrols, ce_observer, ce_libman,
|
||||||
ce_tools, ce_dcd, ce_main, ce_writableComponent, ce_options, ce_symstring,
|
ce_tools, ce_dcd, ce_main, ce_writableComponent, ce_options, ce_symstring,
|
||||||
ce_staticmacro, ce_icons;
|
ce_staticmacro, ce_icons, ce_dubwrap;
|
||||||
|
|
||||||
{$R *.res}
|
{$R *.res}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,181 @@
|
||||||
|
unit ce_dubwrap;
|
||||||
|
|
||||||
|
{$I ce_defines.inc}
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
Classes, SysUtils, ce_common, ce_writableComponent;
|
||||||
|
|
||||||
|
type
|
||||||
|
|
||||||
|
TDubTargetType = ( autodetect, none, executable{, library}, sourceLibrary,
|
||||||
|
staticLibrary, dynamicLibrary);
|
||||||
|
|
||||||
|
TCEDubSubPackageItem = class(TCollectionItem)
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
TCEDubSubPacakges = class(TCollection)
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
TCEDubConfigurationItem = class(TCollectionItem)
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
TCEDubConfigurations = class(TCollection)
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
TCEDubBuildTypeItem = class(TCollectionItem)
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
TCEDubBuildTypes = class(TCollection)
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
(**
|
||||||
|
* Warps a DUB JSON project.
|
||||||
|
* JSON fields are converted to streamable/inspectable/published properties.
|
||||||
|
*
|
||||||
|
* the properties must produce the right JSON type when saved with TJSONStreamer.
|
||||||
|
*)
|
||||||
|
TCEDubProject = class(TWritableJsonComponent)
|
||||||
|
private
|
||||||
|
fUpdateCount: NativeInt;
|
||||||
|
//
|
||||||
|
fPackageName: string;
|
||||||
|
fDescription: string;
|
||||||
|
fHomepage: string;
|
||||||
|
fAuthors: string;
|
||||||
|
fCopyright: string;
|
||||||
|
fLicense: string;
|
||||||
|
//
|
||||||
|
//fDependencies: ["<name>" : <version-spec>, "<name>" : <version-spec>, ...] TCollection
|
||||||
|
fTargetType: TDubTargetType;
|
||||||
|
fSystemDependencies: string;
|
||||||
|
fTargetName: string;
|
||||||
|
fTargetPath: string;
|
||||||
|
fWorkingDirectory: string;
|
||||||
|
// fSubConfigurations: ["string" : "string", "string": string, ...] TCollection
|
||||||
|
fMainSourceFile: string;
|
||||||
|
fbuildRequirements: TStringList;
|
||||||
|
fbuildOptions: TStringList;
|
||||||
|
fLibs: TStringList;
|
||||||
|
fSourceFiles: TStringList;
|
||||||
|
fSourcePaths: TStringList;
|
||||||
|
fExcludedSourceFiles: TStringList;
|
||||||
|
fCopyFiles: TStringList;
|
||||||
|
fVersions: TStringList;
|
||||||
|
fDebugVersions: TStringList;
|
||||||
|
fImportPaths: TStringList;
|
||||||
|
fStringImportPaths: TStringList;
|
||||||
|
fPreGenerateCommands: TStringList;
|
||||||
|
fPostGenerateCommands: TStringList;
|
||||||
|
fPreBuildCommands: TStringList;
|
||||||
|
fPostBuildCommands: TStringList;
|
||||||
|
fDflags: TStringList;
|
||||||
|
fLflags: TStringList;
|
||||||
|
//
|
||||||
|
fSubPackages: TCEDubSubPacakges;
|
||||||
|
fConfigurations: TCEDubConfigurations;
|
||||||
|
fBuildTypes: TCEDubBuildTypes;
|
||||||
|
fDdoxFilterArgs: TStringList;
|
||||||
|
published
|
||||||
|
|
||||||
|
// global
|
||||||
|
property packageName: string read fPackageName;
|
||||||
|
property description: string read fDescription;
|
||||||
|
property homepage: string read fHomepage;
|
||||||
|
property authors: string read fAuthors;
|
||||||
|
property copyright: string read fCopyright;
|
||||||
|
property license: string read fLicense;
|
||||||
|
|
||||||
|
// common build settings
|
||||||
|
//dependencies;
|
||||||
|
property systemDependencies: string read fSystemDependencies;
|
||||||
|
property targetType: TDubTargetType read fTargetType;
|
||||||
|
property targetName: string read fTargetName;
|
||||||
|
property targetPath: string read fTargetPath;
|
||||||
|
property workingDirectory: string read fWorkingDirectory;
|
||||||
|
//subConfigurations;
|
||||||
|
property buildRequirements: TStringList read FbuildRequirements;
|
||||||
|
property buildOptions: TStringList read fBuildOptions;
|
||||||
|
property libs: TStringList read fLibs;
|
||||||
|
property sourceFiles: TStringList read fSourceFiles;
|
||||||
|
property sourcePaths: TStringList read fSourcePaths;
|
||||||
|
property excludedSourceFiles: TStringList read fExcludedSourceFiles;
|
||||||
|
property mainSourceFile: string read fMainSourceFile;
|
||||||
|
property copyFiles: TStringList read fCopyFiles;
|
||||||
|
property versions: TStringList read fVersions;
|
||||||
|
property debugVersions: TStringList read fDebugVersions;
|
||||||
|
property importPaths: TStringList read fImportPaths;
|
||||||
|
property stringImportPaths: TStringList read fStringImportPaths;
|
||||||
|
property preGenerateCommands: TStringList read fPreGenerateCommands;
|
||||||
|
property postGenerateCommands: TStringList read fPostGenerateCommands;
|
||||||
|
property preBuildCommands: TStringList read fPreBuildCommands;
|
||||||
|
property postBuildCommands: TStringList read fPostBuildCommands;
|
||||||
|
property dflags: TStringList read fDflags;
|
||||||
|
property lflags: TStringList read fLflags;
|
||||||
|
|
||||||
|
// collections
|
||||||
|
property subPackages: TCEDubSubPacakges read fSubPackages;
|
||||||
|
property configurations: TCEDubConfigurations read fConfigurations;
|
||||||
|
property buildTypes: TCEDubBuildTypes read fBuildTypes;
|
||||||
|
property ddoxFilterArgs: TStringList read fDdoxFilterArgs;
|
||||||
|
public
|
||||||
|
constructor create(aOwner: TComponent); override;
|
||||||
|
destructor destroy; override;
|
||||||
|
//
|
||||||
|
procedure Update;
|
||||||
|
procedure beginUpdate;
|
||||||
|
procedure endUpdate;
|
||||||
|
//
|
||||||
|
procedure getSourcesList(aList: TStringList);
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
|
||||||
|
constructor TCEDubProject.create(aOwner: TComponent);
|
||||||
|
begin
|
||||||
|
inherited;
|
||||||
|
end;
|
||||||
|
|
||||||
|
destructor TCEDubProject.destroy;
|
||||||
|
begin
|
||||||
|
inherited;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCEDubProject.beginUpdate;
|
||||||
|
begin
|
||||||
|
fUpdateCount += 1;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCEDubProject.endUpdate;
|
||||||
|
begin
|
||||||
|
fUpdateCount -= 1;
|
||||||
|
if fUpdateCount <= 0 then
|
||||||
|
Update;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCEDubProject.Update;
|
||||||
|
begin
|
||||||
|
fUpdateCount := 0;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCEDubProject.getSourcesList(aList: TStringList);
|
||||||
|
begin
|
||||||
|
{
|
||||||
|
sourceFiles - excluded
|
||||||
|
sourcePath - excluded
|
||||||
|
auto detection - excluded
|
||||||
|
}
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
||||||
|
|
Loading…
Reference in New Issue