Change to onedev

This commit is contained in:
2025-01-08 12:27:52 -06:00
parent df895846dc
commit fa4f24f74e
47 changed files with 635 additions and 0 deletions

34
.onedev-buildspec.yml Normal file
View File

@@ -0,0 +1,34 @@
version: 38
jobs:
- name: Build for x86_64
steps:
- !CheckoutStep
name: Checkout
cloneCredential: !DefaultCredential {}
withLfs: true
withSubmodules: true
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
- !BuildImageStep
name: Build docker image
output: !RegistryOutput
tags: onedev.site.tesses.net/crosslang/crosslangextras/crosslangextras:latest
registryLogins:
- registryUrl: '@server_url@'
userName: '@job_token@'
passwordSecret: dockersecret
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
triggers:
- !DependencyFinishedTrigger
projects: crosslang
- !BranchUpdateTrigger
branches: master
projects: crosslang/crosslangextras
projectDependencies:
- projectPath: crosslang
buildProvider: !LastFinishedBuild
jobName: Build for x86_64
artifacts: -**
retryCondition: never
maxRetries: 3
retryDelay: 30
timeout: 14400

3
Dockerfile Normal file
View File

@@ -0,0 +1,3 @@
FROM onedev.site.tesses.net/crosslang/crosslang:latest
RUN mkdir /src && cd /src && git clone https://onedev.site.tesses.net/crosslang/crosslangextras . && bash ./install.sh && cp Tesses.CrossLang.ShellPackage-1.0.0.0-prod.crvm /root/Tesses.CrossLang.ShellPackage-1.0.0.0-prod.crvm && cd / && rm -r /src

View File

@@ -0,0 +1,2 @@
bin
obj

View File

@@ -0,0 +1,16 @@
{
"name": "Tesses.CrossLang.Template.CompileTool",
"version": "1.0.0.0-prod",
"info": {
"maintainer": "Mike Nolan",
"type": "template",
"repo": "https://onedev.site.tesses.net/CrossLang/CrossLangExtras",
"homepage": "https://crosslang.tesseslanguage.com/",
"license": "MIT",
"template_name": "compiletool",
"template_info": {
"type": "compile_tool"
},
"template_ignored_files": ["bin","obj"]
}
}

View File

@@ -0,0 +1,11 @@
func RunTool(cfg)
{
//cfg.Project is the project Subdirfilesystem
//cfg.ProjectInfo is the info property parsed from the cross.json file in project root
cfg.GeneratedSource.Add({
Source = "func times(a,b){return a * b;}",
FileName = "times.tcross"
});
//this runs with full access to vm so be careful when allowing these
}

View File

@@ -0,0 +1,2 @@
bin
obj

View File

@@ -0,0 +1,16 @@
{
"name": "Tesses.CrossLang.Template.Console",
"version": "1.0.0.0-prod",
"info": {
"maintainer": "Mike Nolan",
"type": "template",
"repo": "https://onedev.site.tesses.net/CrossLang/CrossLangExtras",
"homepage": "https://crosslang.tesseslanguage.com/",
"license": "MIT",
"template_name": "console",
"template_info": {
"type": "console"
},
"template_ignored_files": ["bin","obj"]
}
}

View File

@@ -0,0 +1,4 @@
func main(args)
{
Console.WriteLine("Hello, world my name is: %PROJECT_NAME%");
}

View File

@@ -0,0 +1,2 @@
bin
obj

16
Templates/lib/cross.json Normal file
View File

@@ -0,0 +1,16 @@
{
"name": "Tesses.CrossLang.Template.Library",
"version": "1.0.0.0-prod",
"info": {
"maintainer": "Mike Nolan",
"type": "template",
"repo": "https://onedev.site.tesses.net/CrossLang/CrossLangExtras",
"homepage": "https://crosslang.tesseslanguage.com/",
"license": "MIT",
"template_name": "lib",
"template_info": {
"type": "lib"
},
"template_ignored_files": ["bin","obj"]
}
}

View File

@@ -0,0 +1,5 @@
/^ Multiply two numbers ^/
func MyLib.Times(a,b)
{
return a * b;
}

View File

@@ -0,0 +1,2 @@
bin
obj

View File

@@ -0,0 +1,25 @@
{
"name": "Tesses.CrossLang.Template.Template",
"version": "1.0.0.0-prod",
"info": {
"maintainer": "Mike Nolan",
"type": "template",
"repo": "https://onedev.site.tesses.net/CrossLang/CrossLangExtras",
"homepage": "https://crosslang.tesseslanguage.com/",
"license": "MIT",
"template_name": "template",
"template_info": {
"type": "template",
"template_name": "mytemplate",
"template_project_dependencies": [],
"template_extra_text_ftles": [],
"template_info": {
"type": "console"
},
"template_ignored_files": ["bin","obj"]
},
"template_project_dependencies": [],
"template_extra_text_ftles": [],
"template_ignored_files": ["bin","obj"]
}
}

View File

@@ -0,0 +1,4 @@
func main(args)
{
//USE the string %TEMPLATE_PROJECT_NAME% anywhere you want to replace with the project name
}

View File

@@ -0,0 +1,2 @@
bin
obj

View File

@@ -0,0 +1,3 @@
<?component() name="Counter" ?>
<p>Count is <?expr count++ ?></p>
<?end?>

View File

@@ -0,0 +1,36 @@
<?resource name="simple.min.css" route="/css/simple.min.css" ?>
<?resource name="favicon.ico" route="/favicon.ico" ?>
<?component(title,pages,body) name="Shell" ?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>%PROJECT_NAME% - <?expr Net.Http.HtmlEncode(title) ?></title>
<link rel="stylesheet" href="./css/simple.min.css">
</head>
<body>
<header>
<h1>%PROJECT_NAME%</h1>
<nav>
<ul>
<?code
each(var item : pages)
{
?>
<li><a <?code if(item.active) { ?> aria-current="page" <?code } ?> href="<?expr Net.Http.UrlPathEncode(item.route) ?>"><?expr Net.Http.HtmlEncode(item.text) ?></a></li>
<?code
}
?>
</ul>
</nav>
</header>
<h1><?expr Net.Http.HtmlEncode(title) ?></h1>
<?body?>
<?end?>
<footer>
<p>Created using <a href="https://crosslang.tesseslanguage.com/">CrossLang</a> and <a href="https://simplecss.org/">SimpleCSS</a></p>
</footer>
</body>
</html>
<?end?>

23
Templates/web/cross.json Normal file
View File

@@ -0,0 +1,23 @@
{
"name": "Tesses.CrossLang.Template.Website",
"version": "1.0.0.0-prod",
"info": {
"maintainer": "Mike Nolan",
"type": "template",
"repo": "https://onedev.site.tesses.net/CrossLang/CrossLangExtras",
"homepage": "https://crosslang.tesseslanguage.com/",
"license": "MIT",
"template_name": "web",
"template_info": {
"type": "console"
},
"template_project_dependencies": [
{
"name": "Tesses.CrossLang.Markup",
"version": "1.0.0.0-prod"
}
],
"template_extra_text_ftles": ["/components/shell.tcrml"],
"template_ignored_files": ["bin","obj"]
}
}

View File

@@ -0,0 +1,28 @@
<?page() route="/about" ?>
<?code
var pages = [
{
active = false,
route = "/",
text = "Home"
},
{
active = false,
route = "/counter",
text = "Counter"
},
{
active = true,
route = "/about",
text = "About"
}
];
?>
<?Shell?>
<?arg "About Me" ?>
<?arg pages ?>
<?arg_component() ?>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Laboriosam possimus nisi ab nobis magni, error minus vero neque iusto beatae, quasi nostrum. Ut repudiandae expedita reprehenderit tenetur. Sunt, adipisci cumque!</p>
<?end?>
<?end?>
<?end?>

View File

@@ -0,0 +1,29 @@
<?page() route="/counter" ?>
<?code
var pages = [
{
active = false,
route = "/",
text = "Home"
},
{
active = true,
route = "/counter",
text = "Counter"
},
{
active = false,
route = "/about",
text = "About"
}
];
?>
<?Shell?>
<?arg "Counter" ?>
<?arg pages ?>
<?arg_component() ?>
<?Counter ?>
<?end?>
<?end?>
<?end?>
<?end?>

View File

@@ -0,0 +1,28 @@
<?page() route="/" ?>
<?code
var pages = [
{
active = true,
route = "/",
text = "Home"
},
{
active = false,
route = "/counter",
text = "Counter"
},
{
active = false,
route = "/about",
text = "About"
}
];
?>
<?Shell?>
<?arg "Main Page" ?>
<?arg pages ?>
<?arg_component() ?>
<p>1 John 4:4: You, dear children, are from God and have overcome them, because the one who is in you is greater than the one who is in the world.</p>
<?end?>
<?end?>
<?end?>

BIN
Templates/web/res/favicon.ico Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

1
Templates/web/res/simple.min.css vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,5 @@
var count = 0;
func main(args)
{
Net.Http.ListenSimpleWithLoop(Router,4206);
}

View File

@@ -0,0 +1,3 @@
<?component() name="Counter" ?>
<p>Count is <?expr count++ ?></p>
<?end?>

View File

@@ -0,0 +1,36 @@
<?resource name="simple.min.css" route="/css/simple.min.css" ?>
<?resource name="favicon.ico" route="/favicon.ico" ?>
<?component(title,pages,body) name="Shell" ?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My Greater Website - <?expr Net.Http.HtmlEncode(title) ?></title>
<link rel="stylesheet" href="./css/simple.min.css">
</head>
<body>
<header>
<h1>My Greater Website</h1>
<nav>
<ul>
<?code
each(var item : pages)
{
?>
<li><a <?code if(item.active) { ?> aria-current="page" <?code } ?> href="<?expr Net.Http.UrlPathEncode(item.route) ?>"><?expr Net.Http.HtmlEncode(item.text) ?></a></li>
<?code
}
?>
</ul>
</nav>
</header>
<h1><?expr Net.Http.HtmlEncode(title) ?></h1>
<?body?>
<?end?>
<footer>
<p>Created using <a href="https://crosslang.tesseslanguage.com/">CrossLang</a> and <a href="https://simplecss.org/">SimpleCSS</a></p>
</footer>
</body>
</html>
<?end?>

View File

@@ -0,0 +1,10 @@
{
"name": "Tesses.CrossLang.ExampleSite",
"version": "1.0.0.0-prod",
"project_dependencies": [
"../Tesses.CrossLang.Markup"
],
"info": {
"type": "console"
}
}

View File

@@ -0,0 +1,28 @@
<?page() route="/about" ?>
<?code
var pages = [
{
active = false,
route = "/",
text = "Home"
},
{
active = false,
route = "/counter",
text = "Counter"
},
{
active = true,
route = "/about",
text = "About"
}
];
?>
<?Shell?>
<?arg "About Me" ?>
<?arg pages ?>
<?arg_component() ?>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Laboriosam possimus nisi ab nobis magni, error minus vero neque iusto beatae, quasi nostrum. Ut repudiandae expedita reprehenderit tenetur. Sunt, adipisci cumque!</p>
<?end?>
<?end?>
<?end?>

View File

@@ -0,0 +1,29 @@
<?page() route="/counter" ?>
<?code
var pages = [
{
active = false,
route = "/",
text = "Home"
},
{
active = true,
route = "/counter",
text = "Counter"
},
{
active = false,
route = "/about",
text = "About"
}
];
?>
<?Shell?>
<?arg "Counter" ?>
<?arg pages ?>
<?arg_component() ?>
<?Counter ?>
<?end?>
<?end?>
<?end?>
<?end?>

View File

@@ -0,0 +1,28 @@
<?page() route="/" ?>
<?code
var pages = [
{
active = true,
route = "/",
text = "Home"
},
{
active = false,
route = "/counter",
text = "Counter"
},
{
active = false,
route = "/about",
text = "About"
}
];
?>
<?Shell?>
<?arg "Main Page" ?>
<?arg pages ?>
<?arg_component() ?>
<p>1 John 4:4: You, dear children, are from God and have overcome them, because the one who is in you is greater than the one who is in the world.</p>
<?end?>
<?end?>
<?end?>

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,5 @@
var count = 0;
func main(args)
{
Net.Http.ListenSimpleWithLoop(Router,4206);
}

View File

@@ -0,0 +1,3 @@
<?component() name="Counter" ?>
<p>Count is <?expr count++ ?></p>
<?end?>

View File

@@ -0,0 +1,36 @@
<?resource name="simple.min.css" route="/css/simple.min.css" ?>
<?resource name="favicon.ico" route="/favicon.ico" ?>
<?component(title,pages,body) name="Shell" ?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Tesses.CrossLang.PackageServer - <?expr Net.Http.HtmlEncode(title) ?></title>
<link rel="stylesheet" href="./css/simple.min.css">
</head>
<body>
<header>
<h1>Tesses.CrossLang.PackageServer</h1>
<nav>
<ul>
<?code
each(var item : pages)
{
?>
<li><a <?code if(item.active) { ?> aria-current="page" <?code } ?> href="<?expr Net.Http.UrlPathEncode(item.route) ?>"><?expr Net.Http.HtmlEncode(item.text) ?></a></li>
<?code
}
?>
</ul>
</nav>
</header>
<h1><?expr Net.Http.HtmlEncode(title) ?></h1>
<?body?>
<?end?>
<footer>
<p>Created using <a href="https://crosslang.tesseslanguage.com/">CrossLang</a> and <a href="https://simplecss.org/">SimpleCSS</a></p>
</footer>
</body>
</html>
<?end?>

View File

@@ -0,0 +1,28 @@
<?page() route="/about" ?>
<?code
var pages = [
{
active = false,
route = "/",
text = "Home"
},
{
active = false,
route = "/counter",
text = "Counter"
},
{
active = true,
route = "/about",
text = "About"
}
];
?>
<?Shell?>
<?arg "About Me" ?>
<?arg pages ?>
<?arg_component() ?>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Laboriosam possimus nisi ab nobis magni, error minus vero neque iusto beatae, quasi nostrum. Ut repudiandae expedita reprehenderit tenetur. Sunt, adipisci cumque!</p>
<?end?>
<?end?>
<?end?>

View File

@@ -0,0 +1,29 @@
<?page() route="/counter" ?>
<?code
var pages = [
{
active = false,
route = "/",
text = "Home"
},
{
active = true,
route = "/counter",
text = "Counter"
},
{
active = false,
route = "/about",
text = "About"
}
];
?>
<?Shell?>
<?arg "Counter" ?>
<?arg pages ?>
<?arg_component() ?>
<?Counter ?>
<?end?>
<?end?>
<?end?>
<?end?>

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,7 @@
{
"info": {
"type": "console"
},
"version": "1.0.0.0-prod",
"name": "Tesses.CrossLang.RpcServer"
}

View File

@@ -0,0 +1,4 @@
func main(args)
{
Net.Http.ListenSimpleWithLoop(Router,4206);
}

View File

@@ -0,0 +1,7 @@
{
"info": {
"type": "console"
},
"version": "1.0.0.0-prod",
"name": "crosslang_shell_archive_maker"
}

View File

@@ -0,0 +1,80 @@
var name = "Tesses.CrossLang.ShellPackage-1.0.0.0-prod.crvm";
func main(args)
{
create_archive();
if(args.Count > 1 && args[1] == "install")
{
install();
}
}
func install()
{
var d = FS.MakeFull(Env.Config) / "Tesses" / "CrossLang";
FS.Local.CreateDirectory(d);
var sdfs = FS.SubdirFilesystem(FS.Local, d);
var strm = FS.Local.OpenFile(name,"rb");
FS.ExtractArchive(strm, sdfs);
sdfs.Close();
strm.Close();
}
func create_archive()
{
var tmpFS = FS.SubdirFilesystem(FS.Local,"crosslang_shell_archive_maker/tmp");
func copyFile(src,dest)
{
if(!FS.Local.FileExists(src)) return;
var srcF = FS.Local.OpenFile(src,"rb");
var destF = tmpFS.OpenFile(dest,"wb");
srcF.CopyTo(destF);
srcF.Close();
destF.Close();
}
var r = Path.Root();
var shell = r / "Shell";
tmpFS.CreateDirectory(shell);
copyFile("Tesses.CrossLang.Shell/bin/Tesses.CrossLang.Args-1.0.0.0-prod.crvm", shell / "Tesses.CrossLang.Args-1.0.0.0-prod.crvm");
copyFile("Tesses.CrossLang.Shell/bin/Tesses.CrossLang.BuildEssentials-1.0.0.0-prod.crvm", shell / "Tesses.CrossLang.BuildEssentials-1.0.0.0-prod.crvm");
copyFile("Tesses.CrossLang.Shell/bin/Tesses.CrossLang.Shell-1.0.0.0-prod.crvm", shell / "Shell.crvm");
var templates = r / "Templates";
tmpFS.CreateDirectory(templates);
copyFile("Templates/compiletool/bin/Tesses.CrossLang.Template.CompileTool-1.0.0.0-prod.crvm", templates / "compiletool.crvm");
copyFile("Templates/console/bin/Tesses.CrossLang.Template.Console-1.0.0.0-prod.crvm", templates / "console.crvm");
copyFile("Templates/lib/bin/Tesses.CrossLang.Template.Library-1.0.0.0-prod.crvm", templates / "lib.crvm");
copyFile("Templates/template/bin/Tesses.CrossLang.Template.Template-1.0.0.0-prod.crvm", templates / "template.crvm");
copyFile("Templates/web/bin/Tesses.CrossLang.Template.Website-1.0.0.0-prod.crvm", templates / "web.crvm");
var packageCache = r / "PackageCache";
tmpFS.CreateDirectory(packageCache);
tmpFS.CreateDirectory(packageCache / "Tesses.CrossLang.Args");
tmpFS.CreateDirectory(packageCache / "Tesses.CrossLang.BuildEssentials");
tmpFS.CreateDirectory(packageCache / "Tesses.CrossLang.Markup");
copyFile("Tesses.CrossLang.Args/bin/Tesses.CrossLang.Args-1.0.0.0-prod.crvm", packageCache / "Tesses.CrossLang.Args" / "1.0.0.0-prod");
copyFile("Tesses.CrossLang.BuildEssentials/bin/Tesses.CrossLang.BuildEssentials-1.0.0.0-prod.crvm", packageCache / "Tesses.CrossLang.BuildEssentials" / "1.0.0.0-prod");
copyFile("Tesses.CrossLang.Markup/bin/Tesses.CrossLang.Markup-1.0.0.0-prod.crvm", packageCache / "Tesses.CrossLang.Markup" / "1.0.0.0-prod");
var installer = FS.Local.OpenFile(name, "wb");
var ifo = {
type = "archive",
maintainer = "Mike Nolan",
repo = "https://onedev.site.tesses.net/CrossLang/CrossLangExtras",
homepage = "https://crosslang.tesseslanguage.com/"
};
FS.CreateArchive(tmpFS,installer, "Tesses.CrossLang.ShellPackage","1.0.0.0-prod", Json.Encode(ifo));
installer.Close();
tmpFS.Close();
FS.Local.DeleteDirectroyRecurse("crosslang_shell_archive_maker/tmp");
}

3
pack.sh Normal file
View File

@@ -0,0 +1,3 @@
#!/bin/bash
bash ./script.sh
crossvm crosslang_shell_archive_maker/bin/crosslang_shell_archive_maker-1.0.0.0-prod.crvm