Changeset 5 for trunk/USource.pas
- Timestamp:
- Feb 3, 2011, 2:18:11 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:ignore
-
old new 1 1 lib 2 2 FreePascalManager.exe 3 SourceList.xml4 3 Config.xml 4 Source 5 Instance
-
- Property svn:ignore
-
trunk/USource.pas
r4 r5 6 6 7 7 uses 8 Classes, SysUtils, Contnrs, FileUtil, Dialogs, 8 Classes, SysUtils, Contnrs, FileUtil, Dialogs, Forms, 9 9 DOM, XMLWrite, XMLRead, HTTPSend; 10 10 … … 16 16 TSource = class 17 17 Id: Integer; 18 Name: string; 18 ProjectName: string; 19 ProjectShortName: string; 20 ProjectType: string; 19 21 SubversionURL: string; 20 22 VersionNumber: string; 21 23 VersionType: string; 22 24 SourceType: TSourceType; 25 ExecutableFile: string; 23 26 procedure Assign(Source: TSource); 27 procedure Download; 28 procedure Update; 29 procedure ExportTo(Path: string); 30 function GetExecutableFile: string; 31 function GetPath: string; 24 32 end; 25 33 … … 33 41 implementation 34 42 43 uses 44 UMainForm, UOperationProgress; 45 35 46 { TSource } 36 47 … … 38 49 begin 39 50 Id := Source.Id; 40 Name := Source.Name; 51 ProjectName := Source.ProjectName; 52 ProjectShortName := Source.ProjectShortName; 53 ProjectType := Source.ProjectType; 41 54 VersionNumber := Source.VersionNumber; 42 55 VersionType := Source.VersionType; 43 56 SubversionURL := Source.SubversionURL; 44 57 SourceType := Source.SourceType; 58 ExecutableFile := Source.ExecutableFile; 59 end; 60 61 procedure TSource.Download; 62 begin 63 OperationProgressForm.CommandLine := 'svn checkout "' + SubversionURL + 64 '" "' + GetPath + '"'; 65 OperationProgressForm.ShowModal; 66 end; 67 68 procedure TSource.Update; 69 begin 70 OperationProgressForm.CommandLine := 'svn update "' + GetPath + '"'; 71 OperationProgressForm.ShowModal; 72 end; 73 74 procedure TSource.ExportTo(Path: string); 75 begin 76 OperationProgressForm.CommandLine := 'svn export --force "' + GetPath + '" "' + 77 Path + '"'; 78 OperationProgressForm.ShowModal; 79 end; 80 81 function TSource.GetExecutableFile: string; 82 var 83 Postfix: string; 84 begin 85 PostFix := ''; 86 {$IFDEF WINDOWS} 87 PostFix := '.exe'; 88 {$ENDIF} 89 Result := ExecutableFile + Postfix; 90 end; 91 92 function TSource.GetPath: string; 93 begin 94 Result := ExtractFileDir(Application.ExeName) + DirectorySeparator + 95 MainForm.SourceDir + DirectorySeparator + IntToStr(Id); 45 96 end; 46 97 … … 78 129 NewSource := TSource.Create; 79 130 with NewSource do begin 80 NewSubNode := Child.FindNode(' Name');131 NewSubNode := Child.FindNode('ProjectName'); 81 132 if Assigned(NewSubNode) then 82 Name := UTF8Encode(string(NewSubNode.TextContent)); 133 ProjectName := UTF8Encode(string(NewSubNode.TextContent)); 134 NewSubNode := Child.FindNode('ProjectShortName'); 135 if Assigned(NewSubNode) then 136 ProjectShortName := UTF8Encode(string(NewSubNode.TextContent)); 137 NewSubNode := Child.FindNode('ProjectType'); 138 if Assigned(NewSubNode) then 139 ProjectType := UTF8Encode(string(NewSubNode.TextContent)); 83 140 NewSubNode := Child.FindNode('Id'); 84 141 if Assigned(NewSubNode) then … … 93 150 if Assigned(NewSubNode) then 94 151 VersionType := UTF8Encode(string(NewSubNode.TextContent)); 152 NewSubNode := Child.FindNode('ExecutableFile'); 153 if Assigned(NewSubNode) then 154 ExecutableFile := UTF8Encode(string(NewSubNode.TextContent)); 95 155 NewSubNode := Child.FindNode('SourceType'); 96 156 if Assigned(NewSubNode) then
Note:
See TracChangeset
for help on using the changeset viewer.