FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
API-Examples/windows/APIExample/cloud_build.bat at main · guogitg/API-Examples · GitHub
guogitg
/
API-Examples
Public
forked from
AgoraIO/API-Examples
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
API-Examples
/
windows
/
APIExample
/
cloud_build.bat
Copy path
More file actions
More file actions
Latest commit
History
History
History
81 lines (64 loc) · 2.43 KB
Breadcrumbs
API-Examples
/
windows
/
APIExample
/
cloud_build.bat
Copy path
File metadata and controls
81 lines (64 loc) · 2.43 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
@
echo
off
setlocal
enabledelayedexpansion
echo
"
compile start...
"
REM
--- 1. Install Dependencies ---
powershell.exe -ExecutionPolicy Bypass -File
"
%~dp0
install.ps1
"
REM
--- 2. Find MSBuild ---
set
"
MSBuildPath
=
"
set
"
vswhere
=
%ProgramFiles(x86)%
\Microsoft Visual Studio\Installer\vswhere.exe
"
if
exist
"
!vswhere!
"
(
for
/f
"
usebackq tokens=*
"
%%i
in
(`
"
!vswhere!
"
-latest -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe`)
do
set
"
MSBuildPath
=
%%i
"
)
if
not
defined
MSBuildPath (
for
%%p
in
(
"
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\MSBuild.exe
"
"
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\MSBuild.exe
"
"
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe
"
)
do
if
exist
%%p
set
"
MSBuildPath
=
%%p
"
)
if
not
defined
MSBuildPath (
echo
Error: MSBuild not found.
exit
/b
1
)
echo
Using MSBuild at:
"
!MSBuildPath!
"
REM
--- 3. Build ---
"
!MSBuildPath!
"
"
APIExample.sln
"
/p:platform=
"
Win32
"
/p:configuration=
"
Release
"
if
%ERRORLEVEL%
NEQ
0
(
echo
Build failed!
exit
/b
%ERRORLEVEL%
)
echo
"
compile done.
"
REM
--- 4. Package (Clean Output) ---
echo
Preparing clean output directory...
rmdir
/S /Q Output
2
>
nul
mkdir
Output
REM
Copy executables and DLLs from Release
xcopy
/Y /S Release\*.exe Output\
>
nul
2
>&
1
xcopy
/Y /S Release\*.dll Output\
>
nul
2
>&
1
REM
Copy resources
xcopy
/Y /S /I APIExample\res Output\res
>
nul
2
>&
1
xcopy
/Y APIExample\*.ini Output\
>
nul
2
>&
1
REM
Copy SDK and ThirdParty DLLs (Agora uses sdk\x86 for Win32)
xcopy
/Y sdk\x86\*.dll Output\
>
nul
2
>&
1
xcopy
/Y ThirdParty\libFFmpeg\*.dll Output\
>
nul
2
>&
1
echo
Packaging...
set
"
result_zip
=
result.zip
"
del
/F /Q
!result_zip!
2
>
nul
REM
Try 7z, fallback to PowerShell
where
7z
>
nul
2
>
nul
if
%ERRORLEVEL%
EQU
0
(
7z a -tzip
!result_zip!
.\Output\*
>
nul
)
else
(
"
C:\Program Files\7-Zip\7z.exe
"
a -tzip
!result_zip!
.\Output\*
>
nul
2
>
nul
if
%ERRORLEVEL%
NEQ
0
(
powershell
-command
"
Compress-Archive -Path '.\Output\*' -DestinationPath '
!result_zip!
' -Force
"
)
)
REM
Copy to WORKSPACE with Agora-prefixed naming format
set
h
=
%time:~
0
,
2
%
set
h
=
%h:
=
0
%
if
not
defined
WORKSPACE
set
WORKSPACE
=
%~dp0
copy
!result_zip!
"
%WORKSPACE%
\\Agora_APIExample_windows_
%BUILD_NUMBER%
_
%date:~
4
,
2
%%date:~
7
,
2
%%h%%time:~
3
,
2
%
_Release_exe.zip
"
del
/F /Q
!result_zip!
2
>
nul
rmdir
/S /Q Output
2
>
nul
echo
Build and Package done.
Back
|
FazBrowse Home
|
New Git URL