Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
zsh2401 committed May 30, 2020
2 parents c471a8e + f6331f3 commit 9244c96
Show file tree
Hide file tree
Showing 66 changed files with 1,682 additions and 1,103 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/dev-canary-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,8 @@ jobs:
- name: Install dependencies
run: dotnet restore src/

- name: Clear adb binaries floder
run: Remove-Item -Path adb_binary -Recurse -Force

- name: Download adb binaries.
run: git clone https://github.com/zsh2401/AutumnBox-AdbBinaries-Store.git adb_binary
run: ./scripts/get_adb.ps1

- name: Building with script
run: ./scripts/build_canary.ps1
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ gfast.exe
makezip
##dirs
AutumnBox-Canary
adb_binary/
.vs/
publish/
out/
Expand Down
3 changes: 1 addition & 2 deletions scripts/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
nuget.exe
out
!sdk
43 changes: 28 additions & 15 deletions scripts/build_canary.ps1
Original file line number Diff line number Diff line change
@@ -1,36 +1,49 @@
# should working on root directory
# You should run this script as : ./scripts/canary_build.ps1


#Configures
$DNCGUI = [System.IO.Path]::Combine($PSScriptRoot, "../src/AutumnBox.DNCGUI")
$StdExt = [System.IO.Path]::Combine($PSScriptRoot, "../src/AutumnBox.Extensions.DNCStandard")
$EssExt = [System.IO.Path]::Combine($PSScriptRoot, "../src/AutumnBox.Extensions.DNCEssentials")
$CanaryPath = [System.IO.Path]::Combine($PSScriptRoot,"../AutumnBox-Canary/");
$ExtensionsOutputDir = [System.IO.Path]::Combine($CanaryPath, "extensions");
$AdbOutputDir = [System.IO.Path]::Combine($CanaryPath, "adb_binary");
$CompileConfigure = "Release";
$Runtime ="win-x86";
$ADBBinariesDirectoryPath = [System.IO.Path]::Combine($PSScriptRoot, "../adb_binary")
# Functions
function Write-Green($message) {
[System.Console]::ForegroundColor = [System.ConsoleColor]::Green;
Write-Output $message
[System.Console]::ResetColor()
}
function Initialize-Canary(){
if($CanaryDir.Exists){
Write-Green $CanaryDir.FullName;
$CanaryDir.Delete($true)
}
[System.IO.Directory]::CreateDirectory($CanaryPath)
}

#Configures
$CanaryPath = "AutumnBox-Canary/";
$CanaryExtensionsPath = [System.IO.Path]::Combine($CanaryPath, "extensions");
$Runtime = "win-x86";
$CompileConfigure = "Release";
Initialize-Canary

#Build
Write-Green "Restoring dependencies"
dotnet restore src/

Write-Green "Compiling AutumnBox.DNCGUI"
dotnet publish src/AutumnBox.DNCGUI -c $CompileConfigure -r $Runtime --no-dependencies --self-contained true --output $CanaryPath

Write-Green "Compiling Extensions."
dotnet publish src/AutumnBox.Extensions.DNCEssentials -c $CompileConfigure -r $Runtime --output $CanaryExtensionsPath
dotnet publish src/AutumnBox.Extensions.DNCStandard -c $CompileConfigure -r $Runtime --output $CanaryExtensionsPath
dotnet publish $DNCGUI -c $CompileConfigure -r $Runtime --no-dependencies --self-contained true -o $CanaryPath

Write-Green "Place adb binaries."
Copy-Item -Recurse -Force .\adb_binary $([System.IO.Path]::Combine($CanaryPath,"adb_binary"))
#Copying Adb binaries
Write-Green "Copying adb files"
Copy-Item -Force -Recurse $ADBBinariesDirectoryPath $AdbOutputDir -Exclude **/.git

#Finishing
Write-Green "Clear Useless files."
Remove-Item -Recurse -Force $([System.IO.Path]::Combine($CanaryExtensionsPath, "*")) -Exclude AutumnBox.Extensions.*.dll;
#Build extensions
Write-Green "Compiling Extensions"
dotnet publish $StdExt -c $CompileConfigure -r $Runtime -o $ExtensionsOutputDir
dotnet publish $EssExt -c $CompileConfigure -r $Runtime -o $ExtensionsOutputDir
Remove-Item -Force -Recurse $([System.IO.Path]::Combine($ExtensionsOutputDir,"*")) -Exclude "AutumnBox.Extensions.*.dll"

#Finished
Write-Green "===Finished==="
9 changes: 9 additions & 0 deletions scripts/get_adb.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
$ADBGitStore = "https://github.com/zsh2401/AutumnBox-AdbBinaries-Store"
$BranchName = "1.0.40"
$ADBBinariesDirectoryPath = [System.IO.Path]::Combine($PSScriptRoot, "../adb_binary")
$ADBBinariesDirectory = [System.IO.DirectoryInfo]::new($ADBBinariesDirectoryPath);
if ($ADBBinariesDirectory.Exists) {
Remove-Item $ADBBinariesDirectory.FullName -Force -Recurse;
$ADBBinariesDirectory.Create();
}
git clone -b $BranchName $ADBGitStore $ADBBinariesDirectory.FullName
3 changes: 0 additions & 3 deletions scripts/push_sdk_example.bat

This file was deleted.

3 changes: 3 additions & 0 deletions scripts/sdk/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
nuget.exe
tmp
API_KEY
26 changes: 26 additions & 0 deletions scripts/sdk/AutumnBox.SDK.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0"?>
<package >
<metadata>
<id>AutumnBox.SDK</id>
<version>11.5</version>
<title>AutumnBox.SDK</title>
<authors>zsh2401</authors>
<owners>zsh2401</owners>
<licenseUrl>https://github.com/zsh2401/AutumnBox/blob/master/LICENSE</licenseUrl>
<projectUrl>http://github.com/zsh2401/AutumnBox</projectUrl>
<iconUrl>http://atmb.top/images/leaves.png</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Let's develop AutumnBox extension together!This assembly includes a serials of tools useful for third party developers.</description>
<releaseNotes>11.5 update logs: Bug fixes,change target to .net fx 4.5 again.</releaseNotes>
<copyright>Copyright zsh2401,2017-2020</copyright>
<tags>ADB AutumnBox</tags>
<language>zh-CN</language>
</metadata>
<files>
<file src="tmp\net45\AutumnBox.Core.dll" target="lib/net45"/>
<file src="tmp\net45\AutumnBox.Core.xml" target="lib/net45"/>

<file src="tmp\netcore31\AutumnBox.STDCore.dll" target="lib/netcoreapp3.1"/>
<file src="tmp\netcore31\AutumnBox.STDCore.xml" target="lib/netcoreapp3.1"/>
</files>
</package>
2 changes: 2 additions & 0 deletions scripts/sdk/build.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Import-Module $([System.IO.Path]::Combine($PSScriptRoot,"sdk.psm1"))
Build-SDK
2 changes: 2 additions & 0 deletions scripts/sdk/push.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Import-Module $([System.IO.Path]::Combine($PSScriptRoot,"sdk.psm1"))
Push-SDK
26 changes: 26 additions & 0 deletions scripts/sdk/sdk.psm1
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
$NetCoreSDK = [System.IO.Path]::Combine($PSScriptRoot,"../../src/AutumnBox.STDCore");
$NetFxSDK = [System.IO.Path]::Combine($PSScriptRoot,"../../src/AutumnBox.Core");
$TmpDir = [System.IO.Path]::Combine($PSScriptRoot,"tmp");
$NugetExe = [System.IO.Path]::Combine($PSScriptRoot,"nuget.exe")
$Nuspec = [System.IO.Path]::Combine($PSScriptRoot,"AutumnBox.SDK.nuspec")
$NugetPackOutputDir = [System.IO.Path]::Combine($PSScriptRoot,"packages")
$API_KEY_FILE = [System.IO.Path]::Combine($PSScriptRoot,"API_KEY")

Write-Output $CacheDirectory
function Build-SDK(){
dotnet build $NetCoreSDK -o "$TmpDir/netcore31" -c SDK
dotnet build $NetFxSDK -o "$TmpDir/net45" -c SDK
&$NugetExe pack $Nuspec -OutputDirectory $CacheDirectory
}
function Push-SDK($version){
$CacheDirPath = $([System.IO.Path]::Combine($PSScriptRoot,[System.Guid]::NewGuid().ToString()))
$CacheDirectory = [System.IO.DirectoryInfo]::new($CacheDirPath);
$API_KEY = [System.IO.File]::ReadAllText($API_KEY_FILE);
try{
&$NugetExe pack $Nuspec -OutputDirectory $CacheDirectory.FullName
&$NugetExe push "$($CacheDirectory.FullName)\*" $API_KEY -Source https://api.nuget.org/v3/index.json
$CacheDirectory.Delete($true);
}catch{

}
}
3 changes: 0 additions & 3 deletions scripts/sdk_packer.bat

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace AutumnBox.Basic.Device.Management.AppFx
/// <summary>
/// 包管理器实现
/// </summary>
[Obsolete("等待重做,请勿使用,如需相关功能,请自行实现", true)]
[Obsolete("等待重做,请勿使用,如需相关功能,请自行实现")]
public class PackageManager : DeviceCommander
{
/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion src/AutumnBox.Basic.Shared/ModuleInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ public static class ModuleInfo
/// 指示版本
/// </summary>
public static Version Version => Version.Parse(VERSION_STR);
const string VERSION_STR = "2020.5.19";
const string VERSION_STR = "2020.5.27";
}
}
11 changes: 11 additions & 0 deletions src/AutumnBox.Core/AutumnBox.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,17 @@
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<DocumentationFile>bin\SDK\AutumnBox.Core.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Canary|AnyCPU'">
<OutputPath>bin\Canary\</OutputPath>
<DefineConstants>TRACE;USE_NT_JSON NET45</DefineConstants>
<DocumentationFile>..\..\dist\Release\AutumnBox.Core.xml</DocumentationFile>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<LangVersion>8.0</LangVersion>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
Expand Down
4 changes: 2 additions & 2 deletions src/AutumnBox.Core/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("11.5.0.0")]
[assembly: AssemblyFileVersion("11.5.0.0")]
[assembly: AssemblyVersion("11.5.1.0")]
[assembly: AssemblyFileVersion("11.5.1.0")]
14 changes: 12 additions & 2 deletions src/AutumnBox.DNCGUI/AutumnBox.DNCGUI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
<StartupObject>AutumnBox.GUI.Program</StartupObject>
<AssemblyName>AutumnBox.GUI</AssemblyName>
<RootNamespace>AutumnBox.GUI</RootNamespace>
<ApplicationIcon>Resources\Icons\icon.ico</ApplicationIcon>
<Version>2020.5.30</Version>
<AssemblyVersion>2020.5.30.0</AssemblyVersion>
<ApplicationManifest>..\AutumnBox.GUI.Shared\Properties\app.manifest</ApplicationManifest>
<Configurations>Debug;Release;Canary</Configurations>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
Expand All @@ -20,6 +25,11 @@
<OutputPath></OutputPath>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Canary|AnyCPU'">
<DefineConstants>TRACE;USE_SYS_JSON WIN32 NETCORE31 GREEN_RELEASE CANARY</DefineConstants>
<OutputPath />
</PropertyGroup>

<Import Project="..\AutumnBox.GUI.Shared\AutumnBox.GUI.Shared.projitems" Label="Shared" />

<ItemGroup>
Expand Down Expand Up @@ -99,8 +109,8 @@
</Page>
</ItemGroup>

<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="xcopy $(ProjectDir)..\..\adb_binary $(ProjectDir)$(OutDir)\adb_binary\ /e /d /y" />
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
<Exec Command="powershell $(ProjectDir)afterbuild.ps1 $(TargetDir) $(ConfigurationName)" />
</Target>

</Project>
20 changes: 20 additions & 0 deletions src/AutumnBox.DNCGUI/afterbuild.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#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

#Build extensions
$ExtensionsOutputDir = [System.IO.Path]::Combine($OutDir, "extensions");
$StdExt = [System.IO.Path]::Combine($PSScriptRoot, "../AutumnBox.Extensions.DNCStandard")
$EssExt = [System.IO.Path]::Combine($PSScriptRoot, "../AutumnBox.Extensions.DNCEssentials")

if (![System.IO.Directory]::Exists($ExtensionsOutputDir)) {
[System.IO.Directory]::CreateDirectory($ExtensionsOutputDir);
}
dotnet build -c $ConfigurationName $StdExt -o $ExtensionsOutputDir
dotnet build -c $ConfigurationName $EssExt -o $ExtensionsOutputDir

Remove-Item $([System.IO.Path]::Combine($ExtensionsOutputDir, "*")) -Exclude "AutumnBox.Extensions.*.dll"
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<AssemblyName>AutumnBox.Extensions.DNCEssentials</AssemblyName>
<RootNamespace>AutumnBox.Extensions.Essentials</RootNamespace>
<UseWPF>true</UseWPF>
<Configurations>Debug;Release;Canary</Configurations>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
Expand All @@ -15,8 +16,14 @@
<OutputPath></OutputPath>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Canary|AnyCPU'">
<OutputPath />
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\AutumnBox.STDCore\AutumnBox.STDCore.csproj" />
<ProjectReference Include="..\AutumnBox.STDCore\AutumnBox.STDCore.csproj">
<Private>false</Private>
</ProjectReference>
</ItemGroup>

<Import Project="..\AutumnBox.Extensions.Essentials.Shared\AutumnBox.Extensions.Essentials.Shared.projitems" Label="Shared" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,19 @@
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<UseWPF>true</UseWPF>
<Configurations>Debug;Release;Canary</Configurations>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<OutputPath></OutputPath>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<OutputPath></OutputPath>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Canary|AnyCPU'">
<OutputPath />
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ class EAutumnBoxAdFetcher : LeafExtensionBase
public void EntryPoint(IAppManager appManager, IXCardsManager xCardsManager)
{
return;
appManager.RunOnUIThread(() =>
{
xCardsManager.Register(new AdCard());
});
}

private class AdCard : IXCard
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ class EAutumnBoxExtensionStore : LeafExtensionBase
[LMain]
public void EntryPoint()
{
Process.Start(URL_EXTENSION_STORE);
ProcessStartInfo psi = new ProcessStartInfo
{
FileName = URL_EXTENSION_STORE,
UseShellExecute = true
};
Process.Start(psi);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ class EAutumnBoxGuideViewer : LeafExtensionBase
[LMain]
public void EntryPoint(string path = "")
{
Process.Start(Path.Combine(URL_GUIDE, path));
ProcessStartInfo psi = new ProcessStartInfo
{
FileName = Path.Combine(URL_GUIDE, path),
UseShellExecute = true
};
Process.Start(psi);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,16 @@
<NoWarn>
</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Canary|AnyCPU'">
<OutputPath>bin\Canary\</OutputPath>
<DefineConstants>TRACE;NT45 USE_NT_JSON</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<LangVersion>8.0</LangVersion>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
Expand Down
Loading

0 comments on commit 9244c96

Please sign in to comment.