<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <Import Project="..\packages\ILRepack.2.0.41\build\ILRepack.props" Condition="Exists('..\packages\ILRepack.2.0.41\build\ILRepack.props')" />
    <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
    <PropertyGroup>
        <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
        <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
        <ProjectGuid>{106D3E44-ECBB-4EF3-84B2-5FC6BCF77727}</ProjectGuid>
        <OutputType>WinExe</OutputType>
        <RootNamespace>WandEnhancer</RootNamespace>
        <AssemblyName>WandEnhancer</AssemblyName>
        <TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
        <FileAlignment>512</FileAlignment>
        <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
        <WarningLevel>4</WarningLevel>
        <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
        <ApplicationIcon>..\assets\appicon.ico</ApplicationIcon>
    </PropertyGroup>
    <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
        <PlatformTarget>x64</PlatformTarget>
        <DebugSymbols>true</DebugSymbols>
        <DebugType>full</DebugType>
        <Optimize>false</Optimize>
        <OutputPath>bin\Debug\</OutputPath>
        <DefineConstants>DEBUG;TRACE</DefineConstants>
        <ErrorReport>prompt</ErrorReport>
        <WarningLevel>4</WarningLevel>
        <Prefer32bit>false</Prefer32bit>
    </PropertyGroup>
    <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
        <PlatformTarget>x64</PlatformTarget>
        <DebugType>none</DebugType>
        <Optimize>true</Optimize>
        <OutputPath>bin\Release\</OutputPath>
        <DefineConstants>TRACE</DefineConstants>
        <ErrorReport>prompt</ErrorReport>
        <WarningLevel>4</WarningLevel>
        <Prefer32bit>false</Prefer32bit>
    </PropertyGroup>
    <PropertyGroup>
        <StartupObject>WandEnhancer.Program</StartupObject>
        <CMakeSourceDir>..\tools\asar-fuses-bypass</CMakeSourceDir>
      <NativeBuildRoot>..\.tmp\cmake</NativeBuildRoot>
      <NativeBuildConfiguration Condition="'$(Configuration)' == 'Debug'">Debug</NativeBuildConfiguration>
      <NativeBuildConfiguration Condition="'$(NativeBuildConfiguration)' == ''">Release</NativeBuildConfiguration>
        <CMakeBuildDir>$(NativeBuildRoot)\asar-fuses-bypass</CMakeBuildDir>
        <ProxyDllPath>$(CMakeBuildDir)\$(NativeBuildConfiguration)\version.dll</ProxyDllPath>
    </PropertyGroup>
    <ItemGroup>
        <Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
          <HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
        </Reference>
        <Reference Include="System" />
        <Reference Include="System.Core" />
        <Reference Include="System.Data" />
        <Reference Include="System.Windows.Forms" />
        <Reference Include="System.Xml" />
        <Reference Include="System.Xaml">
            <RequiredTargetFramework>4.0</RequiredTargetFramework>
        </Reference>
        <Reference Include="WindowsBase" />
        <Reference Include="PresentationCore" />
        <Reference Include="PresentationFramework" />
    </ItemGroup>
    <ItemGroup>
        <ApplicationDefinition Include="App.xaml">
            <Generator>MSBuild:Compile</Generator>
            <SubType>Designer</SubType>
        </ApplicationDefinition>
        <Compile Include="Constants.cs" />
        <Compile Include="Converters\BaseBooleanConverter.cs" />
        <Compile Include="Converters\ToVisibilityConverter.cs" />
        <Compile Include="Core\Enhancer.cs" />
        <Compile Include="Core\EnhancerConfig.cs" />
        <Compile Include="Core\Services\LocalizationManager.cs" />
        <Compile Include="Core\Services\SettingsManager.cs" />
        <Compile Include="Models\WeModConfig.cs" />
        <Compile Include="Models\PatchConfig.cs" />
        <Compile Include="Models\Signature.cs" />
        <Compile Include="Program.cs" />
        <Compile Include="ReactiveUICore\AsyncRelayCommand.cs" />
        <Compile Include="ReactiveUICore\ObservableObject.cs" />
        <Compile Include="ReactiveUICore\RelayCommand.cs" />
        <Compile Include="Utils\Common.cs" />
        <Compile Include="Utils\Extensions.cs" />
        <Compile Include="Utils\Win32\Shortcut.cs" />
        <Compile Include="View\Controls\InfoItem.xaml.cs">
          <DependentUpon>InfoItem.xaml</DependentUpon>
        </Compile>
        <Compile Include="View\Controls\PopupHost.xaml.cs" />
        <Compile Include="View\MainWindow\Logs.cs" />
        <Compile Include="View\MainWindow\MainWindow.xaml.cs" />
        <Compile Include="View\MainWindow\MainWindowVm.cs" />
        <Compile Include="View\Popups\PatchVectorsPopup.xaml.cs">
          <DependentUpon>PatchVectorsPopup.xaml</DependentUpon>
        </Compile>
        <Compile Include="View\Popups\SettingsPopup.xaml.cs">
          <DependentUpon>SettingsPopup.xaml</DependentUpon>
        </Compile>
        <Compile Include="App.xaml.cs">
            <DependentUpon>App.xaml</DependentUpon>
            <SubType>Code</SubType>
        </Compile>
        <Page Include="Locale\lang.en-US.xaml" />
        <Page Include="Locale\lang.zh-CN.xaml" />
        <Page Include="Locale\lang.de-DE.xaml" />
        <Page Include="Locale\lang.fr-FR.xaml" />
        <Page Include="Locale\lang.es-ES.xaml" />
        <Page Include="Locale\lang.it-IT.xaml" />
        <Page Include="Locale\lang.pt-BR.xaml" />
        <Page Include="Locale\lang.pl-PL.xaml" />
        <Page Include="Locale\lang.ru-RU.xaml" />
        <Page Include="Locale\lang.uk-UA.xaml" />
        <Page Include="Locale\lang.ja-JP.xaml" />
        <Page Include="Locale\lang.tr-TR.xaml" />
        <Page Include="Style\ColorScheme.xaml" />
        <Page Include="Style\Icons.xaml" />
        <Page Include="Style\Styles.xaml" />
        <Page Include="View\Controls\InfoItem.xaml" />
        <Page Include="View\Controls\PopupHost.xaml" />
        <Page Include="View\MainWindow\MainWindow.xaml" />
        <Page Include="View\Popups\PatchVectorsPopup.xaml" />
        <Page Include="View\Popups\SettingsPopup.xaml" />
    </ItemGroup>
    <ItemGroup>
        <Compile Include="Properties\AssemblyInfo.cs">
            <SubType>Code</SubType>
        </Compile>
        <Compile Include="Properties\Resources.Designer.cs">
            <AutoGen>True</AutoGen>
            <DesignTime>True</DesignTime>
            <DependentUpon>Resources.resx</DependentUpon>
        </Compile>
        <EmbeddedResource Include="Properties\Resources.resx">
            <Generator>ResXFileCodeGenerator</Generator>
            <LastGenOutput>Resources.Designer.cs</LastGenOutput>
        </EmbeddedResource>
    </ItemGroup>
    <ItemGroup>
        <None Include="..\assets\appicon.ico">
          <Link>appicon.ico</Link>
        </None>
        <None Include="App.config" />
        <None Include="packages.config" />
    </ItemGroup>
    <ItemGroup>
      <Content Include="Style\Inter_18pt-Regular.ttf" />
    </ItemGroup>
    <ItemGroup>
      <ProjectReference Include="..\AsarSharp\AsarSharp.csproj">
        <Project>{BEAA604A-402A-4387-8903-A53FC913A26E}</Project>
        <Name>AsarSharp</Name>
      </ProjectReference>
    </ItemGroup>
    <ItemGroup>
        <EmbeddedResource Include="$(ProxyDllPath)">
            <LogicalName>proxydll</LogicalName>
        </EmbeddedResource>
    </ItemGroup>
    <ItemGroup>
      <EmbeddedResource Include="..\web-panel\dist\**\*.*" Condition="Exists('..\web-panel\dist\index.html')">
        <LogicalName>remote-panel/dist/%(RecursiveDir)%(Filename)%(Extension)</LogicalName>
      </EmbeddedResource>
    </ItemGroup>
    
    <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
    <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
      <PropertyGroup>
        <ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105.The missing file is {0}.</ErrorText>
      </PropertyGroup>
      <Error Condition="!Exists('..\packages\ILRepack.2.0.41\build\ILRepack.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\ILRepack.2.0.41\build\ILRepack.props'))" />
    </Target>

    <Target Name="ValidateNativeArtifacts" BeforeTargets="BeforeBuild">
        <Error Text="Proxy DLL not found: $(ProxyDllPath)"
               Condition="!Exists('$(ProxyDllPath)')" />

        <Message Text="Embedding Proxy DLL as resource from $(ProxyDllPath)"
                 Importance="high" />
    </Target>

    <Target Name="ILRepack" AfterTargets="Build" Condition="'$(Configuration)' == 'Release'">
        <PropertyGroup>
            <ILRepackExe>..\packages\ILRepack.2.0.41\tools\ILRepack.exe</ILRepackExe>
            <MainAssembly>$(OutputPath)$(AssemblyName).exe</MainAssembly>
        </PropertyGroup>

        <ItemGroup>
        <AssemblyList Include="$(OutputPath)*.dll" />
        </ItemGroup>

        <PropertyGroup>
            <DllList>@(AssemblyList->'%(FullPath)', ' ')</DllList>
        </PropertyGroup>

        <Delete Files="$(OutputPath)$(AssemblyName).pdb" ContinueOnError="true" />
        <Exec Command="&quot;$(ILRepackExe)&quot; /allowMultiple /copyattrs /out:&quot;$(OutputPath)$(AssemblyName).exe&quot; &quot;$(MainAssembly)&quot; $(DllList)" />
        <Delete Files="@(AssemblyList)" ContinueOnError="true" />
    </Target>
</Project>
