[Mono-dev] Targets file to aid in Mono development on Visual Studio 2005 Beta 2
Miguel de Icaza
miguel at ximian.com
Thu Aug 25 11:14:31 EDT 2005
Hello,
> Attached is a file that we use for our cross platform development. It
> allows us to build a Linux or Mono release from Visual Studio .NET
> 2005 that targets the Mono class libraries including mscorlib in the
> same solution as our .NET 1.1 and .NET 2.0 targets. For those of you
> who are developing cross platform C# and you are using Visual Studio
> 2005 Beta 2 as an IDE, this file will probably be useful.
Could you provide a patch that we could include in the README.vsnet
file?
Miguel
>
> To use it change the line in your csproj file:
>
> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
>
> To:
>
> <Import Project="..\..\Relative\Path\To\Coversant.CSharp.targets">
>
> This needs to be done in each project file in your solution. Also you
> may need to adjust the installation path for your mono setup, in the
> targets file.
>
> Once this is done, load up your solution/project. You should notice
> under the Solution platforms you have Linux, Mono 2.0, .NET 1.1, and
> Any CPU.
> * Linux and Mono are basically the same. They just differ in
> the DefineConstants.
> * .NET 1.1 is to target the old .NET runtime.
> * Any CPU is your standard .NET 2.0 target.
>
> --
>
>
> Mike Hull
> Coversant, Inc.
> Leader in XMPP Instant Messaging
>
> Cell: +1.209.564.0146
> Email/XMPP: mike.hull at coversant.net
> http://www.coversant.net
>
>
>
> This communication (including all attachments and the list of
> electronic addresses) (collectively, the "Communication") is
> confidential and proprietary to the sender or the party for whom the
> sender may be acting as an agent. This Communication may be
> privileged. This Communication is protected by applicable federal,
> state and local laws and is intended solely for the use of the person
> or persons to whom it is addressed. If any recipient of this
> Communication is not the intended recipient or an agent responsible
> for delivering it to the intended recipient, you are hereby notified
> that you have received this Communication in error and that any
> review, distribution, disclosure, reproduction or use of this
> Communication is strictly prohibited. If you have received this
> Communication in error, please notify the sender by reply electronic
> mail and delete this Communication. Sender does not accept liability
> of any kind for any loss or damage to any computer system or data
> arising or resulting from unauthorized review, distribution,
> disclosure, reproduction or use of this Communication. All rights
> reserved.
>
>
>
>
> Plain text document attachment (Coversant.CSharp.targets)
> <Project
> DefaultTargets="Build"
> xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
>
> <PropertyGroup>
> <MonoPath>C:\\program files\\Mono-1.1.8\\lib\\mono\\2.0\\</MonoPath>
> </PropertyGroup>
>
> <!--Begin Linux Target-->
> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|Linux' ">
> <DebugSymbols Condition="'$(DebugSymbols)'==''">true</DebugSymbols>
> <DebugType Condition="'$(DebugType)'==''">full</DebugType>
> <Optimize Condition="'$(Optimize)'==''">false</Optimize>
> <OutputPath Condition="'$(OutputPath)'==''">bin\Linux\Debug\</OutputPath>
> <DefineConstants Condition="'$(DefineConstants)'==''">DEBUG;TRACE</DefineConstants>
> <DefineConstants>$(DefineConstants);MONO;LINUX;</DefineConstants>
> <ErrorReport></ErrorReport>
> <WarningLevel Condition="'$(WarningLevel)'==''">4</WarningLevel>
> <UseHostCompilerIfAvailable>false</UseHostCompilerIfAvailable>
> <NoStdLib>true</NoStdLib>
> </PropertyGroup>
>
> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|Linux' ">
> <DebugType Condition="'$(DebugType)'==''">pdbonly</DebugType>
> <Optimize Condition="'$(Optimize)'==''">true</Optimize>
> <OutputPath Condition="'$(OutputPath)'==''">bin\Linux\Release\</OutputPath>
> <DefineConstants Condition="'$(DefineConstants)'==''">TRACE</DefineConstants>
> <DefineConstants>$(DefineConstants);MONO;LINUX;</DefineConstants>
> <ErrorReport></ErrorReport>
> <WarningLevel Condition="'$(WarningLevel)'==''">4</WarningLevel>
> <UseHostCompilerIfAvailable>false</UseHostCompilerIfAvailable>
> <NoStdLib>true</NoStdLib>
> </PropertyGroup>
> <!--End Linux Target-->
>
> <!--Begin Mono 2.0 Target-->
> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|Mono 2.0' ">
> <DebugSymbols Condition="'$(DebugSymbols)'==''">true</DebugSymbols>
> <DebugType Condition="'$(DebugType)'==''">full</DebugType>
> <Optimize Condition="'$(Optimize)'==''">false</Optimize>
> <OutputPath Condition="'$(OutputPath)'==''">bin\Mono 2.0\Debug\</OutputPath>
> <DefineConstants Condition="'$(DefineConstants)'==''">DEBUG;TRACE</DefineConstants>
> <DefineConstants>$(DefineConstants);MONO</DefineConstants>
> <ErrorReport></ErrorReport>
> <WarningLevel Condition="'$(WarningLevel)'==''">4</WarningLevel>
> <UseHostCompilerIfAvailable>false</UseHostCompilerIfAvailable>
> <NoStdLib>true</NoStdLib>
> </PropertyGroup>
>
> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|Mono 2.0' ">
> <DebugType Condition="'$(DebugType)'==''">pdbonly</DebugType>
> <Optimize Condition="'$(Optimize)'==''">true</Optimize>
> <OutputPath Condition="'$(OutputPath)'==''">bin\Mono 2.0\Release\</OutputPath>
> <DefineConstants Condition="'$(DefineConstants)'==''">MONO;TRACE</DefineConstants>
> <DefineConstants>$(DefineConstants);MONO</DefineConstants>
> <ErrorReport></ErrorReport>
> <WarningLevel Condition="'$(WarningLevel)'==''">4</WarningLevel>
> <UseHostCompilerIfAvailable>false</UseHostCompilerIfAvailable>
> <NoStdLib>true</NoStdLib>
> </PropertyGroup>
>
> <!--End Mono 2.0 Target-->
>
> <!--Begin .NET 1.1 Target-->
> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|.NET 1.1' ">
> <DebugSymbols Condition="'$(DebugSymbols)'==''">true</DebugSymbols>
> <DebugType Condition="'$(DebugType)'==''">full</DebugType>
> <Optimize Condition="'$(Optimize)'==''">false</Optimize>
> <OutputPath Condition="'$(OutputPath)'==''">bin\.NET 1.1\Debug\</OutputPath>
> <DefineConstants Condition="'$(DefineConstants)'==''">DEBUG;TRACE</DefineConstants>
> <DefineConstants>$(DefineConstants);NET_1_1</DefineConstants>
> <ErrorReport></ErrorReport>
> <WarningLevel Condition="'$(WarningLevel)'==''">4</WarningLevel>
> <UseHostCompilerIfAvailable>false</UseHostCompilerIfAvailable>
> <CscToolPath>$(SystemRoot)\Microsoft.NET\Framework\v1.1.4322</CscToolPath>
> <TargetFrameworkVersion>v1.0</TargetFrameworkVersion>
> </PropertyGroup>
>
> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|.NET 1.1' ">
> <DebugType Condition="'$(DebugType)'==''">pdbonly</DebugType>
> <Optimize Condition="'$(Optimize)'==''">true</Optimize>
> <OutputPath Condition="'$(OutputPath)'==''">bin\.NET 1.1\Release\</OutputPath>
> <DefineConstants Condition="'$(DefineConstants)'==''">TRACE</DefineConstants>
> <DefineConstants>$(DefineConstants);NET_1_1</DefineConstants>
> <ErrorReport></ErrorReport>
> <WarningLevel Condition="'$(WarningLevel)'==''">4</WarningLevel>
> <UseHostCompilerIfAvailable>false</UseHostCompilerIfAvailable>
> <CscToolPath>$(SystemRoot)\Microsoft.NET\Framework\v1.1.4322</CscToolPath>
> <TargetFrameworkVersion>v1.0</TargetFrameworkVersion>
> </PropertyGroup>
> <!--End .NET 1.1 Target-->
>
> <!-- AnyCPU Target -->
> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
> <DebugSymbols>true</DebugSymbols>
> <DebugType>full</DebugType>
> <Optimize>false</Optimize>
> <OutputPath>bin\Debug\</OutputPath>
> <DefineConstants Condition="'$(DefineConstants)'==''">DEBUG;TRACE</DefineConstants>
> <DefineConstants>$(DefineConstants);NET_2_0</DefineConstants>
> <ErrorReport>prompt</ErrorReport>
> <WarningLevel>4</WarningLevel>
> </PropertyGroup>
> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
> <DebugType>pdbonly</DebugType>
> <Optimize>true</Optimize>
> <OutputPath>bin\Release\</OutputPath>
> <DefineConstants Condition="'$(DefineConstants)'==''">TRACE</DefineConstants>
> <DefineConstants>$(DefineConstants);NET_2_0</DefineConstants>
> <ErrorReport>prompt</ErrorReport>
> <WarningLevel>4</WarningLevel>
> </PropertyGroup>
> <!--End AnyCPU Target-->
>
> <!-- Linux and Mono References-->
> <ItemGroup Condition="'$(Platform)' == 'Mono 2.0' Or '$(Platform)' == 'Linux' ">
> <Reference Include="mscorlib">
> <Name>mscorlib</Name>
> <HintPath>$(MonoPath)</HintPath>
> </Reference>
> </ItemGroup>
>
> <!--Import Micrsoft CSharp Targets-->
> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
>
> <!--Override some of the standard target settings-->
>
> <PropertyGroup>
> <AvailablePlatforms>$(AvailablePlatforms),Linux,Mono 2.0,.NET 1.1</AvailablePlatforms>
> <AssemblySearchPaths Condition=" '$(Platform)' == 'Linux' Or '$(Platform)' == 'Mono 2.0' Or '$(Platform)' == '.NET 1.1'">
> {CandidateAssemblyFiles};
> $(ReferencePath);
> {HintPathFromItem};
> {TargetFrameworkDirectory};
> {AssemblyFolders};
> $(OutputPath);
> {GAC}
> </AssemblySearchPaths>
> <TargetFrameworkDirectory Condition=" '$(Platform)' == 'Linux' Or '$(Platform)' == 'Mono 2.0'">
> $(MonoPath)
> </TargetFrameworkDirectory>
> <TargetFrameworkDirectory Condition=" '$(Platform)' == '.NET 1.1'">
> $(SystemRoot)\Microsoft.NET\Framework\v1.1.4322
> </TargetFrameworkDirectory>
> </PropertyGroup>
>
> <ItemGroup Condition=" '$(Platform)' == 'Linux' Or '$(Platform)' == 'Mono 2.0'">
> <TargetFrameworkDirectoryItem Include="$(MonoPath)">
> <InProject>false</InProject>
> </TargetFrameworkDirectoryItem>
> </ItemGroup>
> <ItemGroup Condition=" '$(Platform)' == '.NET 1.1'">
> <TargetFrameworkDirectoryItem Include="$(SystemRoot)\Microsoft.NET\Framework\v1.1.4322">
> <InProject>false</InProject>
> </TargetFrameworkDirectoryItem>
> </ItemGroup>
>
> <Target
> Name="GetFrameworkPaths"
> DependsOnTargets="$(GetFrameworkPathsDependsOn)">
> <GetFrameworkPath
> Condition=" '$(Platform)' == 'AnyCPU' Or '$(Platform)' == 'Any CPU'">
> <Output TaskParameter="Path" PropertyName="TargetFrameworkDirectory"/>
> <Output TaskParameter="Path" ItemName="TargetFrameworkDirectoryItem"/>
> </GetFrameworkPath>
> <GetFrameworkSDKPath
> Condition=" '$(Platform)' == 'AnyCPU' Or '$(Platform)' == 'Any CPU'">
> <Output TaskParameter="Path" PropertyName="TargetFrameworkSDKDirectory"/>
> <Output TaskParameter="Path" ItemName="TargetFrameworkSDKDirectoryItem"/>
> </GetFrameworkSDKPath>
> </Target>
>
> <!--Support .NET 1.1 Resrouce Files-->
> <UsingTask TaskName="CFResGen" AssemblyFile="$(MSBuildBinPath)\Microsoft.CompactFramework.Build.Tasks.dll" />
> <PropertyGroup Condition="'$(Platform)' == '.NET 1.1'">
> <ResGenDependsOn>ResolveAssemblyReferences;BeforeResGen;CoreResGen_1_1;AfterResGen</ResGenDependsOn>
> </PropertyGroup>
> <Target
> Name="CoreResGen_1_1"
> DependsOnTargets="$(CoreResGenDependsOn)">
>
> <CFResGen
> Condition = " '@(ResxWithNoCulture)' != ''"
> Sources = "@(ResxWithNoCulture)"
> UseSourcePath = "$(UseSourcePath)"
> StateFile = "$(IntermediateOutputPath)$(MSBuildProjectFile).CrossCompileResGen.Cache"
> OutputResources = "@(ManifestResourceWithNoCultureName->'$(IntermediateOutputPath)%(Identity).resources')"
> >
> <Output TaskParameter = "FilesWritten" ItemName="FileWrites"/>
> <Output TaskParameter = "OutputResources" ItemName="ManifestResourceWithNoCulture"/>
> </CFResGen>
>
> <CFResGen
> Condition = " '@(ResxWithCulture)' != ''"
> Sources = "@(ResxWithCulture)"
> UseSourcePath = "$(UseSourcePath)"
> StateFile = "$(IntermediateOutputPath)$(MSBuildProjectFile).CrossCompileResGen.Cache"
> OutputResources = "@(ManifestResourceWithCultureName->'$(IntermediateOutputPath)%(Identity).resources')"
> >
> <!-- Appending to 'FilesWritten' list lets us be part of Clean and Incremental Clean. -->
> <Output TaskParameter = "FilesWritten" ItemName="FileWrites"/>
> <Output TaskParameter = "OutputResources" ItemName="ManifestResourceWithCulture"/>
>
> </CFResGen>
> </Target>
>
>
> </Project>
> _______________________________________________ Mono-devel-list mailing list Mono-devel-list at lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
--
Miguel de Icaza <miguel at ximian.com>
More information about the Mono-devel-list
mailing list