Skip to content

Commit 0eb13ff

Browse files
Merge pull request #6 from kodenamekrak/master
1.28.0
2 parents 07e81b4 + bba7609 commit 0eb13ff

15 files changed

+119
-399
lines changed

.vscode/c_cpp_properties.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{
44
"defines": [
55
"MOD_ID=\"#{id}\"",
6-
"VERSION=\"0.1.0\"",
6+
"VERSION=\"#{version}\"",
77
"__GNUC__",
88
"__aarch64__"
99
],

Android.mk

Lines changed: 0 additions & 67 deletions
This file was deleted.

Android.mk.backup

Lines changed: 0 additions & 47 deletions
This file was deleted.

Application.mk

Lines changed: 0 additions & 5 deletions
This file was deleted.

bmbfmod.json

Lines changed: 0 additions & 23 deletions
This file was deleted.

build.ps1

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,30 +7,25 @@ Param(
77
)
88

99
if ($help -eq $true) {
10-
echo "`"Build`" - Copiles your mod into a `".so`" or a `".a`" library"
11-
echo "`n-- Arguments --`n"
10+
Write-Output "`"Build`" - Copiles your mod into a `".so`" or a `".a`" library"
11+
Write-Output "`n-- Arguments --`n"
1212

13-
echo "-Clean `t`t Deletes the `"build`" folder, so that the entire library is rebuilt"
13+
Write-Output "-Clean `t`t Deletes the `"build`" folder, so that the entire library is rebuilt"
1414

1515
exit
1616
}
1717

1818
# if user specified clean, remove all build files
19-
if ($clean.IsPresent)
20-
{
21-
if (Test-Path -Path "build")
22-
{
19+
if ($clean.IsPresent) {
20+
if (Test-Path -Path "build") {
2321
remove-item build -R
2422
}
2523
}
2624

2725

28-
if (($clean.IsPresent) -or (-not (Test-Path -Path "build")))
29-
{
30-
$out = new-item -Path build -ItemType Directory
26+
if (($clean.IsPresent) -or (-not (Test-Path -Path "build"))) {
27+
new-item -Path build -ItemType Directory
3128
}
3229

33-
cd build
34-
& cmake -G "Ninja" -DCMAKE_BUILD_TYPE="RelWithDebInfo" ../
35-
& cmake --build .
36-
cd ..
30+
& cmake -G "Ninja" -DCMAKE_BUILD_TYPE="RelWithDebInfo" -B build
31+
& cmake --build ./build

copy.ps1

Lines changed: 67 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,70 @@
1-
$NDKPath = Get-Content $PSScriptRoot/ndkpath.txt
1+
Param(
2+
[Parameter(Mandatory=$false)]
3+
[Switch] $clean,
24

3-
$buildScript = "$NDKPath/build/ndk-build"
4-
if (-not ($PSVersionTable.PSEdition -eq "Core")) {
5-
$buildScript += ".cmd"
5+
[Parameter(Mandatory=$false)]
6+
[Switch] $log,
7+
8+
[Parameter(Mandatory=$false)]
9+
[Switch] $useDebug,
10+
11+
[Parameter(Mandatory=$false)]
12+
[Switch] $self,
13+
14+
[Parameter(Mandatory=$false)]
15+
[Switch] $all,
16+
17+
[Parameter(Mandatory=$false)]
18+
[String] $custom="",
19+
20+
[Parameter(Mandatory=$false)]
21+
[String] $file="",
22+
23+
[Parameter(Mandatory=$false)]
24+
[Switch] $help
25+
)
26+
27+
if ($help -eq $true) {
28+
Write-Output "`"Copy`" - Builds and copies your mod to your quest, and also starts Beat Saber with optional logging"
29+
Write-Output "`n-- Arguments --`n"
30+
31+
Write-Output "-Clean `t`t Performs a clean build (equvilant to running `"build -clean`")"
32+
Write-Output "-UseDebug `t Copies the debug version of the mod to your quest"
33+
Write-Output "-Log `t`t Logs Beat Saber using the `"Start-Logging`" command"
34+
35+
Write-Output "`n-- Logging Arguments --`n"
36+
37+
& $PSScriptRoot/start-logging.ps1 -help -excludeHeader
38+
39+
exit
40+
}
41+
42+
& $PSScriptRoot/build.ps1 -clean:$clean
43+
44+
if ($LASTEXITCODE -ne 0) {
45+
Write-Output "Failed to build, exiting..."
46+
exit $LASTEXITCODE
47+
}
48+
49+
# & $PSScriptRoot/validate-modjson.ps1
50+
# if ($LASTEXITCODE -ne 0) {
51+
# exit $LASTEXITCODE
52+
# }
53+
$modJson = Get-Content "./mod.json" -Raw | ConvertFrom-Json
54+
55+
$modFiles = $modJson.modFiles
56+
57+
foreach ($fileName in $modFiles) {
58+
if ($useDebug -eq $true) {
59+
& adb push build/debug/$fileName /sdcard/Android/data/com.beatgames.beatsaber/files/mods/$fileName
60+
} else {
61+
& adb push build/$fileName /sdcard/Android/data/com.beatgames.beatsaber/files/mods/$fileName
62+
}
663
}
764

8-
& $buildScript NDK_PROJECT_PATH=$PSScriptRoot APP_BUILD_SCRIPT=$PSScriptRoot/Android.mk NDK_APPLICATION_MK=$PSScriptRoot/Application.mk
9-
& adb push libs/arm64-v8a/libRedBar_0_1_0.so /sdcard/Android/data/com.beatgames.beatsaber/files/mods/libRedBar_0_1_0.so
10-
& adb shell am force-stop com.beatgames.beatsaber
65+
& $PSScriptRoot/restart-game.ps1
66+
67+
if ($log -eq $true) {
68+
& adb logcat -c
69+
& $PSScriptRoot/start-logging.ps1 -self:$self -all:$all -custom:$custom -file:$file
70+
}

createqmod.ps1

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,6 @@ if ($help -eq $true) {
1717

1818
$mod = "./mod.json"
1919

20-
& $PSScriptRoot/build.ps1 -clean:$clean
21-
22-
if ($LASTEXITCODE -ne 0) {
23-
echo "Failed to build, exiting..."
24-
exit $LASTEXITCODE
25-
}
26-
27-
& qpm-rust qmod build
28-
29-
& $PSScriptRoot/validate-modjson.ps1
30-
if ($LASTEXITCODE -ne 0) {
31-
exit $LASTEXITCODE
32-
}
3320
$modJson = Get-Content $mod -Raw | ConvertFrom-Json
3421

3522
if ($qmodName -eq "") {

default-config.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

mod.json

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)