Skip to content

Commit

Permalink
修改了构建脚本
Browse files Browse the repository at this point in the history
zsh2401 committed Feb 22, 2021
1 parent 16da8f8 commit 98717db
Showing 4 changed files with 34 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/AutumnBox.GUI/AutumnBox.GUI.csproj
Original file line number Diff line number Diff line change
@@ -208,8 +208,8 @@
</Page>
</ItemGroup>

<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
<Exec Command="powershell $(ProjectDir)afterbuild.ps1 $(TargetDir) $(ConfigurationName)" />
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="powershell $(ProjectDir)place_adb.ps1 $(TargetDir) $(ConfigurationName)&#xD;&#xA;powershell $(ProjectDir)build_ext.ps1 $(TargetDir) $(ConfigurationName)&#xD;&#xA;powershell $(ProjectDir)create_build_info.ps1 $(TargetDir) $(ConfigurationName)" />
</Target>

</Project>
Original file line number Diff line number Diff line change
@@ -2,10 +2,6 @@
$OutDir = $($args[0])
$ConfigurationName = $($args[1])

#Copy adb binaries
$ADBBinariesDirectoryPath = [System.IO.Path]::Combine($PSScriptRoot, "../../adb_binary")
Copy-Item -Force -Recurse $ADBBinariesDirectoryPath $OutDir -Exclude .git

#Build extensions
$ExtensionsOutputDir = [System.IO.Path]::Combine($OutDir, "extensions");
$StdExt = [System.IO.Path]::Combine($PSScriptRoot, "../AutumnBox.Extensions.Standard")
@@ -19,4 +15,4 @@ dotnet build -c $ConfigurationName $EssExt -o $ExtensionsOutputDir

Remove-Item $([System.IO.Path]::Combine($ExtensionsOutputDir, "AutumnBox.Core.*"))

echo "Build script has finished"
echo "Extensions has been built and installed successfully"
22 changes: 22 additions & 0 deletions src/AutumnBox.GUI/create_build_info.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#Define constants
$OutDir = $($args[0])
$ConfigurationName = $($args[1])

$FilePath = [System.IO.Path]::Combine($OutDir,"build.ini");

#Content
$Now = [System.DateTime]::Now.ToString("yyyy/MM/dd HH:mm:ss")
$Commit = git rev-parse HEAD
$LatestTag = git describe --abbrev=0 --tags
$Content="[Build]
datetime=$Now
commit=$Commit
tag=$LatestTag
"
#Write to file
$fs = [System.IO.FileStream]::new($FilePath,[System.IO.FileMode]::OpenOrCreate);
$sw = [System.IO.StreamWriter]::new($fs);
$sw.Write($Content);
$sw.Flush();
$sw.Dispose();
$fs.Dispose();
9 changes: 9 additions & 0 deletions src/AutumnBox.GUI/place_adb.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#Define constants
$OutDir = $($args[0])
$ConfigurationName = $($args[1])

#Copy adb binaries
$ADBBinariesDirectoryPath = [System.IO.Path]::Combine($PSScriptRoot, "../../adb_binary")
Copy-Item -Force -Recurse $ADBBinariesDirectoryPath $OutDir -Exclude .git

echo "Adb Binaries has been placed in $ADBBinariesDirectoryPath"

0 comments on commit 98717db

Please sign in to comment.