mirror of
https://github.com/Ryujinx/Ryujinx.CustomTasks.git
synced 2024-12-22 14:05:28 +00:00
Add props and targets file for MSBuild
This commit is contained in:
parent
939e700542
commit
98600536a2
12
Ryujinx.CustomTasks/build/Ryujinx.CustomTasks.props
Normal file
12
Ryujinx.CustomTasks/build/Ryujinx.CustomTasks.props
Normal file
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<!-- The folder where the custom task will be present. It points to inside the nuget package. -->
|
||||
<_TaskFolder>$(MSBuildThisFileDirectory)..\tasks\netstandard2.0</_TaskFolder>
|
||||
<!-- Reference to the assembly which contains the MSBuild Task -->
|
||||
<CustomTasksAssembly>$(_TaskFolder)\$(MSBuildThisFileName).dll</CustomTasksAssembly>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Register our custom tasks -->
|
||||
<UsingTask TaskName="$(MSBuildThisFileName).GenerateArrays" AssemblyFile="$(CustomTasksAssembly)"/>
|
||||
</Project>
|
29
Ryujinx.CustomTasks/build/Ryujinx.CustomTasks.targets
Normal file
29
Ryujinx.CustomTasks/build/Ryujinx.CustomTasks.targets
Normal file
|
@ -0,0 +1,29 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
|
||||
<!-- Task: GenerateArrays -->
|
||||
|
||||
<!-- Defining all sources files of the current project for the input parameter -->
|
||||
<ItemGroup>
|
||||
<ArrayInputFiles Condition="'$(ArrayInputFiles)' == ''" Include="$(MSBuildProjectDirectory)\**\*.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
<!--A target that generates code, which is executed before the compilation-->
|
||||
<!-- TODO: Make "Outputs" more generic -->
|
||||
<Target Name="BeforeCompile" Inputs="@(ArrayInputFiles)" Outputs="$(ArrayOutputPath)\Arrays.g.cs">
|
||||
<!--Calling our custom task -->
|
||||
<GenerateArrays ArrayNamespace="$(ArrayNamespace)" InputFiles="@(ArrayInputFiles)" OutputPath="$(ArrayOutputPath)">
|
||||
<Output TaskParameter="OutputFiles" PropertyName="ArrayOutputFiles" />
|
||||
</GenerateArrays>
|
||||
<!--Our generated files are included to be compiled-->
|
||||
<ItemGroup>
|
||||
<Compile Remove="@(ArrayOutputFiles)" />
|
||||
<Compile Include="@(ArrayOutputFiles)" />
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
|
||||
<!--The generated files are deleted after a general clean. It will force the regeneration on rebuild -->
|
||||
<Target Name="AfterClean">
|
||||
<Delete Files="$(ArrayOutputPath)\*.g.cs" />
|
||||
</Target>
|
||||
</Project>
|
Loading…
Reference in a new issue