| 1 |
(: |
| 2 |
* This template is only for generating csharp donet project files |
| 3 |
* |
| 4 |
* @PROJECT_NAME@ - name of the Visual Studio project |
| 5 |
* @PROJECT_INPUT@ - input XML document that drives the script. |
| 6 |
:) |
| 7 |
declare boundary-space preserve; |
| 8 |
|
| 9 |
declare function local:getProjects() |
| 10 |
{ |
| 11 |
doc("@PROJECT_INPUT@")/projects/project[@name="@PROJECT_NAME@"] |
| 12 |
}; |
| 13 |
|
| 14 |
declare function local:genDllProjects($project) |
| 15 |
{ |
| 16 |
let $guid := $project/@guid/string() |
| 17 |
let $path := $project/files/@path/string() |
| 18 |
let $files := $project/files/file |
| 19 |
let $AssemblyName := $project/AssemblyName/string() |
| 20 |
let $DocumentationFile := $project/DocumentationFile/string() |
| 21 |
return |
| 22 |
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> |
| 23 |
<PropertyGroup> |
| 24 |
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
| 25 |
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> |
| 26 |
<ProjectGuid>{"{"}{$guid}{"}"}</ProjectGuid> |
| 27 |
<OutputType>Library</OutputType> |
| 28 |
<NoStandardLibraries>false</NoStandardLibraries> |
| 29 |
<AssemblyName>{$AssemblyName}</AssemblyName> |
| 30 |
<RootNamespace>BerkeleyDB</RootNamespace> |
| 31 |
<FileUpgradeFlags> |
| 32 |
</FileUpgradeFlags> |
| 33 |
<UpgradeBackupLocation> |
| 34 |
</UpgradeBackupLocation> |
| 35 |
<OldToolsVersion>2.0</OldToolsVersion> |
| 36 |
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion> |
| 37 |
<PublishUrl>publish\</PublishUrl> |
| 38 |
<Install>true</Install> |
| 39 |
<InstallFrom>Disk</InstallFrom> |
| 40 |
<UpdateEnabled>false</UpdateEnabled> |
| 41 |
<UpdateMode>Foreground</UpdateMode> |
| 42 |
<UpdateInterval>7</UpdateInterval> |
| 43 |
<UpdateIntervalUnits>Days</UpdateIntervalUnits> |
| 44 |
<UpdatePeriodically>false</UpdatePeriodically> |
| 45 |
<UpdateRequired>false</UpdateRequired> |
| 46 |
<MapFileExtensions>true</MapFileExtensions> |
| 47 |
<ApplicationRevision>0</ApplicationRevision> |
| 48 |
<ApplicationVersion>1.0.0.%2a</ApplicationVersion> |
| 49 |
<IsWebBootstrapper>false</IsWebBootstrapper> |
| 50 |
<UseApplicationTrust>false</UseApplicationTrust> |
| 51 |
<BootstrapperEnabled>true</BootstrapperEnabled> |
| 52 |
<StartupObject> |
| 53 |
</StartupObject> |
| 54 |
</PropertyGroup> |
| 55 |
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> |
| 56 |
<DebugSymbols>true</DebugSymbols> |
| 57 |
<DebugType>full</DebugType> |
| 58 |
<Optimize>false</Optimize> |
| 59 |
<OutputPath>..\..\..\build_windows\AnyCPU\Debug\</OutputPath> |
| 60 |
<DefineConstants>DEBUG;TRACE</DefineConstants> |
| 61 |
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> |
| 62 |
<DocumentationFile>{$DocumentationFile}</DocumentationFile> |
| 63 |
<NoWarn>419</NoWarn> |
| 64 |
</PropertyGroup> |
| 65 |
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> |
| 66 |
<DebugType>pdbonly</DebugType> |
| 67 |
<Optimize>true</Optimize> |
| 68 |
<OutputPath>..\..\..\build_windows\AnyCPU\Release\</OutputPath> |
| 69 |
<DefineConstants>TRACE</DefineConstants> |
| 70 |
<DocumentationFile>{$DocumentationFile}</DocumentationFile> |
| 71 |
<NoWarn>419</NoWarn> |
| 72 |
</PropertyGroup> |
| 73 |
<ItemGroup> |
| 74 |
<Reference Include="System" /> |
| 75 |
<Reference Include="System.Data" /> |
| 76 |
<Reference Include="System.Xml" /> |
| 77 |
</ItemGroup> |
| 78 |
<ItemGroup> |
| 79 |
{ for $file in $files |
| 80 |
return (<Compile Include="{$path}{$file/@name/string()}" />, "
 ") |
| 81 |
} |
| 82 |
</ItemGroup> |
| 83 |
<ItemGroup> |
| 84 |
<BootstrapperPackage Include="Microsoft.Net.Framework.2.0"> |
| 85 |
<Visible>False</Visible> |
| 86 |
<ProductName>.NET Framework 2.0 %28x86%29</ProductName> |
| 87 |
<Install>true</Install> |
| 88 |
</BootstrapperPackage> |
| 89 |
<BootstrapperPackage Include="Microsoft.Net.Framework.3.0"> |
| 90 |
<Visible>False</Visible> |
| 91 |
<ProductName>.NET Framework 3.0 %28x86%29</ProductName> |
| 92 |
<Install>false</Install> |
| 93 |
</BootstrapperPackage> |
| 94 |
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5"> |
| 95 |
<Visible>False</Visible> |
| 96 |
<ProductName>.NET Framework 3.5</ProductName> |
| 97 |
<Install>false</Install> |
| 98 |
</BootstrapperPackage> |
| 99 |
</ItemGroup> |
| 100 |
<Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" /> |
| 101 |
<ProjectExtensions> |
| 102 |
<VisualStudio AllowExistingFolder="true" /> |
| 103 |
</ProjectExtensions> |
| 104 |
</Project> |
| 105 |
}; |
| 106 |
|
| 107 |
declare function local:genAppProjects($project) |
| 108 |
{ |
| 109 |
let $guid := $project/@guid/string() |
| 110 |
let $files := $project/files/file |
| 111 |
let $path := $project/files/@path/string() |
| 112 |
let $projectName := $project/@name/string() |
| 113 |
let $ProjectReference := $project/../ProjectReference |
| 114 |
let $PreBuildEvent := $project/PreBuildEvent/string() |
| 115 |
return |
| 116 |
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
| 117 |
<PropertyGroup> |
| 118 |
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
| 119 |
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> |
| 120 |
<ProductVersion>8.0.50727</ProductVersion> |
| 121 |
<SchemaVersion>2.0</SchemaVersion> |
| 122 |
<ProjectGuid>{"{"}{$guid}{"}"}</ProjectGuid> |
| 123 |
<OutputType>Exe</OutputType> |
| 124 |
<AppDesignerFolder>Properties</AppDesignerFolder> |
| 125 |
<RootNamespace>{$projectName}</RootNamespace> |
| 126 |
<AssemblyName>{$projectName}</AssemblyName> |
| 127 |
</PropertyGroup> |
| 128 |
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> |
| 129 |
<DebugSymbols>true</DebugSymbols> |
| 130 |
<DebugType>full</DebugType> |
| 131 |
<Optimize>false</Optimize> |
| 132 |
<OutputPath>..\..\..\build_windows\AnyCPU\Debug\</OutputPath> |
| 133 |
<DefineConstants>DEBUG;TRACE</DefineConstants> |
| 134 |
<ErrorReport>prompt</ErrorReport> |
| 135 |
<WarningLevel>4</WarningLevel> |
| 136 |
</PropertyGroup> |
| 137 |
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> |
| 138 |
<DebugType>pdbonly</DebugType> |
| 139 |
<Optimize>true</Optimize> |
| 140 |
<OutputPath>..\..\..\build_windows\AnyCPU\Release\</OutputPath> |
| 141 |
<DefineConstants>TRACE</DefineConstants> |
| 142 |
<ErrorReport>prompt</ErrorReport> |
| 143 |
<WarningLevel>4</WarningLevel> |
| 144 |
</PropertyGroup> |
| 145 |
<ItemGroup> |
| 146 |
<Reference Include="System" /> |
| 147 |
<Reference Include="System.Data" /> |
| 148 |
<Reference Include="System.Xml" /> |
| 149 |
</ItemGroup> |
| 150 |
<ItemGroup> |
| 151 |
{ for $file in $files |
| 152 |
return (<Compile Include="{$path}{$file/@name/string()}" />, "
 ") |
| 153 |
} |
| 154 |
</ItemGroup> |
| 155 |
<ItemGroup> |
| 156 |
<ProjectReference Include="{$ProjectReference/@Include/string()}" > |
| 157 |
<Project>{"{"}{$ProjectReference/@ProjectUID/string()}{"}"}</Project> |
| 158 |
<Name>{$ProjectReference/@ProjectName/string()}</Name> |
| 159 |
</ProjectReference> |
| 160 |
</ItemGroup> |
| 161 |
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> |
| 162 |
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. |
| 163 |
Other similar extension points exist, see Microsoft.Common.targets. |
| 164 |
<Target Name="BeforeBuild"> |
| 165 |
</Target> |
| 166 |
<Target Name="AfterBuild"> |
| 167 |
</Target> |
| 168 |
--> |
| 169 |
<PropertyGroup> |
| 170 |
<PreBuildEvent>{$PreBuildEvent}</PreBuildEvent> |
| 171 |
</PropertyGroup> |
| 172 |
</Project> |
| 173 |
}; |
| 174 |
|
| 175 |
declare function local:genTestProjects($project) |
| 176 |
{ |
| 177 |
let $guid := $project/@guid/string() |
| 178 |
let $files := $project/files/file |
| 179 |
let $path := $project/files/@path/string() |
| 180 |
let $projectName := $project/@name/string() |
| 181 |
let $ProjectReference := $project/ProjectReference |
| 182 |
let $PreBuildEvent := $project/PreBuildEvent/string() |
| 183 |
return |
| 184 |
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
| 185 |
<PropertyGroup> |
| 186 |
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
| 187 |
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> |
| 188 |
<ProductVersion>8.0.50727</ProductVersion> |
| 189 |
<SchemaVersion>2.0</SchemaVersion> |
| 190 |
<ProjectGuid>{"{"}{$guid}{"}"}</ProjectGuid> |
| 191 |
<OutputType>Library</OutputType> |
| 192 |
<AppDesignerFolder>Properties</AppDesignerFolder> |
| 193 |
<RootNamespace>DotNetTest</RootNamespace> |
| 194 |
<AssemblyName>DotNetTest</AssemblyName> |
| 195 |
<StartupObject> |
| 196 |
</StartupObject> |
| 197 |
</PropertyGroup> |
| 198 |
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> |
| 199 |
<DebugSymbols>true</DebugSymbols> |
| 200 |
<DebugType>full</DebugType> |
| 201 |
<Optimize>false</Optimize> |
| 202 |
<OutputPath>bin\Debug\</OutputPath> |
| 203 |
<DefineConstants>DEBUG;TRACE</DefineConstants> |
| 204 |
<ErrorReport>prompt</ErrorReport> |
| 205 |
<WarningLevel>4</WarningLevel> |
| 206 |
</PropertyGroup> |
| 207 |
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> |
| 208 |
<DebugType>pdbonly</DebugType> |
| 209 |
<Optimize>true</Optimize> |
| 210 |
<OutputPath>bin\Release\</OutputPath> |
| 211 |
<DefineConstants>TRACE</DefineConstants> |
| 212 |
<ErrorReport>prompt</ErrorReport> |
| 213 |
<WarningLevel>4</WarningLevel> |
| 214 |
</PropertyGroup> |
| 215 |
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> |
| 216 |
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. |
| 217 |
Other similar extension points exist, see Microsoft.Common.targets. |
| 218 |
<Target Name="BeforeBuild"> |
| 219 |
</Target> |
| 220 |
<Target Name="AfterBuild"> |
| 221 |
</Target> |
| 222 |
--> |
| 223 |
<ItemGroup> |
| 224 |
{ for $file in $files |
| 225 |
return |
| 226 |
if (exists($file/@SubType)) then |
| 227 |
(<Compile Include="{$path}{$file/@name/string()}"><SubType>{$file/@SubType/string()}</SubType></Compile>, "
 ") |
| 228 |
else |
| 229 |
(<Compile Include="{$path}{$file/@name/string()}" />, "
 ") |
| 230 |
} |
| 231 |
</ItemGroup> |
| 232 |
<ItemGroup> |
| 233 |
<ProjectReference Include="{$ProjectReference/@Include/string()}" > |
| 234 |
<Project>{"{"}{$ProjectReference/@ProjectUID/string()}{"}"}</Project> |
| 235 |
<Name>{$ProjectReference/@ProjectName/string()}</Name> |
| 236 |
</ProjectReference> |
| 237 |
</ItemGroup> |
| 238 |
<ItemGroup> |
| 239 |
<Reference Include="nunit.framework, Version=2.5.3.9345, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL" /> |
| 240 |
<Reference Include="System" /> |
| 241 |
<Reference Include="System.Data" /> |
| 242 |
<Reference Include="System.XML" /> |
| 243 |
</ItemGroup> |
| 244 |
<PropertyGroup> |
| 245 |
<PreBuildEvent>{$PreBuildEvent}</PreBuildEvent> |
| 246 |
</PropertyGroup> |
| 247 |
<ItemGroup> |
| 248 |
<Content Include="AllTestData.xml" /> |
| 249 |
</ItemGroup> |
| 250 |
<ItemGroup> |
| 251 |
<None Include="bdb4.7.db" /> |
| 252 |
</ItemGroup> |
| 253 |
</Project> |
| 254 |
}; |
| 255 |
|
| 256 |
for $project in local:getProjects() |
| 257 |
return |
| 258 |
if ($project/type[string()="dll"]) then |
| 259 |
local:genDllProjects($project) |
| 260 |
else if ($project/type[string()="app"]) then |
| 261 |
local:genAppProjects($project) |
| 262 |
else if ($project/type[string()="test"]) then |
| 263 |
local:genTestProjects($project) |
| 264 |
else() |