diff --git a/hasm-vscode/scripts/src/build.ts b/hasm-vscode/scripts/src/build.ts index 462a63f..5897706 100644 --- a/hasm-vscode/scripts/src/build.ts +++ b/hasm-vscode/scripts/src/build.ts @@ -33,7 +33,7 @@ interface BytecodeDefinitionFile { const fileExists = async (path: string) => !!(await fs.stat(path).catch((_) => false)); - const outputDirectory = path.join(lspDir, 'bin', 'Debug', 'net5.0'); + const outputDirectory = path.join(lspDir, 'bin', 'Debug', 'net8.0'); const destDirectory = path.join(process.cwd(), 'client', 'out', 'lsp'); if (!fileExists(destDirectory)) { fs.mkdir(destDirectory, { diff --git a/hasmer/Dockerfile b/hasmer/Dockerfile new file mode 100644 index 0000000..e9ce7ef --- /dev/null +++ b/hasmer/Dockerfile @@ -0,0 +1,17 @@ +FROM mcr.microsoft.com/dotnet/sdk:8.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:8.0 +WORKDIR /assets +COPY --from=build /app /app +ENTRYPOINT ["/app/hasmer"] diff --git a/hasmer/README.md b/hasmer/README.md index c63a6a9..1d51006 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 8.0 plat # Setup -You will need the .NET 8 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 to install the .NET 8 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: diff --git a/hasmer/hasmer-cli/hasmer-cli.csproj b/hasmer/hasmer-cli/hasmer-cli.csproj index 7806152..0a10501 100644 --- a/hasmer/hasmer-cli/hasmer-cli.csproj +++ b/hasmer/hasmer-cli/hasmer-cli.csproj @@ -1,11 +1,11 @@ - + Exe net8.0 Hasmer.CLI hasmer - true + false