Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Summpot committed Oct 30, 2023
1 parent e27e60d commit f2e1bf4
Show file tree
Hide file tree
Showing 12 changed files with 46 additions and 353 deletions.
1 change: 0 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ jobs:
run: |
Get-ChildItem ./nupkgs -Filter *.nupkg | %{ dotnet nuget push $_.FullName -k ${{secrets.NUGET_API_KEY}} }
shell: pwsh


- name: Upload build artifacts
uses: actions/upload-artifact@v3
Expand Down
39 changes: 0 additions & 39 deletions src/NativeLibrary/tree-sitter-c/runtime.json

This file was deleted.

40 changes: 9 additions & 31 deletions src/NativeLibrary/tree-sitter-c/tree-sitter-c.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,35 +7,13 @@
<PackageOutputPath>..\..\..\nupkgs</PackageOutputPath>
</PropertyGroup>

<UsingTask
TaskName="ReplaceVersionInJson"
TaskFactory="RoslynCodeTaskFactory"
AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll">
<ParameterGroup>
<FilePath ParameterType="System.String" Required="true" />
<NewVersion ParameterType="System.String" Required="true" />
</ParameterGroup>
<Task>
<Code Type="Fragment" Language="cs">
<![CDATA[
string filePath = FilePath;
string newVersion = NewVersion;
string content = System.IO.File.ReadAllText(filePath);
content = System.Text.RegularExpressions.Regex.Replace(content, @"(\d+\.\d+\.\d+)", newVersion);
System.IO.File.WriteAllText(filePath, content);
]]>
</Code>
</Task>
</UsingTask>

<Target Name="UpdateRuntimeJsonVersion" BeforeTargets="Build">
<ReplaceVersionInJson FilePath="runtime.json" NewVersion="$(Version)" />
<ItemGroup>
<None Include="runtime.json">
<Link>%(Filename)%(Extension)</Link>
<Pack>true</Pack>
<PackagePath>\</PackagePath>
</None>
</ItemGroup>
</Target>
<ItemGroup>
<PackageReference Include="tree-sitter-c.runtime.linux-arm64" Version="*"></PackageReference>
<PackageReference Include="tree-sitter-c.runtime.linux-x64" Version="*"></PackageReference>
<PackageReference Include="tree-sitter-c.runtime.osx-x64" Version="*"></PackageReference>
<PackageReference Include="tree-sitter-c.runtime.osx-arm64" Version="*"></PackageReference>
<PackageReference Include="tree-sitter-c.runtime.win-arm64" Version="*"></PackageReference>
<PackageReference Include="tree-sitter-c.runtime.win-x64" Version="*"></PackageReference>
<PackageReference Include="tree-sitter-c.runtime.win-x86" Version="*"></PackageReference>
</ItemGroup>
</Project>
39 changes: 0 additions & 39 deletions src/NativeLibrary/tree-sitter-cpp/runtime.json

This file was deleted.

40 changes: 9 additions & 31 deletions src/NativeLibrary/tree-sitter-cpp/tree-sitter-cpp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,35 +7,13 @@
<PackageOutputPath>..\..\..\nupkgs</PackageOutputPath>
</PropertyGroup>

<UsingTask
TaskName="ReplaceVersionInJson"
TaskFactory="RoslynCodeTaskFactory"
AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll">
<ParameterGroup>
<FilePath ParameterType="System.String" Required="true" />
<NewVersion ParameterType="System.String" Required="true" />
</ParameterGroup>
<Task>
<Code Type="Fragment" Language="cs">
<![CDATA[
string filePath = FilePath;
string newVersion = NewVersion;
string content = System.IO.File.ReadAllText(filePath);
content = System.Text.RegularExpressions.Regex.Replace(content, @"(\d+\.\d+\.\d+)", newVersion);
System.IO.File.WriteAllText(filePath, content);
]]>
</Code>
</Task>
</UsingTask>

<Target Name="UpdateRuntimeJsonVersion" BeforeTargets="Build">
<ReplaceVersionInJson FilePath="runtime.json" NewVersion="$(Version)" />
<ItemGroup>
<None Include="runtime.json">
<Link>%(Filename)%(Extension)</Link>
<Pack>true</Pack>
<PackagePath>\</PackagePath>
</None>
</ItemGroup>
</Target>
<ItemGroup>
<PackageReference Include="tree-sitter-cpp.runtime.linux-arm64" Version="*"></PackageReference>
<PackageReference Include="tree-sitter-cpp.runtime.linux-x64" Version="*"></PackageReference>
<PackageReference Include="tree-sitter-cpp.runtime.osx-x64" Version="*"></PackageReference>
<PackageReference Include="tree-sitter-cpp.runtime.osx-arm64" Version="*"></PackageReference>
<PackageReference Include="tree-sitter-cpp.runtime.win-arm64" Version="*"></PackageReference>
<PackageReference Include="tree-sitter-cpp.runtime.win-x64" Version="*"></PackageReference>
<PackageReference Include="tree-sitter-cpp.runtime.win-x86" Version="*"></PackageReference>
</ItemGroup>
</Project>
39 changes: 0 additions & 39 deletions src/NativeLibrary/tree-sitter-json/runtime.json

This file was deleted.

40 changes: 9 additions & 31 deletions src/NativeLibrary/tree-sitter-json/tree-sitter-json.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,35 +7,13 @@
<PackageOutputPath>..\..\..\nupkgs</PackageOutputPath>
</PropertyGroup>

<UsingTask
TaskName="ReplaceVersionInJson"
TaskFactory="RoslynCodeTaskFactory"
AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll">
<ParameterGroup>
<FilePath ParameterType="System.String" Required="true" />
<NewVersion ParameterType="System.String" Required="true" />
</ParameterGroup>
<Task>
<Code Type="Fragment" Language="cs">
<![CDATA[
string filePath = FilePath;
string newVersion = NewVersion;
string content = System.IO.File.ReadAllText(filePath);
content = System.Text.RegularExpressions.Regex.Replace(content, @"(\d+\.\d+\.\d+)", newVersion);
System.IO.File.WriteAllText(filePath, content);
]]>
</Code>
</Task>
</UsingTask>

<Target Name="UpdateRuntimeJsonVersion" BeforeTargets="Build">
<ReplaceVersionInJson FilePath="runtime.json" NewVersion="$(Version)" />
<ItemGroup>
<None Include="runtime.json">
<Link>%(Filename)%(Extension)</Link>
<Pack>true</Pack>
<PackagePath>\</PackagePath>
</None>
</ItemGroup>
</Target>
<ItemGroup>
<PackageReference Include="tree-sitter-json.runtime.linux-arm64" Version="*"></PackageReference>
<PackageReference Include="tree-sitter-json.runtime.linux-x64" Version="*"></PackageReference>
<PackageReference Include="tree-sitter-json.runtime.osx-x64" Version="*"></PackageReference>
<PackageReference Include="tree-sitter-json.runtime.osx-arm64" Version="*"></PackageReference>
<PackageReference Include="tree-sitter-json.runtime.win-arm64" Version="*"></PackageReference>
<PackageReference Include="tree-sitter-json.runtime.win-x64" Version="*"></PackageReference>
<PackageReference Include="tree-sitter-json.runtime.win-x86" Version="*"></PackageReference>
</ItemGroup>
</Project>
39 changes: 0 additions & 39 deletions src/NativeLibrary/tree-sitter-lua/runtime.json

This file was deleted.

41 changes: 9 additions & 32 deletions src/NativeLibrary/tree-sitter-lua/tree-sitter-lua.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,36 +6,13 @@
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<PackageOutputPath>..\..\..\nupkgs</PackageOutputPath>
</PropertyGroup>

<UsingTask
TaskName="ReplaceVersionInJson"
TaskFactory="RoslynCodeTaskFactory"
AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll">
<ParameterGroup>
<FilePath ParameterType="System.String" Required="true" />
<NewVersion ParameterType="System.String" Required="true" />
</ParameterGroup>
<Task>
<Code Type="Fragment" Language="cs">
<![CDATA[
string filePath = FilePath;
string newVersion = NewVersion;
string content = System.IO.File.ReadAllText(filePath);
content = System.Text.RegularExpressions.Regex.Replace(content, @"(\d+\.\d+\.\d+)", newVersion);
System.IO.File.WriteAllText(filePath, content);
]]>
</Code>
</Task>
</UsingTask>

<Target Name="UpdateRuntimeJsonVersion" BeforeTargets="Build">
<ReplaceVersionInJson FilePath="runtime.json" NewVersion="$(Version)" />
<ItemGroup>
<None Include="runtime.json">
<Link>%(Filename)%(Extension)</Link>
<Pack>true</Pack>
<PackagePath>\</PackagePath>
</None>
</ItemGroup>
</Target>
<ItemGroup>
<PackageReference Include="tree-sitter-lua.runtime.linux-arm64" Version="*"></PackageReference>
<PackageReference Include="tree-sitter-lua.runtime.linux-x64" Version="*"></PackageReference>
<PackageReference Include="tree-sitter-lua.runtime.osx-x64" Version="*"></PackageReference>
<PackageReference Include="tree-sitter-lua.runtime.osx-arm64" Version="*"></PackageReference>
<PackageReference Include="tree-sitter-lua.runtime.win-arm64" Version="*"></PackageReference>
<PackageReference Include="tree-sitter-lua.runtime.win-x64" Version="*"></PackageReference>
<PackageReference Include="tree-sitter-lua.runtime.win-x86" Version="*"></PackageReference>
</ItemGroup>
</Project>
39 changes: 0 additions & 39 deletions src/NativeLibrary/tree-sitter/runtime.json

This file was deleted.

Loading

0 comments on commit f2e1bf4

Please sign in to comment.