Skip to content

Commit d0e2b60

Browse files
committed
Merge pull request #1 from codekaizen/master
Adding missing NHibernate.dll by removing and readding the nuget package.
2 parents bff0308 + bc754de commit d0e2b60

28 files changed

+49845
-49503
lines changed

src/.nuget/NuGet.Config

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<solution>
4+
<add key="disableSourceControlIntegration" value="true" />
5+
</solution>
6+
</configuration>

src/.nuget/NuGet.targets

Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">$(MSBuildProjectDirectory)\..\</SolutionDir>
5+
6+
<!-- Enable the restore command to run before builds -->
7+
<RestorePackages Condition=" '$(RestorePackages)' == '' ">false</RestorePackages>
8+
9+
<!-- Property that enables building a package from a project -->
10+
<BuildPackage Condition=" '$(BuildPackage)' == '' ">false</BuildPackage>
11+
12+
<!-- Determines if package restore consent is required to restore packages -->
13+
<RequireRestoreConsent Condition=" '$(RequireRestoreConsent)' != 'false' ">true</RequireRestoreConsent>
14+
15+
<!-- Download NuGet.exe if it does not already exist -->
16+
<DownloadNuGetExe Condition=" '$(DownloadNuGetExe)' == '' ">false</DownloadNuGetExe>
17+
</PropertyGroup>
18+
19+
<ItemGroup Condition=" '$(PackageSources)' == '' ">
20+
<!-- Package sources used to restore packages. By default will used the registered sources under %APPDATA%\NuGet\NuGet.Config -->
21+
<!--
22+
<PackageSource Include="https://nuget.org/api/v2/" />
23+
<PackageSource Include="https://my-nuget-source/nuget/" />
24+
-->
25+
</ItemGroup>
26+
27+
<PropertyGroup Condition=" '$(OS)' == 'Windows_NT'">
28+
<!-- Windows specific commands -->
29+
<NuGetToolsPath>$([System.IO.Path]::Combine($(SolutionDir), ".nuget"))</NuGetToolsPath>
30+
<PackagesConfig>$([System.IO.Path]::Combine($(ProjectDir), "packages.config"))</PackagesConfig>
31+
</PropertyGroup>
32+
33+
<PropertyGroup Condition=" '$(OS)' != 'Windows_NT'">
34+
<!-- We need to launch nuget.exe with the mono command if we're not on windows -->
35+
<NuGetToolsPath>$(SolutionDir).nuget</NuGetToolsPath>
36+
<PackagesConfig>packages.config</PackagesConfig>
37+
</PropertyGroup>
38+
39+
<PropertyGroup>
40+
<!-- NuGet command -->
41+
<NuGetExePath Condition=" '$(NuGetExePath)' == '' ">$(NuGetToolsPath)\nuget.exe</NuGetExePath>
42+
<PackageSources Condition=" $(PackageSources) == '' ">@(PackageSource)</PackageSources>
43+
44+
<NuGetCommand Condition=" '$(OS)' == 'Windows_NT'">"$(NuGetExePath)"</NuGetCommand>
45+
<NuGetCommand Condition=" '$(OS)' != 'Windows_NT' ">mono --runtime=v4.0.30319 $(NuGetExePath)</NuGetCommand>
46+
47+
<PackageOutputDir Condition="$(PackageOutputDir) == ''">$(TargetDir.Trim('\\'))</PackageOutputDir>
48+
49+
<RequireConsentSwitch Condition=" $(RequireRestoreConsent) == 'true' ">-RequireConsent</RequireConsentSwitch>
50+
<!-- Commands -->
51+
<RestoreCommand>$(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(RequireConsentSwitch) -solutionDir "$(SolutionDir) "</RestoreCommand>
52+
<BuildCommand>$(NuGetCommand) pack "$(ProjectPath)" -p Configuration=$(Configuration) -o "$(PackageOutputDir)" -symbols</BuildCommand>
53+
54+
<!-- We need to ensure packages are restored prior to assembly resolve -->
55+
<ResolveReferencesDependsOn Condition="$(RestorePackages) == 'true'">
56+
RestorePackages;
57+
$(ResolveReferencesDependsOn);
58+
</ResolveReferencesDependsOn>
59+
60+
<!-- Make the build depend on restore packages -->
61+
<BuildDependsOn Condition="$(BuildPackage) == 'true'">
62+
$(BuildDependsOn);
63+
BuildPackage;
64+
</BuildDependsOn>
65+
</PropertyGroup>
66+
67+
<Target Name="CheckPrerequisites">
68+
<!-- Raise an error if we're unable to locate nuget.exe -->
69+
<Error Condition="'$(DownloadNuGetExe)' != 'true' AND !Exists('$(NuGetExePath)')" Text="Unable to locate '$(NuGetExePath)'" />
70+
<SetEnvironmentVariable EnvKey="VisualStudioVersion" EnvValue="$(VisualStudioVersion)" Condition=" '$(VisualStudioVersion)' != '' AND '$(OS)' == 'Windows_NT' " />
71+
<!--
72+
Take advantage of MsBuild's build dependency tracking to make sure that we only ever download nuget.exe once.
73+
This effectively acts as a lock that makes sure that the download operation will only happen once and all
74+
parallel builds will have to wait for it to complete.
75+
-->
76+
<MsBuild Targets="_DownloadNuGet" Projects="$(MSBuildThisFileFullPath)" Properties="Configuration=NOT_IMPORTANT" />
77+
</Target>
78+
79+
<Target Name="_DownloadNuGet">
80+
<DownloadNuGet OutputFilename="$(NuGetExePath)" Condition=" '$(DownloadNuGetExe)' == 'true' AND !Exists('$(NuGetExePath)')" />
81+
</Target>
82+
83+
<Target Name="RestorePackages" DependsOnTargets="CheckPrerequisites">
84+
<Exec Command="$(RestoreCommand)"
85+
Condition="'$(OS)' != 'Windows_NT' And Exists('$(PackagesConfig)')" />
86+
87+
<Exec Command="$(RestoreCommand)"
88+
LogStandardErrorAsError="true"
89+
Condition="'$(OS)' == 'Windows_NT' And Exists('$(PackagesConfig)')" />
90+
</Target>
91+
92+
<Target Name="BuildPackage" DependsOnTargets="CheckPrerequisites">
93+
<Exec Command="$(BuildCommand)"
94+
Condition=" '$(OS)' != 'Windows_NT' " />
95+
96+
<Exec Command="$(BuildCommand)"
97+
LogStandardErrorAsError="true"
98+
Condition=" '$(OS)' == 'Windows_NT' " />
99+
</Target>
100+
101+
<UsingTask TaskName="DownloadNuGet" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
102+
<ParameterGroup>
103+
<OutputFilename ParameterType="System.String" Required="true" />
104+
</ParameterGroup>
105+
<Task>
106+
<Reference Include="System.Core" />
107+
<Using Namespace="System" />
108+
<Using Namespace="System.IO" />
109+
<Using Namespace="System.Net" />
110+
<Using Namespace="Microsoft.Build.Framework" />
111+
<Using Namespace="Microsoft.Build.Utilities" />
112+
<Code Type="Fragment" Language="cs">
113+
<![CDATA[
114+
try {
115+
OutputFilename = Path.GetFullPath(OutputFilename);
116+
117+
Log.LogMessage("Downloading latest version of NuGet.exe...");
118+
WebClient webClient = new WebClient();
119+
webClient.DownloadFile("https://nuget.org/nuget.exe", OutputFilename);
120+
121+
return true;
122+
}
123+
catch (Exception ex) {
124+
Log.LogErrorFromException(ex);
125+
return false;
126+
}
127+
]]>
128+
</Code>
129+
</Task>
130+
</UsingTask>
131+
132+
<UsingTask TaskName="SetEnvironmentVariable" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
133+
<ParameterGroup>
134+
<EnvKey ParameterType="System.String" Required="true" />
135+
<EnvValue ParameterType="System.String" Required="true" />
136+
</ParameterGroup>
137+
<Task>
138+
<Using Namespace="System" />
139+
<Code Type="Fragment" Language="cs">
140+
<![CDATA[
141+
try {
142+
Environment.SetEnvironmentVariable(EnvKey, EnvValue, System.EnvironmentVariableTarget.Process);
143+
}
144+
catch {
145+
}
146+
]]>
147+
</Code>
148+
</Task>
149+
</UsingTask>
150+
</Project>
Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
1+
using System;
12
using System.Collections;
23
using Lucene.Net.Index;
4+
using Lucene.Net.Search;
35

46
namespace NHibernate.Search.Tests.Filter
57
{
68
public class BestDriversFilter : Lucene.Net.Search.Filter
79
{
8-
public override BitArray Bits(IndexReader reader)
10+
public override DocIdSet GetDocIdSet(IndexReader reader)
911
{
10-
BitArray bitArray = new BitArray(reader.MaxDoc());
11-
TermDocs termDocs = reader.TermDocs(new Term("score", "5"));
12-
while (termDocs.Next())
13-
{
14-
bitArray.Set(termDocs.Doc(), true);
15-
}
12+
throw new NotImplementedException();
13+
//BitArray bitArray = new BitArray(reader.MaxDoc());
14+
//TermDocs termDocs = reader.TermDocs(new Term("score", "5"));
15+
//while (termDocs.Next())
16+
//{
17+
// bitArray.Set(termDocs.Doc(), true);
18+
//}
1619

17-
return bitArray;
20+
//return bitArray;
1821
}
1922
}
2023
}
Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,26 @@
11
using System;
22
using System.Collections;
33
using Lucene.Net.Index;
4+
using Lucene.Net.Search;
45

56
namespace NHibernate.Search.Tests.Filter
67
{
78
public class ExcludeAllFilter : Lucene.Net.Search.Filter
89
{
910
private static bool done = false;
1011

11-
public override BitArray Bits(IndexReader reader)
12+
public override DocIdSet GetDocIdSet(IndexReader reader)
1213
{
13-
if (done)
14-
{
15-
throw new NotSupportedException("Called twice");
16-
}
14+
throw new NotImplementedException();
15+
//if (done)
16+
//{
17+
// throw new NotSupportedException("Called twice");
18+
//}
1719

18-
BitArray bitArray = new BitArray(reader.MaxDoc());
19-
done = true;
20+
//BitArray bitArray = new BitArray(reader.MaxDoc());
21+
//done = true;
2022

21-
return bitArray;
23+
//return bitArray;
2224
}
2325
}
2426
}

0 commit comments

Comments
 (0)