mirror of
https://onedev.site.tesses.net/crosslang/crosslangextras
synced 2026-02-08 09:05:46 +00:00
Add json listing for crosslang new
This commit is contained in:
@@ -196,6 +196,7 @@ func Tesses.CrossLang.BuildTool(pm)
|
||||
}
|
||||
else if(dep.Info.type == "compile_tool")
|
||||
{
|
||||
|
||||
file_tools.Add({
|
||||
Name = dep.Name,
|
||||
Version = dep.Version
|
||||
@@ -208,7 +209,7 @@ func Tesses.CrossLang.BuildTool(pm)
|
||||
{
|
||||
each(var file : FS.Local.EnumeratePaths(sourceDir))
|
||||
{
|
||||
if(FS.Local.RegularFileExists(file))
|
||||
if(FS.Local.RegularFileExists(file) && file.GetExtension()==".tcross")
|
||||
{
|
||||
var src = {
|
||||
FileName = file.ToString(),
|
||||
|
||||
@@ -16,4 +16,26 @@ func Tesses.CrossLang.GetNameAndDescription(name)
|
||||
name = TypeOf(j.toolname) == "String" ? j.toolname : name;
|
||||
|
||||
return $"{name}: {description}";
|
||||
}
|
||||
func Tesses.CrossLang.GetNameAndDescriptionJson(name)
|
||||
{
|
||||
var strm = FS.Local.OpenFile(name,"rb");
|
||||
var file = VM.LoadExecutable(strm);
|
||||
|
||||
strm.Close();
|
||||
|
||||
var name = file.Name;
|
||||
|
||||
var j = Json.Decode(file.Info);
|
||||
var description = TypeOf(j.description) == "String" ? j.description : "";
|
||||
|
||||
if(j.type == "template")
|
||||
name = TypeOf(j.template_name) == "String" ? j.template_name : name;
|
||||
else if(j.type == "tool")
|
||||
name = TypeOf(j.toolname) == "String" ? j.toolname : name;
|
||||
|
||||
return {
|
||||
name,
|
||||
description
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user