Skip to content

Commit

Permalink
Add dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
tcz717 committed Jan 15, 2022
1 parent 04791a7 commit 46c0d59
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 1 deletion.
25 changes: 25 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
**/.classpath
**/.dockerignore
**/.env
**/.git
**/.gitignore
**/.project
**/.settings
**/.toolstarget
**/.vs
**/.vscode
**/*.*proj.user
**/*.dbmdl
**/*.jfm
**/azds.yaml
**/bin
**/charts
**/docker-compose*
**/Dockerfile*
**/node_modules
**/npm-debug.log
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
LICENSE
README.md
20 changes: 20 additions & 0 deletions LsifDotnet/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.

FROM mcr.microsoft.com/dotnet/sdk:6.0 AS base
WORKDIR /app

FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
ARG VERSION=1.0.0
WORKDIR /src
COPY ["LsifDotnet/LsifDotnet.csproj", "LsifDotnet/"]
RUN dotnet restore "LsifDotnet/LsifDotnet.csproj"
COPY . .
WORKDIR "/src/LsifDotnet"
RUN dotnet publish "LsifDotnet.csproj" -c Release -o /app/publish -p:Version=${VERSION}

FROM sourcegraph/src-cli:3.34.1 AS src-cli

FROM base AS final
WORKDIR /app
COPY --from=build /app/publish .
COPY --from=src-cli /usr/bin/src /usr/bin/
26 changes: 25 additions & 1 deletion LsifDotnet/LsifDotnet.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<AssemblyName>lsif-dotnet</AssemblyName>
<Nullable>enable</Nullable>
<Authors>tcz717</Authors>
<Copyright>https://github.com/tcz717/LsifDotnet/blob/main/LICENSE</Copyright>
<PackageProjectUrl>https://github.com/tcz717/LsifDotnet</PackageProjectUrl>
<PackageReadmeFile>README.md</PackageReadmeFile>
<RepositoryUrl>https://github.com/tcz717/LsifDotnet</RepositoryUrl>
<PackageTags>roslyn;lsif;lsif-indexer;lsif-generator;lsif-dump;lsif-dotnet</PackageTags>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
</PropertyGroup>

<ItemGroup>
Expand All @@ -14,6 +23,7 @@
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.0.1" />
<PackageReference Include="Microsoft.CodeAnalysis.Features" Version="4.0.1" />
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="4.0.1" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.14.0" />
<PackageReference Include="QuikGraph.Graphviz" Version="2.3.1" />
<PackageReference Include="System.CommandLine" Version="2.0.0-beta2.21617.1" />
<PackageReference Include="System.CommandLine.Hosting" Version="0.4.0-alpha.21617.1" />
Expand All @@ -24,4 +34,18 @@
<Folder Include="Lsif\" />
</ItemGroup>

<ItemGroup>
<None Include="..\README.md">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
</ItemGroup>

<ItemGroup>
<None Include="..\LICENSE">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
</ItemGroup>

</Project>
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

Visit https://lsif.dev/ to learn about LSIF.

Example scenario:[Sourcegraph precise code intelligence](https://docs.sourcegraph.com/code_intelligence/explanations/precise_code_intelligence) ([lsif-dotnet repo](https://sourcegraph.com/github.com/tcz717/LsifDotnet/-/blob/LsifDotnet/Program.cs)


Only tested in win platform and don't support `VisualBasic` yet.

Implmented LSIF data:
Expand Down

0 comments on commit 46c0d59

Please sign in to comment.