Skip to content

Commit 0e9812b

Browse files
fixed dspec creator missing readme support
1 parent 7cc9ec4 commit 0e9812b

5 files changed

Lines changed: 133 additions & 43 deletions

File tree

Source/Core/Spec/DPM.Core.Spec.MetaData.pas

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,9 @@ function TSpecMetaData.ToJSON: string;
425425
if FIsCommercial then
426426
json.b['iscommercial'] := FIsCommercial;
427427

428+
if Length(FReadme) > 0 then
429+
json.S['readme'] := FReadme;
430+
428431
Result := json.ToJSON;
429432
finally
430433
FreeAndNil(json);

Source/DSpecCreator/DPM.Creator.MainForm.dfm

Lines changed: 59 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ object DSpecCreatorForm: TDSpecCreatorForm
22
Left = 0
33
Top = 0
44
Caption = '.dspec Creator'
5-
ClientHeight = 506
5+
ClientHeight = 519
66
ClientWidth = 871
77
Color = clBtnFace
88
Font.Charset = DEFAULT_CHARSET
@@ -17,12 +17,20 @@ object DSpecCreatorForm: TDSpecCreatorForm
1717
OnCreate = FormCreate
1818
OnDestroy = FormDestroy
1919
TextHeight = 15
20+
object Label13: TLabel
21+
Left = 60
22+
Top = 476
23+
Width = 27
24+
Height = 15
25+
Alignment = taRightJustify
26+
Caption = 'Tags:'
27+
end
2028
object PageControl: TPageControl
2129
Left = 0
2230
Top = 0
2331
Width = 871
24-
Height = 506
25-
ActivePage = tsInfo
32+
Height = 519
33+
ActivePage = tsGenerate
2634
Align = alClient
2735
TabOrder = 0
2836
object tsInfo: TTabSheet
@@ -157,6 +165,14 @@ object DSpecCreatorForm: TDSpecCreatorForm
157165
Alignment = taRightJustify
158166
Caption = 'Copyright :'
159167
end
168+
object Label14: TLabel
169+
Left = 37
170+
Top = 450
171+
Width = 46
172+
Height = 15
173+
Alignment = taRightJustify
174+
Caption = 'Readme:'
175+
end
160176
object edtId: TEdit
161177
Left = 89
162178
Top = 29
@@ -378,14 +394,14 @@ object DSpecCreatorForm: TDSpecCreatorForm
378394
Left = 330
379395
Top = 0
380396
Width = 4
381-
Height = 476
397+
Height = 489
382398
ResizeStyle = rsUpdate
383399
end
384400
object CardPanel: TCardPanel
385401
Left = 334
386402
Top = 0
387403
Width = 529
388-
Height = 476
404+
Height = 489
389405
Align = alClient
390406
ActiveCard = crdSearchPathItem
391407
Caption = 'CardPanel'
@@ -394,13 +410,13 @@ object DSpecCreatorForm: TDSpecCreatorForm
394410
Left = 1
395411
Top = 1
396412
Width = 527
397-
Height = 474
413+
Height = 487
398414
Caption = 'Source/Lib/File'
399415
CardIndex = 0
400416
TabOrder = 0
401417
DesignSize = (
402418
527
403-
474)
419+
487)
404420
object lblSrc: TLabel
405421
Left = 16
406422
Top = 40
@@ -492,7 +508,7 @@ object DSpecCreatorForm: TDSpecCreatorForm
492508
Left = 1
493509
Top = 1
494510
Width = 527
495-
Height = 474
511+
Height = 487
496512
Caption = 'SearchPath Item'
497513
CardIndex = 1
498514
TabOrder = 1
@@ -523,13 +539,13 @@ object DSpecCreatorForm: TDSpecCreatorForm
523539
Left = 1
524540
Top = 1
525541
Width = 527
526-
Height = 474
542+
Height = 487
527543
Caption = 'Build Item'
528544
CardIndex = 2
529545
TabOrder = 2
530546
DesignSize = (
531547
527
532-
474)
548+
487)
533549
object lblBuild: TLabel
534550
Left = 8
535551
Top = 8
@@ -613,13 +629,13 @@ object DSpecCreatorForm: TDSpecCreatorForm
613629
Left = 4
614630
Top = 4
615631
Width = 521
616-
Height = 468
632+
Height = 481
617633
Caption = 'Runtime Or DesignTime'
618634
CardIndex = 3
619635
TabOrder = 3
620636
DesignSize = (
621637
521
622-
468)
638+
481)
623639
object lblRuntime: TLabel
624640
Left = 8
625641
Top = 8
@@ -686,13 +702,13 @@ object DSpecCreatorForm: TDSpecCreatorForm
686702
Left = 1
687703
Top = 1
688704
Width = 527
689-
Height = 474
705+
Height = 487
690706
Caption = 'Dependency'
691707
CardIndex = 4
692708
TabOrder = 4
693709
DesignSize = (
694710
527
695-
474)
711+
487)
696712
object Label1: TLabel
697713
Left = 16
698714
Top = 95
@@ -739,7 +755,7 @@ object DSpecCreatorForm: TDSpecCreatorForm
739755
Left = 1
740756
Top = 1
741757
Width = 527
742-
Height = 474
758+
Height = 487
743759
Caption = 'Templates'
744760
CardIndex = 5
745761
TabOrder = 5
@@ -770,7 +786,7 @@ object DSpecCreatorForm: TDSpecCreatorForm
770786
Left = 1
771787
Top = 1
772788
Width = 527
773-
Height = 474
789+
Height = 487
774790
Caption = 'Build Items Heading'
775791
CardIndex = 6
776792
TabOrder = 6
@@ -798,7 +814,7 @@ object DSpecCreatorForm: TDSpecCreatorForm
798814
Left = 1
799815
Top = 1
800816
Width = 527
801-
Height = 474
817+
Height = 487
802818
Caption = 'SearchPath Heading'
803819
CardIndex = 7
804820
TabOrder = 7
@@ -826,7 +842,7 @@ object DSpecCreatorForm: TDSpecCreatorForm
826842
Left = 1
827843
Top = 1
828844
Width = 527
829-
Height = 474
845+
Height = 487
830846
Caption = 'Source Items Heading'
831847
CardIndex = 8
832848
TabOrder = 8
@@ -852,7 +868,7 @@ object DSpecCreatorForm: TDSpecCreatorForm
852868
Left = 1
853869
Top = 1
854870
Width = 527
855-
Height = 474
871+
Height = 487
856872
Caption = 'Dependencies '
857873
CardIndex = 9
858874
TabOrder = 9
@@ -880,7 +896,7 @@ object DSpecCreatorForm: TDSpecCreatorForm
880896
Left = 1
881897
Top = 1
882898
Width = 527
883-
Height = 474
899+
Height = 487
884900
Caption = 'Lib Entries Heading'
885901
CardIndex = 10
886902
TabOrder = 10
@@ -906,7 +922,7 @@ object DSpecCreatorForm: TDSpecCreatorForm
906922
Left = 1
907923
Top = 1
908924
Width = 527
909-
Height = 474
925+
Height = 487
910926
Caption = 'File Entries Heading'
911927
CardIndex = 11
912928
TabOrder = 11
@@ -934,7 +950,7 @@ object DSpecCreatorForm: TDSpecCreatorForm
934950
Left = 1
935951
Top = 1
936952
Width = 527
937-
Height = 474
953+
Height = 487
938954
Caption = 'Design Heading'
939955
CardIndex = 12
940956
TabOrder = 12
@@ -962,7 +978,7 @@ object DSpecCreatorForm: TDSpecCreatorForm
962978
Left = 1
963979
Top = 1
964980
Width = 527
965-
Height = 474
981+
Height = 487
966982
Caption = 'Runtime Heading'
967983
CardIndex = 13
968984
TabOrder = 13
@@ -989,14 +1005,14 @@ object DSpecCreatorForm: TDSpecCreatorForm
9891005
Left = 0
9901006
Top = 0
9911007
Width = 330
992-
Height = 476
1008+
Height = 489
9931009
Align = alLeft
9941010
Caption = 'Panel2'
9951011
ShowCaption = False
9961012
TabOrder = 1
9971013
DesignSize = (
9981014
330
999-
476)
1015+
489)
10001016
object lblTemplateView: TLabel
10011017
Left = 3
10021018
Top = 3
@@ -1006,7 +1022,7 @@ object DSpecCreatorForm: TDSpecCreatorForm
10061022
end
10071023
object Label3: TLabel
10081024
Left = 3
1009-
Top = 417
1025+
Top = 430
10101026
Width = 161
10111027
Height = 15
10121028
Anchors = [akLeft, akBottom]
@@ -1017,7 +1033,7 @@ object DSpecCreatorForm: TDSpecCreatorForm
10171033
Left = 3
10181034
Top = 24
10191035
Width = 319
1020-
Height = 387
1036+
Height = 400
10211037
Anchors = [akLeft, akTop, akRight, akBottom]
10221038
AutoExpand = True
10231039
DoubleBuffered = True
@@ -1039,7 +1055,7 @@ object DSpecCreatorForm: TDSpecCreatorForm
10391055
end
10401056
object btnAddTemplate: TButton
10411057
Left = 3
1042-
Top = 438
1058+
Top = 451
10431059
Width = 86
10441060
Height = 25
10451061
Anchors = [akLeft, akBottom]
@@ -1049,7 +1065,7 @@ object DSpecCreatorForm: TDSpecCreatorForm
10491065
end
10501066
object btnDeleteTemplate: TButton
10511067
Left = 95
1052-
Top = 438
1068+
Top = 451
10531069
Width = 98
10541070
Height = 25
10551071
Action = actDeleteTemplate
@@ -1058,7 +1074,7 @@ object DSpecCreatorForm: TDSpecCreatorForm
10581074
end
10591075
object btnDuplicateTemplate: TButton
10601076
Left = 200
1061-
Top = 438
1077+
Top = 451
10621078
Width = 122
10631079
Height = 25
10641080
Action = actDuplicateTemplate
@@ -1074,7 +1090,7 @@ object DSpecCreatorForm: TDSpecCreatorForm
10741090
Left = 0
10751091
Top = 0
10761092
Width = 863
1077-
Height = 476
1093+
Height = 489
10781094
Align = alClient
10791095
Caption = 'GridPanel1'
10801096
ColumnCollection = <
@@ -1104,7 +1120,7 @@ object DSpecCreatorForm: TDSpecCreatorForm
11041120
Left = 1
11051121
Top = 1
11061122
Width = 861
1107-
Height = 79
1123+
Height = 81
11081124
Align = alClient
11091125
TabOrder = 0
11101126
object Label2: TLabel
@@ -1134,9 +1150,9 @@ object DSpecCreatorForm: TDSpecCreatorForm
11341150
end
11351151
object Memo1: TMemo
11361152
Left = 1
1137-
Top = 80
1153+
Top = 82
11381154
Width = 861
1139-
Height = 395
1155+
Height = 406
11401156
Align = alClient
11411157
ReadOnly = True
11421158
ScrollBars = ssBoth
@@ -1151,12 +1167,20 @@ object DSpecCreatorForm: TDSpecCreatorForm
11511167
Left = 0
11521168
Top = 0
11531169
Width = 863
1154-
Height = 476
1170+
Height = 489
11551171
Align = alClient
11561172
TabOrder = 0
11571173
end
11581174
end
11591175
end
1176+
object edtReadme: TEdit
1177+
Left = 93
1178+
Top = 473
1179+
Width = 376
1180+
Height = 23
1181+
TabOrder = 1
1182+
OnChange = edtReadmeChange
1183+
end
11601184
object MainMenu: TMainMenu
11611185
Left = 508
11621186
Top = 386

Source/DSpecCreator/DPM.Creator.MainForm.pas

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,9 @@ TDSpecCreatorForm = class(TForm, IMRUSource)
216216
btnDeleteTemplate : TButton;
217217
btnDuplicateTemplate : TButton;
218218
Splitter1: TSplitter;
219+
edtReadme: TEdit;
220+
Label13: TLabel;
221+
Label14: TLabel;
219222
procedure FormDestroy(Sender : TObject);
220223
procedure btnAddExcludeClick(Sender : TObject);
221224
procedure btnAddTemplateClick(Sender : TObject);
@@ -301,6 +304,7 @@ TDSpecCreatorForm = class(TForm, IMRUSource)
301304
procedure edtCopyrightChange(Sender : TObject);
302305
procedure edtBPLEntryBuildIdChange(Sender: TObject);
303306
procedure clbCompilersKeyPress(Sender: TObject; var Key: Char);
307+
procedure edtReadmeChange(Sender: TObject);
304308
private
305309
{ Private declarations }
306310
FtmpFilename : string;
@@ -476,8 +480,11 @@ procedure TDSpecCreatorForm.btnBuildPackagesClick(Sender : TObject);
476480
FtmpFilename := ChangeFileExt(FtmpFilename, '.dspec');
477481
TFile.WriteAllText(FtmpFilename, FOpenFile.AsString);
478482
if DirectoryExists(edtPackageOutputPath.Text) then
483+
begin
484+
FDosCommand.CurrentDir := FOpenFile.WorkingDir;
479485
FDosCommand.CommandLine := 'dpm pack "' + FtmpFilename + '" -o=' + edtPackageOutputPath.Text;
480-
FDosCommand.Execute;
486+
FDosCommand.Execute;
487+
end;
481488
end;
482489

483490
procedure TDSpecCreatorForm.DeleteSelectedEntry;
@@ -1737,6 +1744,11 @@ procedure TDSpecCreatorForm.edtProjectURLChange(Sender : TObject);
17371744
FOpenFile.PackageSpec.metadata.projectUrl := edtProjectURL.Text;
17381745
end;
17391746

1747+
procedure TDSpecCreatorForm.edtReadmeChange(Sender: TObject);
1748+
begin
1749+
FOpenFile.PackageSpec.metadata.Readme := edtReadme.Text;
1750+
end;
1751+
17401752
procedure TDSpecCreatorForm.edtRepositoryURLChange(Sender : TObject);
17411753
begin
17421754
FOpenFile.PackageSpec.metadata.repositoryUrl := edtRepositoryURL.Text;
@@ -1916,6 +1928,7 @@ procedure TDSpecCreatorForm.LoadDspecStructure;
19161928
edtCopyright.Text := FOpenFile.PackageSpec.metadata.Copyright;
19171929
cboLicense.Text := FOpenFile.PackageSpec.metadata.license;
19181930
edtTags.Text := FOpenFile.PackageSpec.metadata.tags;
1931+
edtReadme.Text := FOpenFile.PackageSpec.metadata.Readme;
19191932
if Length(FOpenFile.PackageSpec.metadata.Icon) > 0 then
19201933
begin
19211934
ImgIcon.Picture.LoadFromFile(TPath.Combine(FOpenFile.WorkingDir, FOpenFile.PackageSpec.metadata.Icon));

0 commit comments

Comments
 (0)