Skip to content

Commit

Permalink
feat: 插件源打包脚本
Browse files Browse the repository at this point in the history
  • Loading branch information
HelloWRC committed Aug 1, 2024
1 parent e99c588 commit bfe1ec0
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
out/*
1 change: 1 addition & 0 deletions base.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
8 changes: 8 additions & 0 deletions index/classisland.example.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
id: classisland.example
name: 示例插件
description: 插件描述
entranceAssembly: "ClassIsland.ExamplePlugin.dll"
url: https://github.com/ClassIsland/ClassIsland
repoOwner: ClassIsland
repoName: ExamplePlugins
assetsRoot: master/HelloWorldPlugin
29 changes: 29 additions & 0 deletions tools/generate-index.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
param($inputPath,$outputPath,$basePath,$customClassIslandPath)

function Wait-Task {
param(
[Parameter(Mandatory, ValueFromPipeline)]
[System.Threading.Tasks.Task[]]$Task
)

Begin {
$Tasks = @()
}

Process {
$Tasks += $Task
}

End {
While (-not [System.Threading.Tasks.Task]::WaitAll($Tasks, 200)) {}
$Tasks.ForEach( { $_.GetAwaiter().GetResult() })
}
}

Set-Alias -Name await -Value Wait-Task -Force

# TODO: 从 AppVeyor 下载 ClassIsland 实例

Import-Module $customClassIslandPath

await ([ClassIsland.Core.Helpers.PluginMarketHelper]::GeneratePluginIndexFromManifests($inputPath, $outputPath, $basePath))

0 comments on commit bfe1ec0

Please sign in to comment.