Skip to content

Commit

Permalink
TINKERPOP-2085 Remove dependency on mono for docfx (#2840)
Browse files Browse the repository at this point in the history
---------

Co-authored-by: Stephen Mallette <stepmall@amazon.com>
  • Loading branch information
Cole-Greer and spmallette authored Oct 17, 2024
1 parent ca5414f commit 5542869
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 42 deletions.
12 changes: 12 additions & 0 deletions gremlin-dotnet/src/.config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"version": 1,
"isRoot": true,
"tools": {
"docfx": {
"version": "2.77.0",
"commands": [
"docfx"
]
}
}
}
2 changes: 0 additions & 2 deletions gremlin-dotnet/src/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
/docfx
docfx.zip
/_site
2 changes: 1 addition & 1 deletion gremlin-dotnet/src/docfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"src": [
{
"files": [ "**/*.cs" ],
"files": [ "**/*.csproj" ],
"exclude": [ "**/bin/**", "**/obj/**" ],
"src": "Gremlin.Net"
}
Expand Down
47 changes: 8 additions & 39 deletions gremlin-dotnet/src/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ limitations under the License.
<name>Apache TinkerPop :: Gremlin.Net - Source</name>
<packaging>${packaging.type}</packaging>
<properties>
<nugetVersion>4.9.2</nugetVersion>
<nugetVersion>6.11.1</nugetVersion>
<nugetExe>nuget-${nugetVersion}.exe</nugetExe>
</properties>

Expand Down Expand Up @@ -155,44 +155,13 @@ limitations under the License.
<configuration>
<target>
<taskdef resource="net/sf/antcontrib/antcontrib.properties" />
<if>
<!-- docfx sadly requires mono and nuget at this time:
1. https://github.com/dotnet/docfx/issues/3389 (nuget required for a dll not in mono
2. https://github.com/dotnet/docfx/issues/718#issuecomment-256700598 (mono workaround) -->
<and>
<available file="mono" filepath="${env.PATH}"/>
<available file="${nugetExe}"/>
</and>
<then>
<if>
<available file="docfx/docfx.exe"/>
<then>
<echo>docfx already downloaded.</echo>
</then>

<else>
<exec executable="wget" failonerror="true">
<arg line="https://github.com/dotnet/docfx/releases/download/v2.58/docfx.zip"/>
</exec>
<mkdir dir="docfx"/>
<exec executable="unzip" failonerror="true">
<arg line="docfx.zip -d docfx"/>
</exec>
<delete file="docfx.zip"/>
<exec executable="mono" failonerror="true">
<arg line="${nugetExe} install -OutputDirectory docfx SQLitePCLRaw.core -ExcludeVersion"/>
</exec>
</else>
</if>
<exec executable="mono" failonerror="true">
<arg line="docfx/docfx.exe"/>
</exec>
</then>
<else>
<echo>Skipping docfx generation as mono and nuget are required.</echo>
<echo>nuget must be installed as it would if doing a .NET deployment - see the glv-dotnet-deploy Maven profile for more information.</echo>
</else>
</if>
<!-- update docfx if necessary -->
<exec executable="dotnet" failonerror="true">
<arg line="dotnet tool restore"/>
</exec>
<exec executable="dotnet" failonerror="true">
<arg line="docfx docfx.json"/>
</exec>
</target>
</configuration>
</execution>
Expand Down

0 comments on commit 5542869

Please sign in to comment.