Ant property file reference another property file - ant

I have an ant build that has a main build.properties file. One of the projects that is built has a their own property file. I am wondering if it is possible to reference one of the properties defined in the main file in the secondary file.

The answer is yes, assuming that the buildfile of the sub project loads the main build.properties file, and does so before it loads its own properties file.
If both of those are true, then the properties file in the sub project can reference properties from the main build.properties.
I answered a similar question here.

Related

C# StyleBundle doesn't include linked files

VisualStudio 2019, I have two projects in a solution which essentially need to share a single CSS. I have the physical file added to project A, and then I added the same file as a "link" file in Project B. This way only 1 file needed to be updated.
I have my bundleConfig set up properly, but the linked file is never included in the bundle in Project B.
I didn't see any options for doing so in the bundle config. Any other option besides duplicating a physical file?

How to select only specific c files in iOS to compile using xCode

I have a project containing C files, header files and other files with different extensions like:
Parent folder/C foolder/... all c Files.
Parent folder/Header folder/ ... all header files
Now, what I want is to compile only few c files from c folder and same for header. After looking at few links at stackoverflow like this post about how to exclude files with .m extensions by adding
-fno-objc-arc compiler flag, but doesn't explains how to exclude .c files.
This is accomplished within Xcode by defining which source files are associated with a particular build target.
Each Xcode project can have multiple targets and source files can be associated with one or more targets.
Header files are not associated in the same way, but get their association by whatever source files include/import them.
You can set the target when you add the file to Xcode (reference) and you can change it later via the source file's properties (reference).

Why Delphi does not output the DCU files in the correct folder?

I have a project (C:\Test\Test.dpr) that uses a file (External.pas) belonging to library (MyLib.DPK). All files in the library are accessible via 'Search' path but I also included External.pas directly in my DPR file:
program Test;
uses
External in '..\Packages\MyLib\External.pas', <------ the 'external' file
FormMain in 'FormMain.pas' {frmMain};
For this project I set the 'Output directory' and 'Output DCU dir' to ".\$(Platform)_$(Config)".
When I compile, the exe file all DCUs of this project are written in the correct output folder: c:\Test\Win64_Debug\
However, the External.dcu is generated in ..\Packages\MyLib\External.dcu
instead of c:\Test\Win64_Debug\
Why is that?
Let me ask the question in a different way: if to a DPR project I append a PAS file that is in a different folder, shouldn't all DCU files (including the external file) be generated in the same folder as the EXE file?
From the documentation:
Output directory
Specifies where the compiler should put the executable file.
Unit output directory
Specifies a separate directory to contain the compiled units (.dcu).
It sounds like you need to specify the unit output directory as well as the output directory. Personally I tend to keep these two directories separate.
Yes the Project Options UI can be quite confusing especially because in order to access settings for each target platform you need to switch to that target platform via the dropdown list.
This part of the IDE could be made much better if you could simply see configurations for all target platforms at once.
Now if you want to be able to maintain output paths setting on one location (All configurations) you just need to make sure that specific target configurations are not overriding it.
To do so go to specific target configuration and then instead of clicking on the field entry itself click on the + sign in front of it.
This will expand current property field and also show the values from parent configurations from which this property can be inherited from.
NOTE: While many properties can indeed be inherited (property values from target configuration are added to properties from parent scheme like) Output directory and Unit output directory since they can contain only one value are simply overridden.
So in order to make sure that output locations from All configurations is used in every specific target configurations none of them should not have defined custom value for output locations.
In other words values from Release configuration - ... or Debug configuration - ... when you have specific property expanded must be empty like in the picture above.
Damn it... I did it again... I set the Target for 'All configurations - All Platforms' but the path for 'Debug config-64bit windows platform' was already set to something else. So, when I set the (correct) path in 'All configurations', the 'Debug config-64bit windows platform' remained as it was. I have 12 possible configurations (debug, release, pre-release) so I haven't seen that 'Debug config-64bit windows platform' remained set to the original value. The GUI for Project Options can cause lots of mistakes!
Thanks David. Sorry for wasting your time. I am still struggling with Delphi paths. There is nothing in the whole IDE as confusing/weird as the paths (search, output, library, etc)

Loading ant properties from other build files

I want to run an ant target 'run_junit' in my build.xml which uses the properties defined in multiple build files say junit.xml in various sub directories. I want to load all the properties from all the junit.xml files in various sub dirs before invoking this particular target.
I tried following
import the junit.xml files - This cannot be imported within a target. I do not want to import the files always.
read the junit.xml files within a target say 'load_properties' but property set in one target is not available in another target.
Can someone suggest me a way to achieve this ?
Thanks
If you want to use the properties in multiple targets, you would have to import them globally.
To Include another ANT file:
<include file="${path_to_file}/file.xml"/>
To Import properties from another file:
<property file="file_name.properties"/>
Note: These are all global definitions

Using subproject's xcdatamodelId in main project

I have in XCode a main project that relies on a subproject to work. The subproject is basically a library that also define a database model, and the way to interact with it.
To use the subproject in the main project, I just dropped the subproject xcodeproj file in the main project, did some setup (like specifying header search path), and that's it.
I'm using core data, but if I try to use the .xcdatamodelId files directly, by creating managed object context, it fails : looks like the main project can't find the subproject ressources (except .h and .m files).
The only solution I found so far is to copy the .xcdatamodelId file from the subproject in the main project, and it does the trick. But it's not satisfactory, as I have to maintain two files if my model evolves.
I was struggling with this issue for a while and I want to answer it here as I believe it is important.
In order to add model files from a sub-project into the parent project you simply locate the model files you want to add in Finder. You can then drag them into your project into any folder you see fit. When Xcode displays the "Choose options for adding these files" prompt, deselect the "Copy items into destination group's folder" item and you can select either "Create Groups..." or "Create folder references...". After this process you should see the model files under the compile sources phase in Build Settings.
It is important to note that dragging the model files (in Xcode) from the sub-project into either "Compile Sources" or the parent project will not work to my knowledge so rather do it in Finder.

Resources