2016-11-24 20:07:45 +01:00
|
|
|
{***************************************************************************}
|
|
|
|
{ }
|
|
|
|
{ Delphi MVC Framework }
|
|
|
|
{ }
|
2017-01-05 12:44:34 +01:00
|
|
|
{ Copyright (c) 2010-2017 Daniele Teti and the DMVCFramework Team }
|
2016-11-24 20:07:45 +01:00
|
|
|
{ }
|
|
|
|
{ https://github.com/danieleteti/delphimvcframework }
|
|
|
|
{ }
|
|
|
|
{***************************************************************************}
|
|
|
|
{ }
|
|
|
|
{ Licensed under the Apache License, Version 2.0 (the "License"); }
|
|
|
|
{ you may not use this file except in compliance with the License. }
|
|
|
|
{ You may obtain a copy of the License at }
|
|
|
|
{ }
|
|
|
|
{ http://www.apache.org/licenses/LICENSE-2.0 }
|
|
|
|
{ }
|
|
|
|
{ Unless required by applicable law or agreed to in writing, software }
|
|
|
|
{ distributed under the License is distributed on an "AS IS" BASIS, }
|
|
|
|
{ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. }
|
|
|
|
{ See the License for the specific language governing permissions and }
|
|
|
|
{ limitations under the License. }
|
|
|
|
{ }
|
|
|
|
{ This IDE expert is based off of the one included with the DUnitX }
|
|
|
|
{ project. Original source by Robert Love. Adapted by Nick Hodges. }
|
|
|
|
{ }
|
|
|
|
{ The DUnitX project is run by Vincent Parrett and can be found at: }
|
|
|
|
{ }
|
|
|
|
{ https://github.com/VSoftTechnologies/DUnitX }
|
|
|
|
{***************************************************************************}
|
2016-02-23 01:41:13 +01:00
|
|
|
|
|
|
|
unit DMVC.Expert.CodeGen.NewDMVCProject;
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
uses
|
|
|
|
ToolsAPI,
|
|
|
|
DMVC.Expert.CodeGen.NewProject;
|
|
|
|
|
|
|
|
type
|
|
|
|
TDMVCProjectFile = class(TNewProjectEx)
|
2016-02-24 22:37:13 +01:00
|
|
|
private
|
|
|
|
FDefaultPort: Integer;
|
|
|
|
procedure SetDefaultPort(const Value: Integer);
|
2016-02-23 01:41:13 +01:00
|
|
|
protected
|
|
|
|
function NewProjectSource(const ProjectName: string): IOTAFile; override;
|
|
|
|
function GetFrameworkType: string; override;
|
|
|
|
public
|
|
|
|
constructor Create; overload;
|
|
|
|
constructor Create(const APersonality: string); overload;
|
2016-02-24 22:37:13 +01:00
|
|
|
property DefaultPort: Integer read FDefaultPort write SetDefaultPort;
|
2016-02-23 01:41:13 +01:00
|
|
|
end;
|
|
|
|
|
|
|
|
implementation
|
|
|
|
|
|
|
|
uses
|
|
|
|
DMVC.Expert.CodeGen.SourceFile,
|
|
|
|
DMVC.Expert.CodeGen.Templates,
|
|
|
|
System.SysUtils;
|
|
|
|
|
|
|
|
constructor TDMVCProjectFile.Create;
|
|
|
|
begin
|
2016-02-24 22:37:13 +01:00
|
|
|
// TODO: Figure out how to make this be DMVCProjectX where X is the next available.
|
|
|
|
// Return Blank and the project will be 'ProjectX.dpr' where X is the next available number
|
2016-02-23 01:41:13 +01:00
|
|
|
FFileName := '';
|
2016-02-24 22:37:13 +01:00
|
|
|
FDefaultPort := 0;
|
2016-02-23 01:41:13 +01:00
|
|
|
end;
|
|
|
|
|
|
|
|
constructor TDMVCProjectFile.Create(const APersonality: string);
|
|
|
|
begin
|
|
|
|
Create;
|
|
|
|
Personality := APersonality;
|
|
|
|
end;
|
|
|
|
|
|
|
|
function TDMVCProjectFile.GetFrameworkType: string;
|
|
|
|
begin
|
|
|
|
Result := 'VCL';
|
|
|
|
end;
|
|
|
|
|
|
|
|
function TDMVCProjectFile.NewProjectSource(const ProjectName: string): IOTAFile;
|
|
|
|
begin
|
2016-02-24 22:37:13 +01:00
|
|
|
Result := TSourceFile.Create(sDMVCDPR, [ProjectName, FDefaultPort]);
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TDMVCProjectFile.SetDefaultPort(const Value: Integer);
|
|
|
|
begin
|
|
|
|
FDefaultPort := Value;
|
2016-02-23 01:41:13 +01:00
|
|
|
end;
|
|
|
|
|
|
|
|
end.
|