1 <Project DefaultTargets="Build">
3 <Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
5 <Import Project="$(MSBuildThisFileDirectory)directories.props" />
6 <Import Project="$(MSBuildThisFileDirectory)version.props" />
9 <TargetFramework>netstandard2.0</TargetFramework>
10 <GenerateDependencyFile>false</GenerateDependencyFile>
11 <DummyAssemblyVersion>$(VersionPrefix)</DummyAssemblyVersion>
12 <OutDir>$(OutputDummyDir)</OutDir>
15 <!-- Properties for directories -->
17 <IntermediateLibDir>$(BaseIntermediateOutputPath)_ref_lib\</IntermediateLibDir>
18 <IntermediateAPIDir>$(BaseIntermediateOutputPath)_ref_api\</IntermediateAPIDir>
21 <!-- Properties for GenAPI tool -->
23 <GenAPICommand>dotnet $(GenAPIDir)GenAPI.exe</GenAPICommand>
26 <!-- Source assemblies -->
28 <TizenAssemblies Include="$(OutputPublicDir)\*.dll" />
29 <TizenAssemblies Include="$(OutputInternalDir)\*.dll" />
32 <Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
34 <Target Name="Compile" />
35 <Target Name="CopyFilesToOutputDirectory" />
37 <!-- Target for preparing reference lib directory -->
38 <Target Name="Prepare" DependsOnTargets="ResolveAssemblyReferences">
40 <ReferencePath Include="@(TizenAssemblies)" />
42 <MakeDir Directories="$(IntermediateLibDir);$(IntermediateAPIDir)" />
43 <Copy SourceFiles="@(ReferencePath)" DestinationFolder="$(IntermediateLibDir)" />
44 <RemoveDir Directories="$(OutputDummyDir)" />
45 <MakeDir Directories="$(OutputDummyDir)" />
48 <!-- Target for generating *.AssemblyInfo.cs files -->
49 <Target Name="GenerateAsmInfo"
50 Inputs="@(TizenAssemblies)" Outputs="$(IntermediateAPIDir)%(Filename).AssemblyInfo.cs">
53 <GeneratedAssemblyInfoSource>$(IntermediateAPIDir)%(TizenAssemblies.Filename).AssemblyInfo.cs</GeneratedAssemblyInfoSource>
57 <AssemblyInfoLines Include="[assembly:System.Reflection.AssemblyVersion("$(DummyAssemblyVersion)")]" />
61 File="$(GeneratedAssemblyInfoSource)"
62 Lines="@(AssemblyInfoLines)"
66 <FileWrites Include="$(GeneratedAssemblyInfoSource)" />
71 <!-- Target for generating reference source files using GenAPI -->
72 <Target Name="GenerateAPI"
73 Inputs="@(TizenAssemblies)" Outputs="$(IntermediateAPIDir)%(Filename).cs">
75 <GeneratedReferenceAssemblySource>$(IntermediateAPIDir)%(TizenAssemblies.Filename).cs</GeneratedReferenceAssemblySource>
78 <Message Text="[GenAPI] %(TizenAssemblies.Filename) -> $(GeneratedReferenceAssemblySource)" Importance="High" />
80 <Exec Command='$(GenAPICommand) -assembly:"%(TizenAssemblies.Identity)" -libPath:$(IntermediateLibDir) -out:$(GeneratedReferenceAssemblySource) -throw:"Not Supported Feature" -global' />
84 <Target Name="GenerateDummy"
85 DependsOnTargets="GenerateAsmInfo;GenerateAPI"
86 Inputs="@(TizenAssemblies)" Outputs="$(OutputDummyDir)%(TizenAssemblies.Filename).dll">
88 <ThisAssemblyFilename>%(TizenAssemblies.Filename)</ThisAssemblyFilename>
89 <GeneratedAssemblyInfoSource>$(IntermediateAPIDir)%(TizenAssemblies.Filename).AssemblyInfo.cs</GeneratedAssemblyInfoSource>
90 <GeneratedReferenceAssemblySource>$(IntermediateAPIDir)%(TizenAssemblies.Filename).cs</GeneratedReferenceAssemblySource>
91 <GeneratedReferenceAssembly>$(OutputDummyDir)%(TizenAssemblies.Filename).dll</GeneratedReferenceAssembly>
94 <Message Text="[Compile] %(TizenAssemblies.Filename) -> $(GeneratedReferenceAssembly)" Importance="High" />
97 <FilteredReferencePath Include="@(ReferencePath)" Condition="%(Filename) != $(ThisAssemblyFilename)" />
101 Sources="$(GeneratedReferenceAssemblySource);$(GeneratedAssemblyInfoSource)"
102 OutputAssembly="$(GeneratedReferenceAssembly)"
103 AdditionalLibPaths="$(AdditionalLibPaths)"
104 AllowUnsafeBlocks="true"
105 DefineConstants="$(DefineConstants)"
106 DisabledWarnings="$(NoWarn)"
107 TargetType="$(OutputType)"
108 NoStandardLib="$(NoCompilerStandardLib)"
109 References="@(FilteredReferencePath)"
111 ToolExe="$(CscToolExe)"
112 ToolPath="$(CscToolPath)" />
116 <Target Name="AfterBuild" DependsOnTargets="Prepare;GenerateDummy">
117 <RemoveDir Directories="$(BaseIntermediateOutputPath)" />