You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucenenet.apache.org by sh...@apache.org on 2020/06/29 13:03:28 UTC

[lucenenet] branch docs-poc updated: adds cli, cleans up ps1 script

This is an automated email from the ASF dual-hosted git repository.

shazwazza pushed a commit to branch docs-poc
in repository https://gitbox.apache.org/repos/asf/lucenenet.git


The following commit(s) were added to refs/heads/docs-poc by this push:
     new f310ec8  adds cli, cleans up ps1 script
f310ec8 is described below

commit f310ec8bf89e297522b4de9bc49d64fd469630d2
Author: Shannon <sd...@gmail.com>
AuthorDate: Mon Jun 29 23:03:09 2020 +1000

    adds cli, cleans up ps1 script
---
 websites/apidocs/docfx.site.json |  8 +++++++
 websites/apidocs/docs.ps1        | 46 ++++++++++++++++++++--------------------
 2 files changed, 31 insertions(+), 23 deletions(-)

diff --git a/websites/apidocs/docfx.site.json b/websites/apidocs/docfx.site.json
index 325a436..a7a2482 100644
--- a/websites/apidocs/docfx.site.json
+++ b/websites/apidocs/docfx.site.json
@@ -6,6 +6,14 @@
           "toc.yml",
           "*.md"
         ]
+      },
+      {
+        "files": [
+          "**.md",
+          "**.yml"
+        ],
+        "src": "../../src/dotnet/tools/lucene-cli/docs",
+        "dest": "cli"
       }
     ],
     "resource": [
diff --git a/websites/apidocs/docs.ps1 b/websites/apidocs/docs.ps1
index e4dc2eb..02874c3 100644
--- a/websites/apidocs/docs.ps1
+++ b/websites/apidocs/docs.ps1
@@ -19,21 +19,16 @@
 
 param (
     [Parameter(Mandatory)]
-    [string]
-    $LuceneNetVersion, # TODO: Validate this with regex
-    [Parameter(Mandatory = $false)]
-    [int]
-    $ServeDocs = 1,
-    [Parameter(Mandatory = $false)]
-    [int]
-    $Clean = 0,
+    [string] $LuceneNetVersion, # TODO: Validate this with regex
+    [switch] $ServeDocs = $false,
+    [switch] $Clean = $false,
+    [switch] $DisableMetaData = $false,
+    [switch] $DisableBuild = $false,
     # LogLevel can be: Diagnostic, Verbose, Info, Warning, Error
     [Parameter(Mandatory = $false)]
-    [string]
-    $LogLevel = 'Warning',
+    [string] $LogLevel = 'Warning',
     [Parameter(Mandatory = $false)]
-    [string]
-    $BaseUrl = 'http://localhost:8080'
+    [string] $BaseUrl = 'http://localhost:8080'
 )
 
 [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
@@ -45,7 +40,7 @@ $ToolsFolder = Join-Path -Path $ApiDocsFolder -ChildPath "tools";
 #ensure the /build/tools folder
 New-Item $ToolsFolder -type directory -force
 
-if ($Clean -eq 1) {
+if ($Clean) {
     Write-Host "Cleaning tools..."
     Remove-Item (Join-Path -Path $ToolsFolder "\*") -recurse -force -ErrorAction SilentlyContinue
 }
@@ -87,7 +82,7 @@ if (-not (test-path $vswhere)) {
 Remove-Item  -Recurse -Force "$ToolsFolder\tmp"
 
 # delete anything that already exists
-if ($Clean -eq 1) {
+if ($Clean) {
     Write-Host "Cleaning..."
     Remove-Item (Join-Path -Path $ApiDocsFolder "_site\*") -recurse -force -ErrorAction SilentlyContinue
     Remove-Item (Join-Path -Path $ApiDocsFolder "_site") -force -ErrorAction SilentlyContinue
@@ -152,16 +147,16 @@ $DocFxJsonSite = Join-Path -Path $ApiDocsFolder "docfx.site.json"
 # set env vars that will be replaced in Markdown
 $env:LuceneNetVersion = $LuceneNetVersion
 
-$DocFxLog = Join-Path -Path $ApiDocsFolder "obj\docfx.log"
-
-if ($?) { 
+if ($? -and $DisableMetaData -eq $false) { 
     foreach ($proj in $DocFxJsonMeta) {
         $projFile = Join-Path -Path $ApiDocsFolder $proj
 
+        $DocFxLog = Join-Path -Path $ApiDocsFolder "obj\${proj}.meta.log"
+
         # build the output		
         Write-Host "Building api metadata for $projFile..."
 
-        if ($Clean -eq 1) {
+        if ($Clean) {
             & $DocFxExe metadata $projFile --log "$DocFxLog" --loglevel $LogLevel --force
         }
         else {
@@ -170,14 +165,16 @@ if ($?) {
     }
 }
 
-if ($?) { 
+if ($? -and $DisableBuild -eq $false) { 
     foreach ($proj in $DocFxJsonMeta) {
         $projFile = Join-Path -Path $ApiDocsFolder $proj
 
+        $DocFxLog = Join-Path -Path $ApiDocsFolder "obj\${proj}.build.log"
+
         # build the output		
         Write-Host "Building site output for $projFile..."
 
-        if ($Clean -eq 1) {
+        if ($Clean) {
             & $DocFxExe build $projFile --log "$DocFxLog" --loglevel $LogLevel --force --debug
         }
         else {
@@ -207,13 +204,16 @@ if ($?) {
     }
 }
 
-if ($?) { 
-    if ($ServeDocs -eq 0) {
+if ($?) {
+
+    $DocFxLog = Join-Path -Path $ApiDocsFolder "obj\docfx.site.json.log"
+
+    if ($ServeDocs -eq $false) {
 
         # build the output		
         Write-Host "Building docs..."
 
-        if ($Clean -eq 1) {
+        if ($Clean) {
             & $DocFxExe $DocFxJsonSite --log "$DocFxLog" --loglevel $LogLevel --force --debug
         }
         else {