This is an automated email from the ASF dual-hosted git repository. shazwazza pushed a commit to branch docs-may in repository https://gitbox.apache.org/repos/asf/lucenenet.git
commit 0b1ab101f994471edc295122935c5c0281253756 Author: Shannon <[email protected]> AuthorDate: Fri May 15 12:53:07 2020 +1000 Adds build script to build and execute the docs converter (converts those proj to use package reference) --- src/docs/.gitignore | 4 + src/docs/DocumentationTools.sln | 2 +- .../JavaDocToMarkdownConverter.csproj | 70 ++--------------- .../JavaDocToMarkdownConverter/packages.config | 71 ----------------- .../LuceneDocsPlugins/LuceneDocsPlugins.csproj | 57 ++++---------- src/docs/LuceneDocsPlugins/packages.config | 40 ---------- src/docs/convert.ps1 | 88 ++++++++++++++++++++++ 7 files changed, 115 insertions(+), 217 deletions(-) diff --git a/src/docs/.gitignore b/src/docs/.gitignore new file mode 100644 index 0000000..007056d --- /dev/null +++ b/src/docs/.gitignore @@ -0,0 +1,4 @@ +# this is the git pattern ignore file for the project. +# Git can be used with svn http://code.google.com/p/msysgit/ + +tools/* \ No newline at end of file diff --git a/src/docs/DocumentationTools.sln b/src/docs/DocumentationTools.sln index ac22251..7db4ea9 100644 --- a/src/docs/DocumentationTools.sln +++ b/src/docs/DocumentationTools.sln @@ -1,4 +1,3 @@ - Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 # Licensed to the Apache Software Foundation (ASF) under one @@ -25,6 +24,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JavaDocToMarkdownConverter" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Info", "Info", "{D0D177C8-D797-4850-AB75-E91E3126761C}" ProjectSection(SolutionItems) = preProject + convert.ps1 = convert.ps1 readme.md = readme.md EndProjectSection EndProject diff --git a/src/docs/JavaDocToMarkdownConverter/JavaDocToMarkdownConverter.csproj b/src/docs/JavaDocToMarkdownConverter/JavaDocToMarkdownConverter.csproj index 02a1aac..31b1713 100644 --- a/src/docs/JavaDocToMarkdownConverter/JavaDocToMarkdownConverter.csproj +++ b/src/docs/JavaDocToMarkdownConverter/JavaDocToMarkdownConverter.csproj @@ -60,77 +60,16 @@ <WarningLevel>4</WarningLevel> </PropertyGroup> <ItemGroup> - <Reference Include="Html2Markdown, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> - <HintPath>..\packages\Html2Markdown.3.2.1.341\lib\net45\Html2Markdown.dll</HintPath> - <HintPath>..\packages\Html2Markdown.3.2.3.392\lib\net45\Html2Markdown.dll</HintPath> - </Reference> - <Reference Include="HtmlAgilityPack, Version=1.5.0.0, Culture=neutral, PublicKeyToken=bd319b19eaf3b43a, processorArchitecture=MSIL"> - <HintPath>..\packages\HtmlAgilityPack.1.5.0\lib\Net45\HtmlAgilityPack.dll</HintPath> - </Reference> - <Reference Include="HtmlAgilityPack, Version=1.5.0.0, Culture=neutral, PublicKeyToken=bd319b19eaf3b43a, processorArchitecture=MSIL"> - <HintPath>..\packages\HtmlAgilityPack.1.5.0\lib\Net45\HtmlAgilityPack.dll</HintPath> - </Reference> - <Reference Include="Microsoft.Win32.Primitives, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> - <HintPath>..\packages\Microsoft.Win32.Primitives.4.3.0\lib\net46\Microsoft.Win32.Primitives.dll</HintPath> - </Reference> <Reference Include="System" /> - <Reference Include="System.AppContext, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> - <HintPath>..\packages\System.AppContext.4.3.0\lib\net46\System.AppContext.dll</HintPath> - </Reference> <Reference Include="System.ComponentModel.Composition" /> - <Reference Include="System.Console, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> - <HintPath>..\packages\System.Console.4.3.0\lib\net46\System.Console.dll</HintPath> - </Reference> <Reference Include="System.Core" /> - <Reference Include="System.Diagnostics.DiagnosticSource, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> - <HintPath>..\packages\System.Diagnostics.DiagnosticSource.4.3.0\lib\net46\System.Diagnostics.DiagnosticSource.dll</HintPath> - </Reference> - <Reference Include="System.Globalization.Calendars, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> - <HintPath>..\packages\System.Globalization.Calendars.4.3.0\lib\net46\System.Globalization.Calendars.dll</HintPath> - </Reference> - <Reference Include="System.IO.Compression, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL"> - <HintPath>..\packages\System.IO.Compression.4.3.0\lib\net46\System.IO.Compression.dll</HintPath> - </Reference> <Reference Include="System.IO.Compression.FileSystem" /> - <Reference Include="System.IO.Compression.ZipFile, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL"> - <HintPath>..\packages\System.IO.Compression.ZipFile.4.3.0\lib\net46\System.IO.Compression.ZipFile.dll</HintPath> - </Reference> - <Reference Include="System.IO.FileSystem, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> - <HintPath>..\packages\System.IO.FileSystem.4.3.0\lib\net46\System.IO.FileSystem.dll</HintPath> - </Reference> - <Reference Include="System.IO.FileSystem.Primitives, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> - <HintPath>..\packages\System.IO.FileSystem.Primitives.4.3.0\lib\net46\System.IO.FileSystem.Primitives.dll</HintPath> - </Reference> - <Reference Include="System.Net.Http, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> - <HintPath>..\packages\System.Net.Http.4.3.0\lib\net46\System.Net.Http.dll</HintPath> - </Reference> - <Reference Include="System.Net.Sockets, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> - <HintPath>..\packages\System.Net.Sockets.4.3.0\lib\net46\System.Net.Sockets.dll</HintPath> - </Reference> <Reference Include="System.Numerics" /> - <Reference Include="System.Runtime.InteropServices.RuntimeInformation, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> - <HintPath>..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll</HintPath> - </Reference> - <Reference Include="System.Security.Cryptography.Algorithms, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> - <HintPath>..\packages\System.Security.Cryptography.Algorithms.4.3.0\lib\net461\System.Security.Cryptography.Algorithms.dll</HintPath> - </Reference> - <Reference Include="System.Security.Cryptography.Encoding, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> - <HintPath>..\packages\System.Security.Cryptography.Encoding.4.3.0\lib\net46\System.Security.Cryptography.Encoding.dll</HintPath> - </Reference> - <Reference Include="System.Security.Cryptography.Primitives, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> - <HintPath>..\packages\System.Security.Cryptography.Primitives.4.3.0\lib\net46\System.Security.Cryptography.Primitives.dll</HintPath> - </Reference> - <Reference Include="System.Security.Cryptography.X509Certificates, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> - <HintPath>..\packages\System.Security.Cryptography.X509Certificates.4.3.0\lib\net461\System.Security.Cryptography.X509Certificates.dll</HintPath> - </Reference> <Reference Include="System.Xml.Linq" /> <Reference Include="System.Data.DataSetExtensions" /> <Reference Include="Microsoft.CSharp" /> <Reference Include="System.Data" /> <Reference Include="System.Xml" /> - <Reference Include="System.Xml.ReaderWriter, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> - <HintPath>..\packages\System.Xml.ReaderWriter.4.3.0\lib\net46\System.Xml.ReaderWriter.dll</HintPath> - </Reference> </ItemGroup> <ItemGroup> <Compile Include="CustomMarkdownScheme.cs" /> @@ -154,7 +93,14 @@ </ItemGroup> <ItemGroup> <None Include="App.config" /> - <None Include="packages.config" /> + </ItemGroup> + <ItemGroup> + <PackageReference Include="Html2Markdown"> + <Version>3.2.3.392</Version> + </PackageReference> + <PackageReference Include="NETStandard.Library"> + <Version>1.6.1</Version> + </PackageReference> </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> </Project> \ No newline at end of file diff --git a/src/docs/JavaDocToMarkdownConverter/packages.config b/src/docs/JavaDocToMarkdownConverter/packages.config deleted file mode 100644 index 1992fe7..0000000 --- a/src/docs/JavaDocToMarkdownConverter/packages.config +++ /dev/null @@ -1,71 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - ---> -<packages> - <package id="Html2Markdown" version="3.2.3.392" targetFramework="net461" /> - <package id="HtmlAgilityPack" version="1.5.0" targetFramework="net461" /> - <package id="Microsoft.NETCore.Platforms" version="1.1.0" targetFramework="net461" /> - <package id="Microsoft.Win32.Primitives" version="4.3.0" targetFramework="net461" /> - <package id="NETStandard.Library" version="1.6.1" targetFramework="net461" /> - <package id="System.AppContext" version="4.3.0" targetFramework="net461" /> - <package id="System.Collections" version="4.3.0" targetFramework="net461" /> - <package id="System.Collections.Concurrent" version="4.3.0" targetFramework="net461" /> - <package id="System.Console" version="4.3.0" targetFramework="net461" /> - <package id="System.Diagnostics.Debug" version="4.3.0" targetFramework="net461" /> - <package id="System.Diagnostics.DiagnosticSource" version="4.3.0" targetFramework="net461" /> - <package id="System.Diagnostics.Tools" version="4.3.0" targetFramework="net461" /> - <package id="System.Diagnostics.Tracing" version="4.3.0" targetFramework="net461" /> - <package id="System.Globalization" version="4.3.0" targetFramework="net461" /> - <package id="System.Globalization.Calendars" version="4.3.0" targetFramework="net461" /> - <package id="System.IO" version="4.3.0" targetFramework="net461" /> - <package id="System.IO.Compression" version="4.3.0" targetFramework="net461" /> - <package id="System.IO.Compression.ZipFile" version="4.3.0" targetFramework="net461" /> - <package id="System.IO.FileSystem" version="4.3.0" targetFramework="net461" /> - <package id="System.IO.FileSystem.Primitives" version="4.3.0" targetFramework="net461" /> - <package id="System.Linq" version="4.3.0" targetFramework="net461" /> - <package id="System.Linq.Expressions" version="4.3.0" targetFramework="net461" /> - <package id="System.Net.Http" version="4.3.0" targetFramework="net461" /> - <package id="System.Net.Primitives" version="4.3.0" targetFramework="net461" /> - <package id="System.Net.Sockets" version="4.3.0" targetFramework="net461" /> - <package id="System.ObjectModel" version="4.3.0" targetFramework="net461" /> - <package id="System.Reflection" version="4.3.0" targetFramework="net461" /> - <package id="System.Reflection.Extensions" version="4.3.0" targetFramework="net461" /> - <package id="System.Reflection.Primitives" version="4.3.0" targetFramework="net461" /> - <package id="System.Resources.ResourceManager" version="4.3.0" targetFramework="net461" /> - <package id="System.Runtime" version="4.3.0" targetFramework="net461" /> - <package id="System.Runtime.Extensions" version="4.3.0" targetFramework="net461" /> - <package id="System.Runtime.Handles" version="4.3.0" targetFramework="net461" /> - <package id="System.Runtime.InteropServices" version="4.3.0" targetFramework="net461" /> - <package id="System.Runtime.InteropServices.RuntimeInformation" version="4.3.0" targetFramework="net461" /> - <package id="System.Runtime.Numerics" version="4.3.0" targetFramework="net461" /> - <package id="System.Security.Cryptography.Algorithms" version="4.3.0" targetFramework="net461" /> - <package id="System.Security.Cryptography.Encoding" version="4.3.0" targetFramework="net461" /> - <package id="System.Security.Cryptography.Primitives" version="4.3.0" targetFramework="net461" /> - <package id="System.Security.Cryptography.X509Certificates" version="4.3.0" targetFramework="net461" /> - <package id="System.Text.Encoding" version="4.3.0" targetFramework="net461" /> - <package id="System.Text.Encoding.Extensions" version="4.3.0" targetFramework="net461" /> - <package id="System.Text.RegularExpressions" version="4.3.0" targetFramework="net461" /> - <package id="System.Threading" version="4.3.0" targetFramework="net461" /> - <package id="System.Threading.Tasks" version="4.3.0" targetFramework="net461" /> - <package id="System.Threading.Timer" version="4.3.0" targetFramework="net461" /> - <package id="System.Xml.ReaderWriter" version="4.3.0" targetFramework="net461" /> - <package id="System.Xml.XDocument" version="4.3.0" targetFramework="net461" /> -</packages> \ No newline at end of file diff --git a/src/docs/LuceneDocsPlugins/LuceneDocsPlugins.csproj b/src/docs/LuceneDocsPlugins/LuceneDocsPlugins.csproj index 57fd8f2..0504197 100644 --- a/src/docs/LuceneDocsPlugins/LuceneDocsPlugins.csproj +++ b/src/docs/LuceneDocsPlugins/LuceneDocsPlugins.csproj @@ -56,51 +56,9 @@ under the License. <WarningLevel>4</WarningLevel> </PropertyGroup> <ItemGroup> - <Reference Include="HtmlAgilityPack, Version=1.4.9.0, Culture=neutral, PublicKeyToken=bd319b19eaf3b43a, processorArchitecture=MSIL"> - <HintPath>..\packages\HtmlAgilityPack.1.4.9\lib\Net45\HtmlAgilityPack.dll</HintPath> - </Reference> <Reference Include="Microsoft.CSharp" /> - <Reference Include="Microsoft.DocAsCode.Common, Version=2.47.0.0, Culture=neutral, processorArchitecture=MSIL"> - <HintPath>..\packages\Microsoft.DocAsCode.Common.2.47.0\lib\net472\Microsoft.DocAsCode.Common.dll</HintPath> - </Reference> - <Reference Include="Microsoft.DocAsCode.Dfm, Version=2.47.0.0, Culture=neutral, processorArchitecture=MSIL"> - <HintPath>..\packages\Microsoft.DocAsCode.Dfm.2.47.0\lib\net472\Microsoft.DocAsCode.Dfm.dll</HintPath> - </Reference> - <Reference Include="Microsoft.DocAsCode.MarkdownLite, Version=2.47.0.0, Culture=neutral, processorArchitecture=MSIL"> - <HintPath>..\packages\Microsoft.DocAsCode.MarkdownLite.2.47.0\lib\net472\Microsoft.DocAsCode.MarkdownLite.dll</HintPath> - </Reference> - <Reference Include="Microsoft.DocAsCode.Plugins, Version=2.47.0.0, Culture=neutral, processorArchitecture=MSIL"> - <HintPath>..\packages\Microsoft.DocAsCode.Plugins.2.47.0\lib\net472\Microsoft.DocAsCode.Plugins.dll</HintPath> - </Reference> - <Reference Include="Microsoft.DocAsCode.YamlSerialization, Version=2.47.0.0, Culture=neutral, processorArchitecture=MSIL"> - <HintPath>..\packages\Microsoft.DocAsCode.YamlSerialization.2.47.0\lib\net472\Microsoft.DocAsCode.YamlSerialization.dll</HintPath> - </Reference> - <Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> - <HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath> - </Reference> <Reference Include="System" /> - <Reference Include="System.Collections.Immutable, Version=1.2.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> - <HintPath>..\packages\System.Collections.Immutable.1.5.0\lib\netstandard2.0\System.Collections.Immutable.dll</HintPath> - </Reference> - <Reference Include="System.Composition.AttributedModel, Version=1.0.31.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> - <HintPath>..\packages\System.Composition.AttributedModel.1.0.31\lib\portable-net45+win8+wp8+wpa81\System.Composition.AttributedModel.dll</HintPath> - </Reference> - <Reference Include="System.Composition.Convention, Version=1.0.31.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> - <HintPath>..\packages\System.Composition.Convention.1.0.31\lib\portable-net45+win8+wp8+wpa81\System.Composition.Convention.dll</HintPath> - </Reference> - <Reference Include="System.Composition.Hosting, Version=1.0.34.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> - <HintPath>..\packages\System.Composition.Hosting.1.3.0\lib\netstandard2.0\System.Composition.Hosting.dll</HintPath> - </Reference> - <Reference Include="System.Composition.Runtime, Version=1.0.34.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> - <HintPath>..\packages\System.Composition.Runtime.1.3.0\lib\netstandard2.0\System.Composition.Runtime.dll</HintPath> - </Reference> - <Reference Include="System.Composition.TypedParts, Version=1.0.31.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> - <HintPath>..\packages\System.Composition.TypedParts.1.0.31\lib\portable-net45+win8+wp8+wpa81\System.Composition.TypedParts.dll</HintPath> - </Reference> <Reference Include="System.Web" /> - <Reference Include="YamlDotNet, Version=6.0.0.0, Culture=neutral, PublicKeyToken=ec19458f3c15af5e, processorArchitecture=MSIL"> - <HintPath>..\packages\YamlDotNet.6.0.0\lib\net45\YamlDotNet.dll</HintPath> - </Reference> </ItemGroup> <ItemGroup> <Compile Include="LuceneDfmEngineCustomizer.cs" /> @@ -112,7 +70,20 @@ under the License. </ItemGroup> <ItemGroup> <None Include="app.config" /> - <None Include="packages.config" /> + </ItemGroup> + <ItemGroup> + <PackageReference Include="Microsoft.DocAsCode.Dfm"> + <Version>2.47.0</Version> + </PackageReference> + <PackageReference Include="System.Composition"> + <Version>1.0.31</Version> + </PackageReference> + <PackageReference Include="System.Composition.Hosting"> + <Version>1.3.0</Version> + </PackageReference> + <PackageReference Include="YamlDotNet.Signed"> + <Version>6.0.0</Version> + </PackageReference> </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> </Project> \ No newline at end of file diff --git a/src/docs/LuceneDocsPlugins/packages.config b/src/docs/LuceneDocsPlugins/packages.config deleted file mode 100644 index 753dfff..0000000 --- a/src/docs/LuceneDocsPlugins/packages.config +++ /dev/null @@ -1,40 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> - -<!-- -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you under the Apache License, Version 2.0 (the -"License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, -software distributed under the License is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied. See the License for the -specific language governing permissions and limitations -under the License. ---> - -<packages> - <package id="HtmlAgilityPack" version="1.4.9" targetFramework="net472" /> - <package id="Microsoft.CSharp" version="4.0.1" targetFramework="net472" /> - <package id="Microsoft.DocAsCode.Common" version="2.47.0" targetFramework="net472" /> - <package id="Microsoft.DocAsCode.Dfm" version="2.47.0" targetFramework="net472" /> - <package id="Microsoft.DocAsCode.MarkdownLite" version="2.47.0" targetFramework="net472" /> - <package id="Microsoft.DocAsCode.Plugins" version="2.47.0" targetFramework="net472" /> - <package id="Microsoft.DocAsCode.YamlSerialization" version="2.47.0" targetFramework="net472" /> - <package id="Newtonsoft.Json" version="9.0.1" targetFramework="net472" /> - <package id="System.Collections.Immutable" version="1.5.0" targetFramework="net472" /> - <package id="System.Composition" version="1.0.31" targetFramework="net472" /> - <package id="System.Composition.AttributedModel" version="1.0.31" targetFramework="net472" /> - <package id="System.Composition.Convention" version="1.0.31" targetFramework="net472" /> - <package id="System.Composition.Hosting" version="1.3.0" targetFramework="net472" /> - <package id="System.Composition.Runtime" version="1.3.0" targetFramework="net472" /> - <package id="System.Composition.TypedParts" version="1.0.31" targetFramework="net472" /> - <package id="YamlDotNet" version="6.0.0" targetFramework="net472" /> - <package id="YamlDotNet.Signed" version="6.0.0" targetFramework="net472" /> -</packages> diff --git a/src/docs/convert.ps1 b/src/docs/convert.ps1 new file mode 100644 index 0000000..dd55e61 --- /dev/null +++ b/src/docs/convert.ps1 @@ -0,0 +1,88 @@ +# ----------------------------------------------------------------------------------- +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the ""License""); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an ""AS IS"" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ----------------------------------------------------------------------------------- + +param ( + [Parameter(Mandatory)] + [string] + $JavaLuceneVersion +) + +[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 + +$PSScriptFilePath = (Get-Item $MyInvocation.MyCommand.Path).Directory +$RepoRoot = $PSScriptFilePath.Parent.Parent.FullName; +$ToolsFolder = Join-Path -Path $PSScriptFilePath -ChildPath "tools"; + +#ensure the /tools folder +New-Item $ToolsFolder -type directory -force +New-Item "$ToolsFolder\tmp" -type directory -force + +# go get the java lucene tag release +New-Item "$ToolsFolder\java-lucene-release" -type directory -force +$releaseFolder = "$ToolsFolder\java-lucene-release" +$releaseUrl = "https://github.com/apache/lucene-solr/archive/releases/lucene-solr/$($JavaLuceneVersion).zip" +$releaseZip = "$releaseFolder\release.zip" +if (-not (test-path $releaseZip)) { + Write-Host "Download Java Lucene release files..." + Invoke-WebRequest $releaseUrl -OutFile $releaseZip -TimeoutSec 60 + Expand-Archive -LiteralPath $releaseZip -DestinationPath $releaseFolder +} +$releaseLuceneFolder = "$releaseFolder\lucene-solr-releases-lucene-solr-$JavaLuceneVersion\lucene" +if (-not (test-path $releaseLuceneFolder)) { + Write-Error "Could not detect Java release files in folder $releaseLuceneFolder" -ErrorAction Stop +} + +# ensure we have NuGet +New-Item "$ToolsFolder\nuget" -type directory -force +$nuget = "$ToolsFolder\nuget\nuget.exe" +if (-not (test-path $nuget)) { + Write-Host "Download NuGet..." + Invoke-WebRequest "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe" -OutFile $nuget -TimeoutSec 60 +} + +# ensure we have vswhere +New-Item "$ToolsFolder\vswhere" -type directory -force +$vswhere = "$ToolsFolder\vswhere\vswhere.exe" +if (-not (test-path $vswhere)) { + Write-Host "Download VsWhere..." + $path = "$ToolsFolder\tmp" + &$nuget install vswhere -OutputDirectory $path + $dir = ls "$path\vswhere.*" | sort -property Name -descending | select -first 1 + $file = ls -path "$dir" -name vswhere.exe -recurse + mv "$dir\$file" $vswhere +} + +Remove-Item -Recurse -Force "$ToolsFolder\tmp" + +# Get MSBuild + +$MSBuild = &$vswhere -latest -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe | select-object -first 1 +if (-not (test-path $MSBuild)) { + throw "MSBuild not found!" +} + +# Build the solution +$sln = (Join-Path -Path $PSScriptFilePath "DocumentationTools.sln") +& $nuget restore $sln +& $msbuild $sln + +# Execute the program +$exe = (Join-Path -Path $PSScriptFilePath "JavaDocToMarkdownConverter\bin\Debug\JavaDocToMarkdownConverter.exe") +& $exe $releaseLuceneFolder $RepoRoot +
