diff --git a/hasmer/Dockerfile b/hasmer/Dockerfile new file mode 100644 index 0000000..13d55fb --- /dev/null +++ b/hasmer/Dockerfile @@ -0,0 +1,17 @@ +FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build +WORKDIR /source + +COPY hasmer.sln hasmer.sln +COPY hasmer-lsp/hasmer-lsp.csproj hasmer-lsp/hasmer-lsp.csproj +COPY hasmer-cli/hasmer-cli.csproj hasmer-cli/hasmer-cli.csproj +COPY libhasmer/libhasmer.csproj libhasmer/libhasmer.csproj +RUN dotnet restore "hasmer.sln" + +COPY . . +RUN dotnet publish -o /app + + +FROM mcr.microsoft.com/dotnet/runtime:5.0 +WORKDIR /assets +COPY --from=build /app /app +ENTRYPOINT ["/app/hasmer"] diff --git a/hasmer/README.md b/hasmer/README.md index 46bd46e..be9b5ee 100644 --- a/hasmer/README.md +++ b/hasmer/README.md @@ -4,10 +4,24 @@ This directory contains the C# source code for `hasmer`, using the .NET 5.0 plat # Setup -You will need the .NET 5 SDK to compile this project. See the [.NET SDK download page](https://dotnet.microsoft.com/en-us/download) for information on how to download the .NET SDK for your operating system. +If you don't use the Docker image then you will need the .NET 5 SDK to compile this project. See the [.NET SDK download page](https://dotnet.microsoft.com/en-us/download) for information on how to download the .NET SDK for your operating system. # Building +## Using Docker + +``` +docker build -t hasmer . +``` + +From the directory where your bundle is you can then run commands, for example: + +``` +docker run --volume $(pwd):/assets hasmer disassemble -i index.android.bundle +``` + +## Manually + You can open the solution file (see `hasmer.sln`) in Visual Studio and build and run from Visual Studio. You can also build from the command line using the .NET SDK CLI: