diff --git a/.gitignore b/.gitignore index 2c4ca28..7abbcd8 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ *.ld Thumbs.db snapshots/ +out/ saves/ working/*.asm working/*.bin @@ -212,4 +213,4 @@ FakesAssemblies/ *.plg # Visual Studio 6 workspace options file -*.opt \ No newline at end of file +*.opt diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index 388bdc1..b8577b0 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -43,5 +43,8 @@ Testing: John Enigma CloverCharBoyBound +Docker: + Ds886 + Special thanks: TragicManner diff --git a/README.md b/README.md index f4690ff..42c4826 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,15 @@ This project aims to both complete the VWF codebase and to provide a tool for tr ## Screenshots ![](./screenshots/itshappening2.png) ![](./screenshots/itshappening4.png) ![](./screenshots/itshappening5.png) ![](./screenshots/m2-status2.png) ![](./screenshots/m2-battle-slugs.png) ![](./screenshots/m2-fileselect.png) -# Building +# Building with Docker +Docker allows easily building without having to install the dependencies. + +1. Put a MOTHER 1+2 ROM in `bin/m12fresh.gba` +2. While in the root of the project, run: `docker run --rm -it -v $PWD:/home/m2gba/src lorenzooone/m2gba_translation:builder` + +The output will be inside the newly created `out` folder. + +# Manually Building ## Dependencies - [.NET Core 2.1 or later](https://dotnet.microsoft.com/download) @@ -60,7 +68,7 @@ This project aims to both complete the VWF codebase and to provide a tool for tr 2. `dotnet build tools/ScriptToolGui -o bin/ScriptToolGui` 3. Run with `dotnet bin/ScriptToolGui/ScriptToolGui.dll` (or just run the EXE file directly). -# Testing +# Manually Testing ## Dependencies - [mGBA 0.9.3 or later, or nightly built after Nov 29, 2021](https://mgba.io/downloads.html) diff --git a/docker-build-rom-script b/docker-build-rom-script deleted file mode 100755 index a65a55e..0000000 --- a/docker-build-rom-script +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/pwsh -$Env:PATH += ":/root/.dotnet" -echo "Starting to build tools" -./build-tools.ps1 - -echo "Starting to build rom" -./build.ps1 - -echo "Copying rom to output" -cp ./bin/m12.gba /opt/out - -echo "Build successful please review the folder "./out/m12.gba" for the resulted rom" \ No newline at end of file diff --git a/docker-build.sh b/docker-build.sh deleted file mode 100755 index 8e2f163..0000000 --- a/docker-build.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -rm -rf ./out -mkdir -p ./out -docker rm image mother2gba:build -docker build ./ -t mother2gba:build -docker run --rm -it -v $PWD/out:/opt/out mother2gba:build \ No newline at end of file diff --git a/Dockerfile b/docker-scripts/build-builder/Dockerfile similarity index 74% rename from Dockerfile rename to docker-scripts/build-builder/Dockerfile index f27cb23..4f95e1f 100644 --- a/Dockerfile +++ b/docker-scripts/build-builder/Dockerfile @@ -9,7 +9,6 @@ WORKDIR /opt/dep RUN wget https://dot.net/v1/dotnet-install.sh RUN chmod +x dotnet-install.sh RUN ./dotnet-install.sh -c 2.1 -ENV PATH="${PATH}:/root/.dotnet/tools" RUN echo "-------------------Installing armips------------------" RUN git clone --recursive https://github.com/Kingcom/armips.git WORKDIR /opt/dep/armips @@ -21,7 +20,10 @@ RUN mkdir -p /opt/src/bin RUN cp /opt/dep/armips/bld/armips /opt/src/bin/armips RUN cp /opt/dep/armips/bld/armipstests /opt/src/bin/armipstests RUN cp /opt/dep/armips/bld/libarmips.a /opt/src/bin/libarmips.a -RUN echo "-------------------Building patched rom------------------" -COPY ./ /opt/src +RUN useradd m2gba -m +RUN mkdir -p /home/m2gba/src +RUN cp /root/.dotnet /home/m2gba/.dotnet -R && rm -rf /opt/dep && rm -rf /opt/miscrosoft && rm -rf /root/.dotnet +RUN chown -R m2gba:m2gba /home/m2gba && chown -R m2gba:m2gba /opt/src WORKDIR /opt/src -CMD ./docker-build-rom-script \ No newline at end of file +USER m2gba +CMD /home/m2gba/src/docker-scripts/docker-build-rom-script diff --git a/docker-scripts/build-builder/docker-build-builder.sh b/docker-scripts/build-builder/docker-build-builder.sh new file mode 100755 index 0000000..6b9ea52 --- /dev/null +++ b/docker-scripts/build-builder/docker-build-builder.sh @@ -0,0 +1,3 @@ +#!/bin/bash +docker rm image mother2gba:build +docker build . -t mother2gba:build diff --git a/docker-scripts/docker-build-rom-script b/docker-scripts/docker-build-rom-script new file mode 100755 index 0000000..862688f --- /dev/null +++ b/docker-scripts/docker-build-rom-script @@ -0,0 +1,16 @@ +#!/bin/pwsh + +$Env:PATH += ":/home/m2gba/.dotnet:/home/m2gba/.dotnet/tools" +Copy-Item -Path "\home\m2gba\src\*" -Destination "\opt\src" -Recurse -Force + +"Starting to build tools" +./build-tools.ps1 + +"Starting to build rom" +./build.ps1 + +"Copying rom to output" +New-Item -Path "\home\m2gba\src" -Name "out" -ItemType "directory" -Force +Copy-Item -Path ".\bin\m12.gba" "\home\m2gba\src\out" + +"Build successful, please review the folder ./out/m12.gba for the resulting rom"