Comments (7)
CnOtaGetCurrentProjectFileName照理拿到的就是当前工程的文件,是否有问题?
from cnwizards.
现在是这样的,如果我有一个工程组,在工程组编译的时候,取到的就会是当前激活的工程
但我现在需要取的是正在编译的工程。
例如:
我有一个工程组:
group1
dpr1(激活)
dpr2
如果我直接在group1上面右键 build,那么CnOtaGetCurrentProjectFileName得到的始终就是dpr1
但我需要的是当前正在build的那个project
from cnwizards.
这个有点麻烦,CnOtaGetCurrentProjectFileName以及相关的OTA接口的确拿到的就是“激活”的工程,而不管当前Build的是什么。
我研究一下有无其他接口以知道当前正在build的是啥工程。
from cnwizards.
辛苦了,非常感谢
from cnwizards.
脚本专家里添加了一个函数:function GetCurrentCompilingProject: IOTAProject;
可用试一试,还不确定是否能准确使用。
from cnwizards.
915版本已支持此函数。
from cnwizards.
谢谢,测试OK。
附上我测试的脚本
{*******************************************************}
{ }
{ Pascal Script Source File }
{ Run by RemObjects Pascal Script in CnWizards }
{ }
{ Generated by CnPack IDE Wizards }
{ }
{*******************************************************}
program CompileTime;
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;
procedure GenCompInt(S: String);
var
CompileTime: string;
begin
CompileTime := '';
CompileTime := CompileTime + '// Author : KngStr' + #13#10;
CompileTime := CompileTime + '// Link : http://www.kngstr.com/?compiletime' + #13#10;
CompileTime := CompileTime + '// Compiler : ' + CompilerName + #13#10;
CompileTime := CompileTime + '// Useage : ' + #13#10;
CompileTime := CompileTime + '// FormatCompileTime(''yyyymmddhhnn'')' + #13#10;
CompileTime := CompileTime + 'const ' + #13#10 +
' CompileTime = ' + FloatToStr(Now) + ';' + #13#10 +
' CompileTimeInt = ' + FormatDateTime('yyyymmddhhnnss', Now) + ';' + #13#10#13#10;
CompileTime := CompileTime + 'function FormatCompileTime(const Format: string): string;' + #13#10;
CompileTime := CompileTime + 'begin' + #13#10 +
' Result := FormatDateTime(Format, CompileTime);' + #13#10 +
'end;' + #13#10;
SaveStringToFile(CompileTime, S + 'CompileTime.inc');
end;
var
Project: IOTAProject;
begin
if GetCurrentCompilingProject <> nil then
Project := GetCurrentCompilingProject
else if CnOtaGetCurrentProject <> nil then
Project := CnOtaGetCurrentProject
else
Exit;
GenCompInt(ExtractFilePath(Project.GetFileName));
end.
from cnwizards.
Related Issues (20)
- [Formatter] Bugs and lack of options HOT 2
- Minimap HOT 2
- [Feature Request] Calculate record size HOT 3
- Structure Highlight lines loose color when line width = 1 HOT 2
- Interaction between CnPack IDE Wizards (CnWizards) and Punto Switcher/Caramba Switcher. HOT 2
- Input helper color ? HOT 1
- Bug “input helper“ Cannot list ExtractFileName HOT 11
- [Question] How I can run command file from Script HOT 3
- Auto complete code in DFM HOT 1
- Permanently The "Lock Controls" HOT 4
- New DFM Editor CnPack HOT 3
- Delphi 11.3 - Form changes size when I compile/build. HOT 9
- IDE Exception HOT 3
- Bug in input helper design
- Input Helper not works in Delphi Type Section since CnWizard 1.2.5.1109 HOT 2
- Code Input Helper Template PopUp Bug HOT 18
- 建议ASCII字符表工具稍作优化 HOT 3
- Reporting Issue with Delphi Unit Naming in Function format HOT 4
- Access violation at address 21D1EAD2 in module 'delphicoreide270.bpl'. Read of address 00000000 HOT 2
- Access violation in module 'coreide290.bpl' HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cnwizards.