Skip to content

Commit

Permalink
Build pdx using parent directory name
Browse files Browse the repository at this point in the history
Previously, this always used "playdate.pdx", which would overwrite other games with the same name when uploaded to device. The parent directory name is now used instead. This was chosen over `projectName()` so VSC can still reliably find the built PDX using `{workspaceFolderBasename}`.
  • Loading branch information
paulstraw authored and samdze committed Nov 26, 2023
1 parent 5d3a294 commit f7e52e5
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
# prompts so we can do a headless install
- name: Force non-interactive apt installations
run: echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections

- name: Update dependencies
run: apt-get update
- name: Install dependencies
Expand Down Expand Up @@ -107,4 +107,4 @@ jobs:
- name: Run headless test
working-directory: ./tests
run: xvfb-run ../PlaydateSDK-*/bin/PlaydateSimulator playdate.pdx
run: xvfb-run ../PlaydateSDK-*/bin/PlaydateSimulator tests.pdx
4 changes: 2 additions & 2 deletions playdate_example/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
playdate.pdx
*.pdx
source/pdex.*
*.dSYM
*.dSYM
8 changes: 4 additions & 4 deletions playdate_example/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"name": "Debug PDX",
"program": "${env:PLAYDATE_SDK_PATH}/bin/Playdate Simulator",
"args": [
"${workspaceFolder}/playdate.pdx"
"${workspaceFolder}/${workspaceFolderBasename}.pdx"
],
"cwd": "${workspaceFolder}",
"osx": {
Expand All @@ -33,7 +33,7 @@
"program": "${env:PLAYDATE_SDK_PATH}/bin/Playdate Simulator",
"preLaunchTask": "Build Universal PDX",
"args": [
"${workspaceFolder}/playdate.pdx"
"${workspaceFolder}/${workspaceFolderBasename}.pdx"
],
"cwd": "${workspaceFolder}",
"osx": {
Expand All @@ -56,7 +56,7 @@
"program": "${env:PLAYDATE_SDK_PATH}/bin/Playdate Simulator",
"preLaunchTask": "Build Simulator PDX",
"args": [
"${workspaceFolder}/playdate.pdx"
"${workspaceFolder}/${workspaceFolderBasename}.pdx"
],
"cwd": "${workspaceFolder}",
"osx": {
Expand Down Expand Up @@ -92,4 +92,4 @@
}
}
]
}
}
5 changes: 3 additions & 2 deletions src/playdate/build/nimble.nim
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ when not compiles(task):


proc bundlePDX() =
## Bundles the pdx file
exec(pdcPath() & " --verbose -sdkpath " & sdkPath() & " source playdate")
## Bundles pdx file using parent directory name.
exec(pdcPath() & " --verbose -sdkpath " & sdkPath() & " source " &
thisDir().splitPath.tail)

proc postBuild(target: Target) =
## Performs post-build cleanup and prepares files for bundling.
Expand Down
4 changes: 2 additions & 2 deletions tests/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
playdate.pdx
*.pdx
source/pdex.*
*.dSYM
*.dSYM

0 comments on commit f7e52e5

Please sign in to comment.