Skip to content

Commit

Permalink
release v0.2.3🎉🎉
Browse files Browse the repository at this point in the history
  • Loading branch information
aooohan committed Feb 5, 2024
1 parent 32421d1 commit a8411bb
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
17 changes: 13 additions & 4 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -328,25 +328,31 @@ OS_TYPE = ""
ARCH_TYPE = ""
PLUGIN = {
--- 插件名称
--- 插件名称, 即sdk名称
name = "java",
--- 插件作者
author = "Lihan",
--- 插件版本
version = "0.0.1",
--- 插件描述
description = "xxx",
-- 升级地址
updateUrl = "{URL}/sdk.lua",
-- 最先运行时的版本 >=
minRuntimeVersion = "0.2.2",
}
--- 根据ctx.version来返回对应版本的信息,包括版本、下载地址等
--- @param ctx table
--- @field ctx.version string 用户输入的版本号
--- @return table 版本信息
function PLUGIN:PreInstall(ctx)
local runtimeVersion = ctx.runtimeVersion
local version = ctx.version
return {
--- 版本号
--- 版本号 必填
version = "xxx",
--- 下载地址
--- 下载地址 [选填]
url = "xxx",
}
end
Expand All @@ -356,6 +362,7 @@ end
function PLUGIN:PostInstall(ctx)
--- ctx.rootPath SDK安装目录
local rootPath = ctx.rootPath
local runtimeVersion = ctx.runtimeVersion
local sdkInfo = ctx.sdkInfo['sdk-name']
local path = sdkInfo.path
local version = sdkInfo.version
Expand All @@ -378,6 +385,7 @@ end
--- }
--- }
function PLUGIN:Available(ctx)
local runtimeVersion = ctx.runtimeVersion
return {
{
version = "xxxx",
Expand All @@ -397,7 +405,8 @@ end
--- @param ctx table 上下文信息
--- @field ctx.version_path string SDK安装目录
function PLUGIN:EnvKeys(ctx)
local mainPath = ctx.version_path
local mainPath = ctx.path
local runtimeVersion = ctx.runtimeVersion
return {
{
key = "JAVA_HOME",
Expand Down
5 changes: 5 additions & 0 deletions template.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ PLUGIN = {
--- @field ctx.version string User-input version
--- @return table Version information
function PLUGIN:PreInstall(ctx)
local version = ctx.version
local runtimeVersion = ctx.runtimeVersion
return {
--- Version number
version = "xxx",
Expand Down Expand Up @@ -70,6 +72,7 @@ end
function PLUGIN:PostInstall(ctx)
--- ctx.rootPath SDK installation directory
local rootPath = ctx.rootPath
local runtimeVersion = ctx.runtimeVersion
local sdkInfo = ctx.sdkInfo['sdk-name']
local path = sdkInfo.path
local version = sdkInfo.version
Expand All @@ -80,6 +83,7 @@ end
--- @param ctx table Empty table used as context, for future extension
--- @return table Descriptions of available versions and accompanying tool descriptions
function PLUGIN:Available(ctx)
local runtimeVersion = ctx.runtimeVersion
return {
{
version = "xxxx",
Expand All @@ -102,6 +106,7 @@ end
function PLUGIN:EnvKeys(ctx)
--- this variable is same as ctx.sdkInfo['plugin-name'].path
local mainPath = ctx.path
local runtimeVersion = ctx.runtimeVersion
local sdkInfo = ctx.sdkInfo['sdk-name']
local path = sdkInfo.path
local version = sdkInfo.version
Expand Down

0 comments on commit a8411bb

Please sign in to comment.