-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathPlatformPublish.ps1
More file actions
155 lines (128 loc) · 4.83 KB
/
Copy pathPlatformPublish.ps1
File metadata and controls
155 lines (128 loc) · 4.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
[CmdletBinding()]
param(
[switch]$Silent,
[string]$Configuration = "Debug",
[string]$PlatformRoot = "artifacts\rdcore-dev"
)
$ErrorActionPreference = "Stop"
Write-Host "
-+-+--++--
--+----+----------
++-----+- +--+----+
----- +------
----- ---- -------------
+--- ----- +-----------+
---- +--+ ----++ +-----
+-+ ---- ----- --+----
------+ ---- -----------
--------++ ---+- -----+-™
---+ -+-------- ----- +--
+--+ ----------+------+ +---+
----+ +--+-----+--+ +----+
---- -----
---+ ---+-
---- -----
+---+ +---
---- ----
-... .--.
====================================================
V I V A T ❤️ C U C U M I S ™
====================================================
"
Write-Host "RDCore Platform Local Publish Script"
Write-Host "©2026 Copyright 9562-7303 Québec inc."
Write-Host ""
$RepoRoot = Resolve-Path $PSScriptRoot
$StagingRoot = Join-Path $RepoRoot "artifacts\staging"
$PlatformRoot = Join-Path $RepoRoot "artifacts\rdcore-dev"
Write-Host "Validate paths:"
Write-Host "📁 Staging: " $StagingRoot
Write-Host "📁 Platform:" $PlatformRoot
if (-not $Silent) {
$Confirmation = Read-Host "(Y/y)es to proceed: "
if ($Confirmation -ne "Y"){
throw "Operation was cancelled by the user."
}
}
Write-Host "✅ User confirmation cleared."
$Projects = @(
@{
Name = "RDCore.CLI"
Project = "RDCore.CLI\RDCore.CLI.csproj"
},
@{
Name = "RDCore.LanguageServer"
Project = "RDCore.LanguageServer\RDCore.LanguageServer.csproj"
},
@{
Name = "RDCore.Parsing"
Project = "RDCore.Parsing\RDCore.Parsing.csproj"
},
@{
Name = "Extensions\RDCore.Diagnostics"
Project = "RDCore.Diagnostics\RDCore.Diagnostics.csproj"
}
)
Write-Host ""
Write-Host "Cleaning previous outputs..."
Remove-Item $StagingRoot -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item $PlatformRoot -Recurse -Force -ErrorAction SilentlyContinue
New-Item $StagingRoot -ItemType Directory -Force | Out-Null
New-Item $PlatformRoot -ItemType Directory -Force | Out-Null
Write-Host "✅ Done."
Write-Host ""
Write-Host "Publishing projects..."
Write-Host ""
foreach ($project in $Projects)
{
$publishPath = Join-Path $StagingRoot $project.Name
$projPath = Join-Path $RepoRoot $project.Project
New-Item $publishPath -ItemType Directory -Force | Out-Null
dotnet publish $projPath --configuration $Configuration --output $publishPath
if ($LASTEXITCODE -ne 0)
{
throw "Publish failed for $($project.Name)"
}
Write-Host "🚀 $($project.Name) was published successfully."
}
Write-Host ""
Write-Host "🧩 Assembling platform..."
Write-Host ""
$PlatformFolders = @(
"Config",
"Extensions",
"Logs"
)
foreach ($folder in $PlatformFolders)
{
New-Item `
(Join-Path $PlatformRoot $folder) `
-ItemType Directory `
-Force | Out-Null
}
foreach ($project in $Projects)
{
$source = Join-Path $StagingRoot $project.Name
$target = Join-Path $PlatformRoot $project.Name
Write-Host "$source 👉 $target"
New-Item $target -ItemType "directory"
Copy-Item -Path "$source\*" -Destination "$target\" -Recurse
}
$Manifest = @{
platformVersion = "0.1"
generatedUtc = (Get-Date).ToUniversalTime().ToString("O")
hostService = "RDCore.CLI/rdc.exe"
langService = "RDCore.LanguageServer/RDCore.LanguageServer.exe"
parseServer = "RDCore.Parsing/RDCore.ParseServer.exe"
extensionsDirectory = "Extensions"
} | ConvertTo-Json -Depth 10
$ManifestPath = Join-Path $PlatformRoot "rdcore.json"
$Manifest | Set-Content $ManifestPath -Encoding UTF8
Write-Host ""
Write-Host "Platform root assembled:"
Write-Host " $PlatformRoot"
Write-Host ""
Write-Host "Manifest:"
Write-Host " $ManifestPath"
Write-Host ""
Write-Host "✅ Done."