-
Notifications
You must be signed in to change notification settings - Fork 19
/
KeePassFaviconDownloader.csproj
152 lines (136 loc) · 5.98 KB
/
KeePassFaviconDownloader.csproj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{4C1BB6F8-D2CD-49C2-9053-21705681356C}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>KeePassFaviconDownloader</RootNamespace>
<AssemblyName>KeePassFaviconDownloader</AssemblyName>
<SignAssembly>false</SignAssembly>
<AssemblyOriginatorKeyFile>
</AssemblyOriginatorKeyFile>
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>3.5</OldToolsVersion>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="HtmlAgilityPack, Version=1.4.0.0, Culture=neutral, PublicKeyToken=bd319b19eaf3b43a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>.\HtmlAgilityPack.dll</HintPath>
</Reference>
<Reference Include="KeePass, Version=2.1.2.16375, Culture=neutral, PublicKeyToken=fed2ed7716aecf5c, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\KeePass Password Safe 2\KeePass.exe</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="KeePassFaviconDownloaderExt.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="README.txt" />
<Content Include="versionInfo.txt" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
<PropertyGroup>
<PostBuildEvent>echo POSTBUILDSTEP for $(ProjectName)
set KPDir=C:\Program Files (x86)\KeePass Password Safe 2\
set KPPDir=%25KPDir%25plugins\
set KPPTempDir=%25KPPDir%25$(ProjectName)
IF NOT "$(ConfigurationName)"=="Debug" Goto :NotDebug
REM In debug mode we want to move the generated DLLs and PDBs to the plugins
REM directory so we can easily set breakpoints, etc.
REM In this case, we don't care if the Firefox add-on has missing or outdated
REM files (they are only used at install time so it won't affect debugging)
REM delete the PLGX from any previous Release build
del /Q "%25KPPDir%25$(ProjectName).plgx"
if errorlevel 1 goto BuildEventFailed
echo Release plgx deleted
REM copy output DLLs to KeePass plugins directory
copy "$(ProjectName).dll" "%25KPPDir%25\$(ProjectName).dll"
copy "HtmlAgilityPack.dll" "%25KPPDir%25\HtmlAgilityPack.dll"
if errorlevel 1 goto BuildEventFailed
echo Debug DLLs copied to plugins directory
goto BuildEventOK
:NotDebug
IF NOT "$(ConfigurationName)"=="Release" Goto :NotRelease
REM In release mode we want to make sure that we are working with the PLGX version.
REM delete the DLLs from any previous Debug build
del /Q "%25KPPDir%25$(ProjectName).dll"
del /Q "%25KPPDir%25HtmlAgilityPack.dll"
REM if errorlevel 1 goto BuildEventFailed
echo Debug DLLs deleted
REM create temporary directory
rmdir /S /Q "%25KPPTempDir%25"
mkdir "%25KPPTempDir%25"
if errorlevel 1 goto BuildEventFailed
echo Temporary directory created
REM copy relevant project files to temporary directory
REM (for simple KeePass plugins you may need to
REM copy only *.cs files and .csproj file)
copy "$(ProjectDir)*.cs" "%25KPPTempDir%25"
copy "$(ProjectDir)HtmlAgilityPack.dll" "%25KPPTempDir%25\HtmlAgilityPack.dll"
if errorlevel 1 goto BuildEventFailed
copy "$(ProjectDir)$(ProjectName).csproj" "%25KPPTempDir%25\$(ProjectName).csproj"
if errorlevel 1 goto BuildEventFailed
mkdir "%25KPPTempDir%25\Properties"
copy "$(ProjectDir)Properties\AssemblyInfo.cs" "%25KPPTempDir%25\Properties\AssemblyInfo.cs"
if errorlevel 1 goto BuildEventFailed
echo Files copied to temporary directory
REM create the PLGX
"%25KPDir%25KeePass.exe" --plgx-create "%25KPPTempDir%25"
if errorlevel 1 goto BuildEventFailed
echo PLGX created
REM delete the temporary directory and its contents
rmdir /S /Q "%25KPPTempDir%25"
if errorlevel 1 goto BuildEventFailed
echo Temporary directory deleted
goto BuildEventOK
:NotRelease
echo Invalid configuration selected. Please choose a different build configuration
echo or modify the post-build script to add support for this configuration.
:BuildEventFailed
echo POSTBUILDSTEP for $(ProjectName) FAILED
exit 1
:BuildEventOK
echo POSTBUILDSTEP for $(ProjectName) COMPLETED OK</PostBuildEvent>
</PropertyGroup>
</Project>