MSBuild
From The Oxygene Language Wiki
This is a Platform topic
Feel free to add your notes to this topic below.
MSBuild is the build platform on which Visual Studio is based. It is included with .NET since framework version 2.0. Each project in Visual Studio is an XML file built on the predefined MSBuild format. MSBuild is completely extensible and lets users add new tasks or targets.
Sample of an MSBuild file:
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <RootNamespace>Loops</RootNamespace> <OutputType>exe</OutputType> <AssemblyName>Loops</AssemblyName> <ApplicationIcon>Properties\App.ico</ApplicationIcon> <Configuration Condition="'$(Configuration)' == ''">Release</Configuration> <ProjectGuid>{916BD89C-B610-4CEE-9CAF-C515D88E2C94}</ProjectGuid> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)' == 'Debug' "> <DefineConstants>DEBUG;TRACE;</DefineConstants> <OutputPath>.\bin\Debug</OutputPath> <GeneratePDB>True</GeneratePDB> <GenerateMDB>True</GenerateMDB> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)' == 'Release' "> <OutputPath>.\bin\Release</OutputPath> <EnableAsserts>False</EnableAsserts> </PropertyGroup> <Import Project="$(MSBuildExtensionsPath)\RemObjects Software\Oxygene\RemObjects.Oxygene.targets" /> <ItemGroup> <Reference Include="mscorlib" /> <Reference Include="System" /> <Reference Include="System.Core" /> <Reference Include="System.Data" /> <Reference Include="System.Xml" /> </ItemGroup> <ItemGroup> <Compile Include="Program.pas" /> <Content Include="Properties\App.ico" /> <Compile Include="Properties\AssemblyInfo.pas" /> <EmbeddResource Include="Properties\Resources.resx"> <Generator>ResXFileCodeGenerator</Generator> </EmbeddResource> <Compile Include="Properties\Resources.Designer.pas" /> <None Include="Properties\Settings.settings"> <Generator>SettingsSingleFileGenerator</Generator> </None> <Compile Include="Properties\Settings.Designer.pas" /> </ItemGroup> </Project>
Each part of this file serves its own purpose. The first <PropertyGroup> contains the project options. The second and third <PropertyGroup>s contain the configuration specific options and depend on the selected configuration (usually Debug and Release). The <Import> tag references the file that contains instructions on how to compile this file, this target file contains references to the Delphi Prism compiler and deals with resolving the references. The <ItemGroup> blocks contain the items referenced by this project.
Area: Oxygene Platforms
Platform Glossary — Keywords — Types — FAQ — How To