Fix build script
[platform/core/csapi/tizenfx.git] / build / build.dummy.csproj
1 <Project DefaultTargets="Build">
2
3   <Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
4
5   <Import Project="$(MSBuildThisFileDirectory)directories.props" />
6   <Import Project="$(MSBuildThisFileDirectory)version.props" />
7
8   <PropertyGroup>
9     <TargetFramework>netstandard1.6</TargetFramework>
10     <GenerateDependencyFile>false</GenerateDependencyFile>
11     <DummyAssemblyVersion>$(VersionPrefix)</DummyAssemblyVersion>
12     <BaseIntermediateOutputPath>$(OutputBaseDir)obj\</BaseIntermediateOutputPath>
13     <OutDir>$(OutputDummyDir)</OutDir>
14   </PropertyGroup>
15
16   <!-- Properties for directories -->
17   <PropertyGroup>
18     <IntermediateLibDir>$(BaseIntermediateOutputPath)_ref_lib\</IntermediateLibDir>
19     <IntermediateAPIDir>$(BaseIntermediateOutputPath)_ref_api\</IntermediateAPIDir>
20   </PropertyGroup>
21
22   <!-- Properties for GenAPI tool -->
23   <PropertyGroup>
24     <GenAPICommand>dotnet $(GenAPIDir)GenAPI.exe</GenAPICommand>
25   </PropertyGroup>
26
27   <!-- Source assemblies -->
28   <ItemGroup>
29     <TizenAssemblies Include="$(OutputPublicDir)\*.dll" />
30     <TizenAssemblies Include="$(OutputPlatformDir)\*.dll" />
31   </ItemGroup>
32
33   <Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
34
35   <Target Name="Compile" />
36   <Target Name="CopyFilesToOutputDirectory" />
37
38   <!-- Target for preparing reference lib directory -->
39   <Target Name="Prepare">
40     <ItemGroup>
41       <ReferencePath Include="@(TizenAssemblies)" />
42     </ItemGroup>
43     <MakeDir Directories="$(IntermediateLibDir);$(IntermediateAPIDir)" />
44     <Copy SourceFiles="@(ReferencePath)" DestinationFolder="$(IntermediateLibDir)" />
45     <RemoveDir Directories="$(OutputDummyDir)" />
46     <MakeDir Directories="$(OutputDummyDir)" />
47   </Target>
48
49   <!-- Target for generating *.AssemblyInfo.cs files -->
50   <Target Name="GenerateAsmInfo"
51           Inputs="@(TizenAssemblies)" Outputs="$(IntermediateAPIDir)%(Filename).AssemblyInfo.cs">
52
53     <PropertyGroup>
54       <GeneratedAssemblyInfoSource>$(IntermediateAPIDir)%(TizenAssemblies.Filename).AssemblyInfo.cs</GeneratedAssemblyInfoSource>
55     </PropertyGroup>
56
57     <ItemGroup>
58       <AssemblyInfoLines Include="[assembly:System.Reflection.AssemblyVersion(&quot;$(DummyAssemblyVersion)&quot;)]" />
59     </ItemGroup>
60
61     <WriteLinesToFile
62       File="$(GeneratedAssemblyInfoSource)"
63       Lines="@(AssemblyInfoLines)"
64       Overwrite="true" />
65
66     <ItemGroup>
67       <FileWrites Include="$(GeneratedAssemblyInfoSource)" />
68     </ItemGroup>
69
70   </Target>
71
72   <!-- Target for generating reference source files using GenAPI -->
73   <Target Name="GenerateAPI"
74           Inputs="@(TizenAssemblies)" Outputs="$(IntermediateAPIDir)%(Filename).cs">
75     <PropertyGroup>
76       <GeneratedReferenceAssemblySource>$(IntermediateAPIDir)%(TizenAssemblies.Filename).cs</GeneratedReferenceAssemblySource>
77     </PropertyGroup>
78
79     <Message Text="[GenAPI] %(TizenAssemblies.Filename) -> $(GeneratedReferenceAssemblySource)" Importance="High" />
80
81     <Exec Command='$(GenAPICommand) -assembly:&quot;%(TizenAssemblies.Identity)&quot; -libPath:&quot;$(IntermediateLibDir)&quot; -out:&quot;$(GeneratedReferenceAssemblySource)&quot; -throw:&quot;Not Supported Feature&quot; -global' />
82   </Target>
83
84
85   <Target Name="GenerateDummy"
86           DependsOnTargets="GenerateAsmInfo;GenerateAPI"
87           Inputs="@(TizenAssemblies)" Outputs="$(OutputDummyDir)%(TizenAssemblies.Filename).dll">
88     <PropertyGroup>
89       <ThisAssemblyFilename>%(TizenAssemblies.Filename)</ThisAssemblyFilename>
90       <GeneratedAssemblyInfoSource>$(IntermediateAPIDir)%(TizenAssemblies.Filename).AssemblyInfo.cs</GeneratedAssemblyInfoSource>
91       <GeneratedReferenceAssemblySource>$(IntermediateAPIDir)%(TizenAssemblies.Filename).cs</GeneratedReferenceAssemblySource>
92       <GeneratedReferenceAssembly>$(OutputDummyDir)%(TizenAssemblies.Filename).dll</GeneratedReferenceAssembly>
93     </PropertyGroup>
94
95     <Message Text="[Compile] %(TizenAssemblies.Filename) -> $(GeneratedReferenceAssembly)" Importance="High" />
96
97     <ItemGroup>
98       <FilteredReferencePath Include="@(ReferencePath)" Condition="%(Filename) != $(ThisAssemblyFilename)" />
99     </ItemGroup>
100
101     <Csc
102         Sources="$(GeneratedReferenceAssemblySource);$(GeneratedAssemblyInfoSource)"
103         OutputAssembly="$(GeneratedReferenceAssembly)"
104         AdditionalLibPaths="$(AdditionalLibPaths)"
105         AllowUnsafeBlocks="true"
106         DefineConstants="$(DefineConstants)"
107         DisabledWarnings="$(NoWarn)"
108         TargetType="$(OutputType)"
109         NoStandardLib="$(NoCompilerStandardLib)"
110         References="@(FilteredReferencePath)"
111         Deterministic="true"
112         ToolExe="$(CscToolExe)"
113         ToolPath="$(CscToolPath)" />
114
115   </Target>
116
117   <Target Name="AfterBuild" DependsOnTargets="Prepare;GenerateDummy">
118   </Target>
119
120 </Project>
121