mirror of https://github.com/axmolengine/axmol.git
Improve console/axmol.ps1 [skip ci] [skip appveyor]
This commit is contained in:
parent
8cbe447974
commit
c2bec92bc0
|
@ -89,25 +89,39 @@ function axmol_deploy() {
|
||||||
$sub_args = $args
|
$sub_args = $args
|
||||||
. axmol_build @sub_args
|
. axmol_build @sub_args
|
||||||
if ($options.p -eq 'winuwp') {
|
if ($options.p -eq 'winuwp') {
|
||||||
$appxManifestFile = Join-Path $options.d "$BUILD_DIR/bin/$cmake_target/$optimize_flag/Appx/AppxManifest.xml"
|
$appxManifestFile = Join-Path $proj_dir "$BUILD_DIR/bin/$cmake_target/$optimize_flag/Appx/AppxManifest.xml"
|
||||||
|
|
||||||
|
# deploy by visual studio major program: devenv.exe
|
||||||
|
$vswherePath = Join-Path ${env:ProgramFiles(x86)} "Microsoft Visual Studio\Installer\vswhere.exe"
|
||||||
|
$devenvPath = &$vswherePath -latest -requires Microsoft.Component.MSBuild -find Common*\IDE\devenv.exe | select-object -first 1
|
||||||
|
|
||||||
|
if (Test-Path $devenvPath -PathType Leaf) {
|
||||||
|
$devenvRoot = Split-Path $devenvPath -Parent
|
||||||
|
$env:PATH = "$devenvRoot;$env:PATH"
|
||||||
|
$slnDir = Join-Path $proj_dir $BUILD_DIR
|
||||||
|
$slnFileName = (Get-ChildItem $slnDir *.sln).Name
|
||||||
|
$slnFilePath = Join-Path $slnDir $slnFileName
|
||||||
|
devenv $slnFilePath /deploy $optimize_flag /project $cmake_target /projectconfig $optimize_flag
|
||||||
|
}
|
||||||
|
|
||||||
[XML]$appxManifest = Get-Content $appxManifestFile
|
[XML]$appxManifest = Get-Content $appxManifestFile
|
||||||
$appxIdentity = $appxManifest.Package.Identity.Name
|
$appxIdentity = $appxManifest.Package.Identity.Name
|
||||||
$appxPkgFullName = (powershell -Command "(Get-AppxPackage -Name '$appxIdentity' | Select-Object -Unique 'PackageFullName').PackageFullName")
|
# $appxPkgFullName = (powershell -Command "(Get-AppxPackage -Name '$appxIdentity' | Select-Object -Unique 'PackageFullName').PackageFullName")
|
||||||
if ($appxPkgInfo ) {
|
# if ($appxPkgFullName ) {
|
||||||
if ($uninst) {
|
# if ($uninst) {
|
||||||
println "Uninstalling $appxPkgFullName ..."
|
# println "Uninstalling $appxPkgFullName ..."
|
||||||
powershell -Command "Remove-AppxPackage -Package '$appxPkgFullName'"
|
# powershell -Command "Remove-AppxPackage -Package '$appxPkgFullName'"
|
||||||
powershell -Command "Add-AppxPackage -Register '$appxManifestFile'"
|
# powershell -Command "Add-AppxPackage -Register '$appxManifestFile'"
|
||||||
}
|
# }
|
||||||
}
|
# }
|
||||||
else {
|
# else {
|
||||||
powershell -Command "Add-AppxPackage -Register '$appxManifestFile'"
|
# powershell -Command "Add-AppxPackage -Register '$appxManifestFile'"
|
||||||
}
|
# }
|
||||||
$appxPkgName = (powershell -Command "(Get-AppxPackage -Name '$appxIdentity' | Select-Object -Unique 'PackageFamilyName').PackageFamilyName")
|
$appxPkgName = (powershell -Command "(Get-AppxPackage -Name '$appxIdentity' | Select-Object -Unique 'PackageFamilyName').PackageFamilyName")
|
||||||
println "axmol: Deploy $cmake_target done: $appxPkgName"
|
println "axmol: Deploy $cmake_target done: $appxPkgName"
|
||||||
}
|
}
|
||||||
elseif($options.p -eq 'win32') {
|
elseif($options.p -eq 'win32') {
|
||||||
$win32exePath = Join-Path $options.d "$BUILD_DIR/bin/$cmake_target/$optimize_flag/$cmake_target.exe"
|
$win32exePath = Join-Path $proj_dir "$BUILD_DIR/bin/$cmake_target/$optimize_flag/$cmake_target.exe"
|
||||||
println "axmol: Deploy $cmake_target done: $win32exePath"
|
println "axmol: Deploy $cmake_target done: $win32exePath"
|
||||||
}
|
}
|
||||||
elseif ($options.p -eq 'android') {
|
elseif ($options.p -eq 'android') {
|
||||||
|
@ -175,7 +189,7 @@ function axmol_run() {
|
||||||
println "axmol: Launching $launch_wasmapp ..."
|
println "axmol: Launching $launch_wasmapp ..."
|
||||||
emrun $launch_wasmapp
|
emrun $launch_wasmapp
|
||||||
}
|
}
|
||||||
println "axmol: Launch $cmake_target done, target platform is $(options.p)"
|
println "axmol: Launch $cmake_target done, target platform is $($options.p)"
|
||||||
}
|
}
|
||||||
|
|
||||||
$builtinPlugins = @{
|
$builtinPlugins = @{
|
||||||
|
|
Loading…
Reference in New Issue