generated from Aliucord/plugins-template
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.ps1
30 lines (28 loc) · 963 Bytes
/
build.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# The plugin to build, or defaults to all plugins
param([String]$Plugin = "*")
if (-not(Get-Command "d8" -errorAction SilentlyContinue))
{
Throw "Please add the Android SDK build tools to your path (Android/Sdk/build-tools/SOME_VERSION)"
}
Set-Location ../buildtool
Write-Output "Building plugin..."
./buildtool.exe -p "$Plugin"
Set-Location ../buildsPlugins
if (-not(adb devices | findstr "\<device\>")) {
Throw "No android device found. Connect to your phone via adb first"
}
Write-Output "Pushing plugin zip to device..."
if ($Plugin -eq "*") {
$files = Get-ChildItem . -Filter *.zip
foreach ($f in $files) {
adb push -- "$f" /storage/emulated/0/Aliucord/plugins
}
}
else {
adb push "$Plugin.zip" /storage/emulated/0/Aliucord/plugins
}
Write-Output "Force stopping Aliucord..."
adb shell am force-stop com.aliucord
Write-Output "Launching Aliucord..."
adb shell monkey -p com.aliucord -c android.intent.category.LAUNCHER 1
Set-Location ../plugins