Skip to content

Commit c038605

Browse files
committed
update script
1 parent d6c35fa commit c038605

File tree

6 files changed

+466
-5
lines changed

6 files changed

+466
-5
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ bin/
22
obj/
33
/packages/
44
riderModule.iml
5-
/_ReSharper.Caches/
5+
/_ReSharper.Caches/
6+
artifacts/

CHANGELOG.md

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]
9+
10+
### Added
11+
- Pending features to be released
12+
13+
### Changed
14+
- Pending changes
15+
16+
### Fixed
17+
- Pending fixes
18+
19+
## [0.9.0] - 2025-10-29
20+
21+
### Added
22+
- ✨ Full LSP 3.18 specification support
23+
- 🚀 AOT (Ahead-of-Time) compilation support
24+
- 📦 Zero dependencies (no Newtonsoft.Json)
25+
- 🪟 Window messages support (ShowMessage, LogMessage, ShowMessageRequest)
26+
- 📊 Work Done Progress reporting
27+
- 📡 Telemetry events
28+
- ⚡ Performance metrics collection
29+
- 🔧 System.Text.Json source generation
30+
- 📝 Complete XML documentation
31+
- 🧪 Comprehensive test suite
32+
- 🔄 GitHub Actions CI/CD workflows
33+
- 📚 Extensive documentation
34+
35+
### Protocol Support
36+
- Text Document Synchronization
37+
- Completion (with resolve)
38+
- Hover
39+
- Signature Help
40+
- Go to Definition/Declaration/Implementation
41+
- Find References
42+
- Document Symbols
43+
- Workspace Symbols
44+
- Code Actions
45+
- Code Lens
46+
- Document Formatting/Range Formatting
47+
- Document Highlights
48+
- Rename
49+
- Folding Ranges
50+
- Selection Ranges
51+
- Semantic Tokens
52+
- Inlay Hints
53+
- Document Links
54+
- Document Colors
55+
- Call Hierarchy
56+
- Type Hierarchy
57+
58+
### Infrastructure
59+
- Multi-platform CI (Ubuntu, Windows, macOS)
60+
- Multi-version support (.NET 8.0, .NET 9.0)
61+
- Code coverage reporting
62+
- Dependency security scanning
63+
- Modern C# code style rules
64+
- EditorConfig configuration
65+
66+
## Release Notes Format
67+
68+
### Types of Changes
69+
- `Added` for new features
70+
- `Changed` for changes in existing functionality
71+
- `Deprecated` for soon-to-be removed features
72+
- `Removed` for now removed features
73+
- `Fixed` for any bug fixes
74+
- `Security` for vulnerability fixes
75+
76+
### Example Entry
77+
```markdown
78+
## [1.0.0] - 2025-11-01
79+
80+
### Added
81+
- New feature description
82+
83+
### Fixed
84+
- Bug fix description (#issue-number)
85+
```
86+
87+
---
88+
89+
[Unreleased]: https://github.com/CppCXY/LanguageServer.Framework/compare/v0.9.0...HEAD
90+
[0.9.0]: https://github.com/CppCXY/LanguageServer.Framework/releases/tag/v0.9.0

LanguageServer.Framework/LanguageServer.Framework.csproj

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,48 @@
66
<Nullable>enable</Nullable>
77
<RootNamespace>EmmyLua.LanguageServer.Framework</RootNamespace>
88
<JsonSerializerIsReflectionEnabledByDefault>false</JsonSerializerIsReflectionEnabledByDefault>
9+
10+
<!-- Package Information -->
911
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
1012
<PackageId>EmmyLua.LanguageServer.Framework</PackageId>
1113
<Version>0.9.0</Version>
12-
<Title>EmmyLua.LanguageServer.Framework</Title>
14+
<Title>Language Server Framework</Title>
1315
<Authors>CppCXY</Authors>
14-
<Description>language server framework, support lsp3.18 and dotnet aot compilation</Description>
15-
<Copyright>CppCXY</Copyright>
16+
<Description>A modern, high-performance .NET framework for building Language Server Protocol (LSP) servers with full LSP 3.18 specification support. Features zero dependencies, AOT compilation support, and built-in performance metrics.</Description>
17+
<Copyright>Copyright (c) CppCXY</Copyright>
1618
<PackageProjectUrl>https://github.com/CppCXY/LanguageServer.Framework</PackageProjectUrl>
1719
<PackageLicenseExpression>MIT</PackageLicenseExpression>
20+
<PackageReadmeFile>README.md</PackageReadmeFile>
21+
<!-- <PackageIcon>icon.png</PackageIcon> -->
1822
<RepositoryUrl>https://github.com/CppCXY/LanguageServer.Framework</RepositoryUrl>
19-
<PackageTags>lsp,aot</PackageTags>
23+
<RepositoryType>git</RepositoryType>
24+
<PackageTags>lsp;language-server-protocol;aot;dotnet;csharp;language-server;compiler;editor</PackageTags>
25+
<PackageReleaseNotes>See https://github.com/CppCXY/LanguageServer.Framework/releases</PackageReleaseNotes>
26+
27+
<!-- Documentation -->
2028
<GenerateDocumentationFile>true</GenerateDocumentationFile>
2129
<DocumentationFile>bin\$(Configuration)\$(AssemblyName).xml</DocumentationFile>
2230
<NoWarn>$(NoWarn);1591</NoWarn>
2331
<NoWarn>$(NoWarn);1570</NoWarn>
32+
33+
<!-- Source Link - Enable debugging into the package -->
34+
<PublishRepositoryUrl>true</PublishRepositoryUrl>
35+
<EmbedUntrackedSources>true</EmbedUntrackedSources>
36+
<IncludeSymbols>true</IncludeSymbols>
37+
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
2438
</PropertyGroup>
2539

2640
<ItemGroup>
41+
<!-- Include README in package -->
42+
<None Include="..\README.md" Pack="true" PackagePath="\"/>
43+
<!-- Include icon if exists (uncomment when you add icon.png) -->
44+
<!-- <None Include="..\icon.png" Pack="true" PackagePath="\"/> -->
45+
<!-- Include XML documentation -->
2746
<None Include="$(OutputPath)$(AssemblyName).xml" Pack="true" PackagePath="lib\$(TargetFramework)"/>
2847
</ItemGroup>
48+
49+
<ItemGroup>
50+
<!-- Source Link for debugging -->
51+
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All"/>
52+
</ItemGroup>
2953
</Project>

build-and-publish.ps1

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# Quick Build and Publish Script
2+
# This is a convenience script that combines building, testing, and publishing
3+
4+
param(
5+
[Parameter(Mandatory=$true)]
6+
[string]$Version,
7+
8+
[Parameter(Mandatory=$false)]
9+
[string]$ApiKey = "",
10+
11+
[switch]$SkipTests = $false,
12+
[switch]$SkipPublish = $false,
13+
[switch]$CreateTag = $false
14+
)
15+
16+
Write-Host "========================================" -ForegroundColor Cyan
17+
Write-Host " Quick Build and Publish - v$Version" -ForegroundColor Cyan
18+
Write-Host "========================================" -ForegroundColor Cyan
19+
Write-Host ""
20+
21+
# Step 1: Pack
22+
Write-Host "Step 1: Building and packing..." -ForegroundColor Yellow
23+
$packParams = @{
24+
Version = $Version
25+
SkipTests = $SkipTests
26+
}
27+
& .\pack.ps1 @packParams
28+
29+
if ($LASTEXITCODE -ne 0) {
30+
Write-Host "✗ Pack failed!" -ForegroundColor Red
31+
exit $LASTEXITCODE
32+
}
33+
34+
# Step 2: Publish (optional)
35+
if (-not $SkipPublish) {
36+
Write-Host ""
37+
Write-Host "Step 2: Publishing to NuGet..." -ForegroundColor Yellow
38+
39+
if (-not $ApiKey) {
40+
$ApiKey = $env:NUGET_API_KEY
41+
}
42+
43+
if (-not $ApiKey) {
44+
Write-Host "⚠ Warning: No API key provided, skipping publish" -ForegroundColor Yellow
45+
Write-Host " Use -ApiKey parameter or set NUGET_API_KEY environment variable" -ForegroundColor Gray
46+
} else {
47+
& .\publish.ps1 -ApiKey $ApiKey
48+
49+
if ($LASTEXITCODE -ne 0) {
50+
Write-Host "✗ Publish failed!" -ForegroundColor Red
51+
exit $LASTEXITCODE
52+
}
53+
}
54+
} else {
55+
Write-Host ""
56+
Write-Host "Skipping publish (use -SkipPublish:`$false to publish)" -ForegroundColor Gray
57+
}
58+
59+
# Step 3: Create Git Tag (optional)
60+
if ($CreateTag) {
61+
Write-Host ""
62+
Write-Host "Step 3: Creating Git tag..." -ForegroundColor Yellow
63+
64+
$tagName = "v$Version"
65+
git tag $tagName
66+
67+
if ($LASTEXITCODE -eq 0) {
68+
Write-Host "✓ Tag '$tagName' created" -ForegroundColor Green
69+
Write-Host " Push with: git push origin $tagName" -ForegroundColor Gray
70+
} else {
71+
Write-Host "⚠ Warning: Failed to create tag" -ForegroundColor Yellow
72+
}
73+
}
74+
75+
Write-Host ""
76+
Write-Host "========================================" -ForegroundColor Cyan
77+
Write-Host " All Done! ✓" -ForegroundColor Green
78+
Write-Host "========================================" -ForegroundColor Cyan
79+
Write-Host ""
80+
81+
if (-not $SkipPublish -and $ApiKey) {
82+
Write-Host "Package published successfully!" -ForegroundColor Green
83+
Write-Host "View at: https://www.nuget.org/packages/EmmyLua.LanguageServer.Framework/" -ForegroundColor Cyan
84+
} else {
85+
Write-Host "Package created in: .\artifacts\" -ForegroundColor Green
86+
Write-Host "To publish: .\publish.ps1 -ApiKey YOUR_KEY" -ForegroundColor Cyan
87+
}
88+
Write-Host ""

pack.ps1

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
# NuGet Package Build Script for Windows PowerShell
2+
# This script builds and packs the Language Server Framework for NuGet
3+
4+
param(
5+
[string]$Version = "",
6+
[switch]$SkipTests = $false,
7+
[switch]$Help = $false
8+
)
9+
10+
if ($Help) {
11+
Write-Host @"
12+
NuGet Package Build Script
13+
14+
Usage:
15+
.\pack.ps1 [-Version <version>] [-SkipTests] [-Help]
16+
17+
Parameters:
18+
-Version <version> : Specify package version (e.g., 1.0.0)
19+
-SkipTests : Skip running tests before packing
20+
-Help : Show this help message
21+
22+
Examples:
23+
.\pack.ps1
24+
.\pack.ps1 -Version 1.0.0
25+
.\pack.ps1 -Version 1.0.0 -SkipTests
26+
27+
"@
28+
exit 0
29+
}
30+
31+
Write-Host "========================================" -ForegroundColor Cyan
32+
Write-Host " Language Server Framework - Pack" -ForegroundColor Cyan
33+
Write-Host "========================================" -ForegroundColor Cyan
34+
Write-Host ""
35+
36+
# Clean previous artifacts
37+
Write-Host "[1/5] Cleaning previous artifacts..." -ForegroundColor Yellow
38+
if (Test-Path "artifacts") {
39+
Remove-Item -Recurse -Force "artifacts"
40+
}
41+
New-Item -ItemType Directory -Path "artifacts" | Out-Null
42+
Write-Host "✓ Cleaned" -ForegroundColor Green
43+
Write-Host ""
44+
45+
# Restore dependencies
46+
Write-Host "[2/5] Restoring dependencies..." -ForegroundColor Yellow
47+
dotnet restore
48+
if ($LASTEXITCODE -ne 0) {
49+
Write-Host "✗ Restore failed!" -ForegroundColor Red
50+
exit $LASTEXITCODE
51+
}
52+
Write-Host "✓ Restored" -ForegroundColor Green
53+
Write-Host ""
54+
55+
# Build
56+
Write-Host "[3/5] Building in Release mode..." -ForegroundColor Yellow
57+
dotnet build --configuration Release --no-restore
58+
if ($LASTEXITCODE -ne 0) {
59+
Write-Host "✗ Build failed!" -ForegroundColor Red
60+
exit $LASTEXITCODE
61+
}
62+
Write-Host "✓ Built" -ForegroundColor Green
63+
Write-Host ""
64+
65+
# Run tests (optional)
66+
if (-not $SkipTests) {
67+
Write-Host "[4/5] Running tests..." -ForegroundColor Yellow
68+
dotnet test --configuration Release --no-build --verbosity normal
69+
if ($LASTEXITCODE -ne 0) {
70+
Write-Host "✗ Tests failed!" -ForegroundColor Red
71+
exit $LASTEXITCODE
72+
}
73+
Write-Host "✓ Tests passed" -ForegroundColor Green
74+
} else {
75+
Write-Host "[4/5] Skipping tests..." -ForegroundColor Yellow
76+
}
77+
Write-Host ""
78+
79+
# Pack
80+
Write-Host "[5/5] Creating NuGet package..." -ForegroundColor Yellow
81+
$packArgs = @(
82+
"pack"
83+
"LanguageServer.Framework\LanguageServer.Framework.csproj"
84+
"--configuration", "Release"
85+
"--no-build"
86+
"--output", "artifacts"
87+
)
88+
89+
if ($Version) {
90+
$packArgs += "-p:PackageVersion=$Version"
91+
Write-Host "Using version: $Version" -ForegroundColor Cyan
92+
}
93+
94+
& dotnet $packArgs
95+
if ($LASTEXITCODE -ne 0) {
96+
Write-Host "✗ Pack failed!" -ForegroundColor Red
97+
exit $LASTEXITCODE
98+
}
99+
Write-Host "✓ Packed" -ForegroundColor Green
100+
Write-Host ""
101+
102+
# List created packages
103+
Write-Host "========================================" -ForegroundColor Cyan
104+
Write-Host " Package Created Successfully!" -ForegroundColor Green
105+
Write-Host "========================================" -ForegroundColor Cyan
106+
Write-Host ""
107+
Write-Host "Package location: .\artifacts\" -ForegroundColor Cyan
108+
Get-ChildItem -Path "artifacts" -Filter "*.nupkg" | ForEach-Object {
109+
Write-Host " - $($_.Name)" -ForegroundColor White
110+
Write-Host " Size: $([math]::Round($_.Length / 1KB, 2)) KB" -ForegroundColor Gray
111+
}
112+
Write-Host ""
113+
114+
# Show next steps
115+
Write-Host "Next steps:" -ForegroundColor Yellow
116+
Write-Host " 1. Test locally: dotnet nuget push .\artifacts\*.nupkg --source local-feed" -ForegroundColor White
117+
Write-Host " 2. Publish to NuGet: dotnet nuget push .\artifacts\*.nupkg --api-key YOUR_KEY --source https://api.nuget.org/v3/index.json" -ForegroundColor White
118+
Write-Host " 3. Or use GitHub Actions for automated publishing" -ForegroundColor White
119+
Write-Host ""

0 commit comments

Comments
 (0)